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

countries API page (React, react-router-dom, API, SCSS, Vite)

@hassaneljebyly

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


What are you most proud of, and what would you do differently next time?

since we can't style I decided to make a custom select menu that works like the native tag, It supports:

  • arrow up/down navigation
  • when select menu is open preselected element gets focus if it doesn't exists then first element or gets focus
  • when Escape or Tab key are pushed it closes the menu while giving focus to menu button
  • also dynamic select options
export default function SelectMenu() {
  const {
    selectedOption,
    filterExpanded,
    selectOptions,
    handleClick,
    handleKeyDown,
  } = useSelectMenu();
  return (
    
      
        {selectedOption === '' ? 'Filter by Region' : selectedOption}
        
      
      
        {selectOptions.map((option) => (
          
            {option}
          
        ))}
      
    
  );
}

What challenges did you encounter, and how did you overcome them?

kept animations until last minutes, wasn't a good idea

Community feedback

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