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

REST Countries API App

@victoribironke

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

Community feedback

yishak abrham 2,150

@yishak621

Posted

Good design but u didn't design a night mode toggler and border country button in the single country page

0

@victoribironke

Posted

@yishak621 I decided not to do the night mode as it was optional in the style guide. The border countries the API returned were in the short form and the design requested the full country name so I wasn't sure how to do it.

0
yishak abrham 2,150

@yishak621

Posted

@vdiqbd o sure u r right ...u can fetch the data again using the shortnames in another endpoint url https://restcountries.com/v3.1/alpha?codes=BRA,GER,ENG eg . BRA GER...it will grab that country data so from that specific data u can extract the common name and display it example

      //fetching datas using codes endpoint 
       const codes = borders 
         .map((border) => { 
           return border; 
         }) 
         .join(','); 
       const newurl = `https://restcountries.com/v3.1/alpha?codes=${codes}`; 
       const borderCountries = await fetchAllData(newurl); 
  
       const newHTML = await borderCountries 
         .map((border) => { 
           return `<button class="btn">${border.name.common}</button>`; 
         }) 
         .join(''); 
      borderCountry.innerHTML = newHTML;
0

@victoribironke

Posted

@yishak621 Thanks, I have fixed it.

1

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