Skip to content
  • Unlock Pro
  • Log in with GitHub
Profile
OverviewSolutions
28
Comments
2
Nika Botchorishvili
@NikaBotchorishvili

All comments

  • IgnatiusVisnu•70
    @IgnatiusVisnu
    Submitted almost 2 years ago

    Product preview card component using flexbox

    1
    Nika Botchorishvili•490
    @NikaBotchorishvili
    Posted almost 2 years ago

    Good job,

    I would suggest to not use percentage value for width here and instead of that use fixed width, which you'll modify with media queries when you notice it isn't looking right.

    Take care!👋

  • Tama•290
    @mahdipratama
    Submitted about 2 years ago

    REST Countries API with color theme switcher || REACT.JS + VITE

    #react#react-router
    1
    Nika Botchorishvili•490
    @NikaBotchorishvili
    Posted about 2 years ago

    Hello @mahdipratama 👋

    Looking over your code I noticed that you use your search term in the function from which you return all your countries.

       ...
       const [searchTerm, setSearchTerm] = useState('a');
    
       const fetchAllCountry = useCallback(async () => {
            setLoading(true);
       try {
            const response = await fetch(`${searchCountryURL}${searchTerm}`);
       ...
     
    

    You should split the logic for when the user is searching for a country and when all the countries are loaded.

    Use this API ENDPOINT to request all of the countries.

    Also in the part where you create search term state:

       ...
       const [searchTerm, setSearchTerm] = useState('a');
       ...
    

    You set the default value to be 'a' which will return many of the countries as a data but not all of them. (You can compare the return data of /all and /name/a)

    So to say it shorter split the searching and the initial API requests.

    In conclusion the project looks really polished.❤️ Good job and keep going ! 🔥

Frontend Mentor logo

Stay up to datewith new challenges, featured solutions, selected articles, and our latest news

Frontend Mentor

  • Unlock Pro
  • Contact us
  • FAQs
  • Become a partner

Explore

  • Learning paths
  • Challenges
  • Solutions
  • Articles

Community

  • Discord
  • Guidelines

For companies

  • Hire developers
  • Train developers
© Frontend Mentor 2019 - 2025
  • Terms
  • Cookie Policy
  • Privacy Policy
  • License

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub

Oops! 😬

You need to be logged in before you can do that.

Log in with GitHub