Skip to content

fidellim/REST-Countries-API-with-Color-Theme-Switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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. Frontend Mentor challenges help you improve your coding skills by building realistic projects.

Table of contents

Overview

The challenge

Your challenge is to integrate with the REST Countries API to pull country data and display it like in the designs.

You can use any JavaScript framework/library on the front-end such as React or Vue. You also have complete control over which packages you use to do things like make HTTP requests or style your project.

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)

Screenshot

Solution PC Dark Solution PC Light Solution PC Detail Dark Solution PC Detail Light Solution Mobile Detail Dark Solution Mobile Detail Light Solution Mobile Dark Solution Mobile Light

Links

My process

Built with

  • Semantic HTML5 markup
  • SASS
  • Flexbox
  • Mobile-first workflow
  • React - JS library

What I learned

I was able to practice 7-1 pattern using SASS. It was also my first time tackling Routes, Switches, Params, and other React features. I was also able to practice some conditional rendering.

@import "abstract/variables";

@import "components/country";
@import "components/button";

@import "base/reset";
@import "base/typography";

@import "layout/header";
@import "layout/countries";
@import "layout/countryDetails";

@import "themes/dark";
className={isFilterToggled ? "regions openRegions" : "regions"}

<Router>
  <div className={isToggled ? "dark" : null}>
    {/* pass handleToggle func as prop */}
    <Header handleToggle={handleToggle} />
    <Switch>
      <Route exact path="/">
        <Countries />
      </Route>
      <Route path="/:name">
        <CountryDetails />
      </Route>
    </Switch>
  </div>
</Router>

Continued development

To practice more frontend projects using React. I would also like to familiarize myself more on other React features like Switches and Routes.

Useful resources

Author

Acknowledgments

I would like to thank Florin Pop for giving me ideas for this project. If you are interested in learning from him, have a look at his Youtube Channel. I would also like to thank the Frontend Mentor community for answering any inquries I have.

About

A web app to display all countries with a theme switcher (dark/light mode)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published