Skip to content

Commit

Permalink
Merge pull request #2378 from Maxime-J/filterTags
Browse files Browse the repository at this point in the history
Enhance filter tags
  • Loading branch information
mikecao authored Dec 1, 2023
2 parents a7cb0ea + 0430903 commit fc66244
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/metrics/FilterTags.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ import { safeDecodeURI } from 'next-basics';
import { Button, Icon, Icons, Text } from 'react-basics';
import useNavigation from 'components/hooks/useNavigation';
import useMessages from 'components/hooks/useMessages';
import useFormat from 'components/hooks/useFormat';
import styles from './FilterTags.module.css';

export function FilterTags({ params }) {
const { formatMessage, labels } = useMessages();
const { formatValue } = useFormat();
const {
router,
makeUrl,
Expand Down Expand Up @@ -34,7 +36,7 @@ export function FilterTags({ params }) {
return (
<div key={key} className={styles.tag} onClick={() => handleCloseFilter(key)}>
<Text>
<b>{`${key}`}</b> = {`${safeDecodeURI(params[key])}`}
<b>{formatMessage(labels[key])}</b> = {formatValue(safeDecodeURI(params[key]), key)}
</Text>
<Icon>
<Icons.Close />
Expand Down
4 changes: 4 additions & 0 deletions src/components/metrics/FilterTags.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,7 @@
.tag:hover {
background: var(--blue200);
}

.tag b {
text-transform: lowercase;
}

0 comments on commit fc66244

Please sign in to comment.