Skip to content

Instantly share code, notes, and snippets.

@karlguillotte
Created April 22, 2021 19:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save karlguillotte/a8383c81e79e2fbffa4cdf30c7e77aef to your computer and use it in GitHub Desktop.
Save karlguillotte/a8383c81e79e2fbffa4cdf30c7e77aef to your computer and use it in GitHub Desktop.
const path = 'https://assets.avalanche.ca/images/'
const iconURLs = new Map([
['fall', PATH + 'early_season_icon.svg'],
['spring', PATH + 'spring_situation_icon.svg'],
['summer', PATH + 'summer_conditions_icon.svg'],
])
const src = IconURLs.get(payload.season.value) // payload is https://api.avalanche.ca/forecasts/fr/products/chic-chocs
<img src={src} alt='' />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment