Git Product home page Git Product logo

Comments (6)

Lito-Frito avatar Lito-Frito commented on July 17, 2024 1

Interesting. If you don't mind waiting, I'll take a look tomorrow and tinker with a bit to see if I can get it to work. Thanks for the tip,I really appreciate the guidance

from coronavirus-map-dashboard.

Lito-Frito avatar Lito-Frito commented on July 17, 2024

Had the same issue after I built off your first tutorial. I destructed the info from the API so I could pull the wiki link to the PNGs itself (lines 46, 49-50) and it pulls an enigma flag to show it doesn't have a flag attached to it:

image

I know you said you'd rather it blank if no flag, but I thought this flag it showed kept the formatting consistent.

If you think this isn't what you're going for aesthetically, then I can take a look and see what I can figure out

from coronavirus-map-dashboard.

colbyfayock avatar colbyfayock commented on July 17, 2024

@crc8109 im okay either way! mostly wanted to fix the undefined issue. was only thinking of not showing a flag at all since it doesn't really have the right one there, but that represents that. if you want to take a stab at it you can choose :)

from coronavirus-map-dashboard.

Lito-Frito avatar Lito-Frito commented on July 17, 2024

@colbyfayock I took a look and it seems the main issue is getEmojiFlag. The API has MS Zaandam's country code as null. So when the function reads the code, it returns an undefined.

I'm honestly very very new to web dev, so I can't exactly figure out how to fix it. But I think destructuring the info under 'country info' so that 'flag', not country code is pulled. And then making the container with the stats pull the url for the png and setting that as an img tag.

https://github.com/crc8109/COVID19-World-Tracker/blob/master/src/pages/index.js

I probably didn't explain this too well but lines 46, 49-50, & 102 are what I'm trying to say.

Sorry I wasn't much help. But hopefully you're able to figure out how to manipulate getEmojiFlag so it returns something other than undefined

from coronavirus-map-dashboard.

colbyfayock avatar colbyfayock commented on July 17, 2024

no problem at all! what if we did something like:

let header = country;

if ( flag ) {
  header = `<img src="${flag}"> ${header}`;
}

Then inside the stats HTML we could do:

const stats = `
        <span class="icon-marker-tooltip">
          <h2>${header}</h2>

If you'd rather me hop in and fix it I can do that too :) but in case you wanted to take a shot

from coronavirus-map-dashboard.

colbyfayock avatar colbyfayock commented on July 17, 2024

looks like it now shows a ? emoji flag so it's fixed ✅

from coronavirus-map-dashboard.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.