Files
web/apps/scandic-web/components/Footer/Navigation/SecondaryNav/utils.ts
Erik Tiekstra ce469bc4b4 Feat/BOOK-117 svg accessibility
* feat(BOOK-117): Added aria-label to Scandic Friends levels
* feat(BOOK-117): Added aria-label to hotel logos
* feat(BOOK-117): Added alt text to app download images
* feat(BOOK-117): Added same logo component to footer as the one in the header
* feat(BOOK-117): Added aria attributes to icons similar to how we handled MaterialIcon aria attributes

Approved-by: Bianca Widstam
Approved-by: Matilda Landström
2025-11-13 06:34:18 +00:00

78 lines
2.0 KiB
TypeScript

import type { IntlShape } from "react-intl"
export function getAppDownloadAttributes(intl: IntlShape, key: string) {
const appleAlt = intl.formatMessage({
id: "footer.appDownloadAlt.apple",
defaultMessage: "Download on the App Store",
})
const googleAlt = intl.formatMessage({
id: "footer.appDownloadAlt.google",
defaultMessage: "Get it on Google Play",
})
switch (key) {
case "Apple_da":
return {
src: "/_static/img/store-badges/app-store-badge-da.svg",
alt: appleAlt,
}
case "Apple_de":
return {
src: "/_static/img/store-badges/app-store-badge-de.svg",
alt: appleAlt,
}
case "Apple_en":
return {
src: "/_static/img/store-badges/app-store-badge-en.svg",
alt: appleAlt,
}
case "Apple_fi":
return {
src: "/_static/img/store-badges/app-store-badge-fi.svg",
alt: appleAlt,
}
case "Apple_no":
return {
src: "/_static/img/store-badges/app-store-badge-no.svg",
alt: appleAlt,
}
case "Apple_sv":
return {
src: "/_static/img/store-badges/app-store-badge-sv.svg",
alt: appleAlt,
}
case "Google_da":
return {
src: "/_static/img/store-badges/google-play-badge-da.svg",
alt: googleAlt,
}
case "Google_de":
return {
src: "/_static/img/store-badges/google-play-badge-de.svg",
alt: googleAlt,
}
case "Google_en":
return {
src: "/_static/img/store-badges/google-play-badge-en.svg",
alt: googleAlt,
}
case "Google_fi":
return {
src: "/_static/img/store-badges/google-play-badge-fi.svg",
alt: googleAlt,
}
case "Google_no":
return {
src: "/_static/img/store-badges/google-play-badge-no.svg",
alt: googleAlt,
}
case "Google_sv":
return {
src: "/_static/img/store-badges/google-play-badge-sv.svg",
alt: googleAlt,
}
default:
return null
}
}