CleverProgrammers / react-covid-tracker

202 stars 252 forks source link

update Circle color auto change #14

Open pcreem opened 4 years ago

pcreem commented 4 years ago

update util.js

const casesTypeColors = {
  cases: {
    multiplier: 800,
    option: { color:"#cc1034", fillColor: "#cc1034" },
  },
  recovered: {
    multiplier: 1200,
    option: { color:"#7dd71d", fillColor: "#7dd71d" },
  },
  deaths: {
    multiplier: 2000,
    option: { color:"#ff6c47", fillColor: "#ff6c47" }
  },
};
<Circle
      center={[country.countryInfo.lat, country.countryInfo.long]}
      fillOpacity={0.4}
      pathOptions={casesTypeColors[casesType].option}
      radius={
        Math.sqrt(country[casesType]) * casesTypeColors[casesType].multiplier
      }
    >
charlesausejojr commented 4 years ago

Thanks man! I have been solving this little feature for an hour.

mathvaillant commented 3 years ago

Thank you so much!! I couldn't update my circle's colors before, now that solves the bug

Chandan-CV commented 3 years ago

Thank you soooo much!!!

kunal8164705 commented 3 years ago

thanks man

nrrc102 commented 3 years ago

thank you!

Vidhu007 commented 3 years ago

Wow...Thank you so much..this color thing was annoying me a lot !