mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-22 09:57:00 +01:00
localize filter tags
This commit is contained in:
parent
8a4623eb7b
commit
0430903483
@ -2,10 +2,12 @@ import { safeDecodeURI } from 'next-basics';
|
|||||||
import { Button, Icon, Icons, Text } from 'react-basics';
|
import { Button, Icon, Icons, Text } from 'react-basics';
|
||||||
import useNavigation from 'components/hooks/useNavigation';
|
import useNavigation from 'components/hooks/useNavigation';
|
||||||
import useMessages from 'components/hooks/useMessages';
|
import useMessages from 'components/hooks/useMessages';
|
||||||
|
import useFormat from 'components/hooks/useFormat';
|
||||||
import styles from './FilterTags.module.css';
|
import styles from './FilterTags.module.css';
|
||||||
|
|
||||||
export function FilterTags({ params }) {
|
export function FilterTags({ params }) {
|
||||||
const { formatMessage, labels } = useMessages();
|
const { formatMessage, labels } = useMessages();
|
||||||
|
const { formatValue } = useFormat();
|
||||||
const {
|
const {
|
||||||
router,
|
router,
|
||||||
makeUrl,
|
makeUrl,
|
||||||
@ -34,7 +36,7 @@ export function FilterTags({ params }) {
|
|||||||
return (
|
return (
|
||||||
<div key={key} className={styles.tag} onClick={() => handleCloseFilter(key)}>
|
<div key={key} className={styles.tag} onClick={() => handleCloseFilter(key)}>
|
||||||
<Text>
|
<Text>
|
||||||
<b>{`${key}`}</b> = {`${safeDecodeURI(params[key])}`}
|
<b>{formatMessage(labels[key])}</b> = {formatValue(safeDecodeURI(params[key]), key)}
|
||||||
</Text>
|
</Text>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Icons.Close />
|
<Icons.Close />
|
||||||
|
@ -24,3 +24,7 @@
|
|||||||
.tag:hover {
|
.tag:hover {
|
||||||
background: var(--blue200);
|
background: var(--blue200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tag b {
|
||||||
|
text-transform: lowercase;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user