fix(frontend): alt-text for flags (#2894)

Fixes #2397
This commit is contained in:
Erb3 2024-11-03 18:10:09 +01:00 committed by GitHub
parent f5f876e458
commit 66d943d391
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -192,15 +192,20 @@
class="country-value"
>
<div class="country-flag-container">
<img
:src="
name.toLowerCase() === 'xx' || !name
? 'https://cdn.modrinth.com/placeholder-banner.svg'
: countryCodeToFlag(name)
"
alt="Hidden country"
class="country-flag"
/>
<template v-if="name.toLowerCase() === 'xx' || !name">
<img
src="https://cdn.modrinth.com/placeholder-banner.svg"
alt="Placeholder flag"
class="country-flag"
/>
</template>
<template v-else>
<img
:src="countryCodeToFlag(name)"
:alt="`${countryCodeToName(name)}'s flag`"
class="country-flag"
/>
</template>
</div>
<div class="country-text">
<strong class="country-name"
@ -246,15 +251,20 @@
class="country-value"
>
<div class="country-flag-container">
<img
:src="
name.toLowerCase() === 'xx' || !name
? 'https://cdn.modrinth.com/placeholder-banner.svg'
: countryCodeToFlag(name)
"
alt="Hidden country"
class="country-flag"
/>
<template v-if="name.toLowerCase() === 'xx' || !name">
<img
src="https://cdn.modrinth.com/placeholder-banner.svg"
alt="Placeholder flag"
class="country-flag"
/>
</template>
<template v-else>
<img
:src="countryCodeToFlag(name)"
:alt="`${countryCodeToName(name)}'s flag`"
class="country-flag"
/>
</template>
</div>
<div class="country-text">
<strong class="country-name">