This is a solution to the REST Countries API with color theme switcher challenge on Frontend Mentor. Frontend Mentor challenges help you improve your coding skills by building realistic projects.
Users should be able to:
- See all countries from the API on the homepage
- Search for a country using an
input
field - Filter countries by region
- Click on a country to see more detailed information on a separate page
- Click through to the border countries on the detail page
- Toggle the color scheme between light and dark mode (optional)
- Solution URL: Github Repository
- Live Site URL: Vercel
- Semantic HTML5 markup
- Tailwindcss
- Flexbox
- CSS Grid
- Mobile-first workflow (Well I forgot this but tailwind saved me :>)
- Next.js - React framework
Using react-query
was quite a challenge. specially in Next.js because I needed to somehow manage using Server Components and Client Components. thankfully react-query
already has a solution for this. I'm not sure though if this is a good use if you need to load a long list like I did here in home page.
I also used shadcn/ui
for some ui components like dropdown and select which saved some time. althogh required some theming.
I learned about next-theme
package which provides theme context and saves a lot of time.
- Website - Pourya Pourbagheri
- Frontend Mentor - @pouryapb
- Linkedin - @pouryapb