mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
Added fallback in case country code not found.
This commit is contained in:
parent
9e11866ddd
commit
b6f3f57455
@ -17,7 +17,7 @@ export function CountriesTable({ websiteId, ...props }) {
|
|||||||
value={countryNames[code] && code}
|
value={countryNames[code] && code}
|
||||||
label={countryNames[code]}
|
label={countryNames[code]}
|
||||||
>
|
>
|
||||||
<img src={`/images/flags/${code.toLowerCase()}.png`} alt={code} />
|
<img src={`/images/flags/${code?.toLowerCase() || 'xx'}.png`} alt={code} />
|
||||||
</FilterLink>
|
</FilterLink>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ export function RegionsTable({ websiteId, ...props }) {
|
|||||||
const renderLink = ({ x: code }) => {
|
const renderLink = ({ x: code }) => {
|
||||||
return (
|
return (
|
||||||
<FilterLink id="region" className={locale} value={code} label={renderLabel(code)}>
|
<FilterLink id="region" className={locale} value={code} label={renderLabel(code)}>
|
||||||
<img src={`/images/flags/${code.split('-')[0].toLowerCase()}.png`} alt={code} />
|
<img src={`/images/flags/${code?.split('-')?.[0]?.toLowerCase() || 'xx'}.png`} alt={code} />
|
||||||
</FilterLink>
|
</FilterLink>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
BIN
public/images/flags/xx.png
Normal file
BIN
public/images/flags/xx.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 106 B |
Loading…
x
Reference in New Issue
Block a user