Skip to content

An app that fetches country data from REST Countries API and display it,user can search through countries or filter by region.

Notifications You must be signed in to change notification settings

FevenSeyfu/Countries-color-theme-switcher

Repository files navigation

Frontend Mentor - REST Countries API with color theme switcher solution

This is a solution to the REST Countries API with color theme switcher challenge on Frontend Mentor. A simple app that fetches countries data from an api and displays with extended features to filter by region,search countires by name and theme switcher between dark and light.

Table of contents

Overview

Features

Users are 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

Screenshot

Rest Countries demo

Links

My process

Built with

What I learned

From This Challenge I have practiced using react API, theme toggleing in react and using tailwind css,Fetching adn Rendering data from API

const ThemeProvider = ({children}) => {
    const[isDarkTheme, setIsDarkTheme] = useState (false)

    const toggleTheme = () => {
        setIsDarkTheme((prevTheme) => !prevTheme)

    }
    const theme = isDarkTheme ? 'dark' : 'light';

    return (
        <ThemeContext.Provider value={{ theme, toggleTheme }}>
            {children}
        </ThemeContext.Provider>
    )
};

Useful resources

  • React Context API - This helped me to easily use React context with useContext hook. I'd recommend it to anyone still learning this concept.

Author

Acknowledgments

I would like to thank FrontedMentor for providing the Design as a well assets for this challenge.

About

An app that fetches country data from REST Countries API and display it,user can search through countries or filter by region.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published