Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

REST Country API with Theme Switcher

Sang Le 520

@sqle157

Desktop design screenshot for the REST Countries API with color theme switcher coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
  • API
4advanced
View challenge

Design comparison


SolutionDesign

Solution retrospective


Hi,

This is my solution to this challenge! It was a fun challenge, and I learned a lot about Context API and useReducer hook.

Any feedbacks are welcome! Happy coding and have a nice day!

Community feedback

@vatsalsinghkv

Posted

It's nice but it's slow like while searching for a country. How'd you manage to get border countries name

0

Sang Le 520

@sqle157

Posted

@vatsalsinghkv Hi, thank you for your feedback!

The searching depends on the fetch request so I'm not sure if I can speed that up. For the border name, I used the api endpoint where you can fetch country by country code and return the name of the country according to that border code.

I hope this answers your question!

0

@vatsalsinghkv

Posted

@sqle157 well I faced the same challenge so to speed up I fetched every country data and while searching for it I didn't make and http request and even when country is visited. Thanks I really liked your idea of getting border names but wouldn't that make your app slow?

0
Sang Le 520

@sqle157

Posted

@vatsalsinghkv It would, but to make up for it, I make a Spinner so it will appear to be loading for data everytime you visit the country detail page.

It will increase the user experience and doesn’t make the app looks slow. When users use the app, the spinner will give them the feel that the app is loading, not just some instant view of the page.

In the end, it depends on how you handle the challenge and how to make the UX better with your solution.

I know my solution is not the most appropriate one, but I hope this can give you some inspiration on coding this challenge.

0

Please log in to post a comment

Log in with GitHub
Discord logo

Join our Discord community

Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!

Join our Discord