Added country flags.
|
@ -6,14 +6,15 @@ import usePageQuery from 'hooks/usePageQuery';
|
||||||
import useMessages from 'hooks/useMessages';
|
import useMessages from 'hooks/useMessages';
|
||||||
import styles from './FilterLink.module.css';
|
import styles from './FilterLink.module.css';
|
||||||
|
|
||||||
export function FilterLink({ id, value, label, externalUrl }) {
|
export function FilterLink({ id, value, label, externalUrl, children, className }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
const { resolveUrl, query } = usePageQuery();
|
const { resolveUrl, query } = usePageQuery();
|
||||||
const active = query[id] !== undefined;
|
const active = query[id] !== undefined;
|
||||||
const selected = query[id] === value;
|
const selected = query[id] === value;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.row}>
|
<div className={classNames(styles.row, className)}>
|
||||||
|
{children}
|
||||||
{!value && `(${label || formatMessage(labels.unknown)})`}
|
{!value && `(${label || formatMessage(labels.unknown)})`}
|
||||||
{value && (
|
{value && (
|
||||||
<Link
|
<Link
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
.row {
|
.row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row .inactive {
|
.row .inactive {
|
||||||
|
|
|
@ -11,9 +11,14 @@ export function CountriesTable({ websiteId, ...props }) {
|
||||||
|
|
||||||
function renderLink({ x: code }) {
|
function renderLink({ x: code }) {
|
||||||
return (
|
return (
|
||||||
<div className={locale}>
|
<FilterLink
|
||||||
<FilterLink id="country" value={countryNames[code] && code} label={countryNames[code]} />
|
id="country"
|
||||||
</div>
|
className={locale}
|
||||||
|
value={countryNames[code] && code}
|
||||||
|
label={countryNames[code]}
|
||||||
|
>
|
||||||
|
<img src={`/images/flags/${code.toLowerCase()}.png`} alt={code} />
|
||||||
|
</FilterLink>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,11 +15,11 @@ export function RegionsTable({ websiteId, ...props }) {
|
||||||
return regions[x] ? `${regions[x]}, ${countryNames[x.split('-')[0]]}` : x;
|
return regions[x] ? `${regions[x]}, ${countryNames[x.split('-')[0]]}` : x;
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderLink = ({ x }) => {
|
const renderLink = ({ x: code }) => {
|
||||||
return (
|
return (
|
||||||
<div className={locale}>
|
<FilterLink id="region" className={locale} value={code} label={renderLabel(code)}>
|
||||||
<FilterLink id="region" value={x} label={renderLabel(x)} />
|
<img src={`/images/flags/${code.split('-')[0].toLowerCase()}.png`} alt={code} />
|
||||||
</div>
|
</FilterLink>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 235 B |
After Width: | Height: | Size: 122 B |
After Width: | Height: | Size: 296 B |
After Width: | Height: | Size: 281 B |
After Width: | Height: | Size: 245 B |
After Width: | Height: | Size: 183 B |
After Width: | Height: | Size: 110 B |
After Width: | Height: | Size: 201 B |
After Width: | Height: | Size: 186 B |
After Width: | Height: | Size: 141 B |
After Width: | Height: | Size: 237 B |
After Width: | Height: | Size: 102 B |
After Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 139 B |
After Width: | Height: | Size: 163 B |
After Width: | Height: | Size: 150 B |
After Width: | Height: | Size: 175 B |
After Width: | Height: | Size: 149 B |
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 140 B |
After Width: | Height: | Size: 97 B |
After Width: | Height: | Size: 153 B |
After Width: | Height: | Size: 264 B |
After Width: | Height: | Size: 107 B |
After Width: | Height: | Size: 353 B |
After Width: | Height: | Size: 286 B |
After Width: | Height: | Size: 350 B |
After Width: | Height: | Size: 145 B |
After Width: | Height: | Size: 321 B |
After Width: | Height: | Size: 260 B |
After Width: | Height: | Size: 147 B |
After Width: | Height: | Size: 316 B |
After Width: | Height: | Size: 150 B |
After Width: | Height: | Size: 114 B |
After Width: | Height: | Size: 145 B |
After Width: | Height: | Size: 253 B |
After Width: | Height: | Size: 171 B |
After Width: | Height: | Size: 211 B |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 206 B |
After Width: | Height: | Size: 164 B |
After Width: | Height: | Size: 129 B |
After Width: | Height: | Size: 114 B |
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 135 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 112 B |
After Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 163 B |
After Width: | Height: | Size: 146 B |
After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 240 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 97 B |
After Width: | Height: | Size: 234 B |
After Width: | Height: | Size: 127 B |
After Width: | Height: | Size: 200 B |
After Width: | Height: | Size: 164 B |
After Width: | Height: | Size: 160 B |
After Width: | Height: | Size: 237 B |
After Width: | Height: | Size: 117 B |
After Width: | Height: | Size: 160 B |
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 204 B |
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 215 B |
After Width: | Height: | Size: 121 B |
After Width: | Height: | Size: 257 B |
After Width: | Height: | Size: 285 B |
After Width: | Height: | Size: 156 B |
After Width: | Height: | Size: 147 B |
After Width: | Height: | Size: 105 B |
After Width: | Height: | Size: 98 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 420 B |
After Width: | Height: | Size: 196 B |
After Width: | Height: | Size: 228 B |
After Width: | Height: | Size: 179 B |
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 154 B |
After Width: | Height: | Size: 155 B |
After Width: | Height: | Size: 223 B |
After Width: | Height: | Size: 190 B |
After Width: | Height: | Size: 119 B |
After Width: | Height: | Size: 113 B |
After Width: | Height: | Size: 299 B |
After Width: | Height: | Size: 244 B |
After Width: | Height: | Size: 158 B |
After Width: | Height: | Size: 327 B |
After Width: | Height: | Size: 156 B |
After Width: | Height: | Size: 165 B |