Skip to content

Commit

Permalink
fix(multi-select): use translation
Browse files Browse the repository at this point in the history
  • Loading branch information
Daryl-L committed Aug 8, 2024
1 parent ef5b90d commit 7392a0f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/pages/Xudts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { FC, ReactNode, useState } from 'react'
import { ColumnGroupType, ColumnType } from 'antd/lib/table'
import dayjs from 'dayjs'
import classNames from 'classnames'
import { TFunction } from 'i18next'
import type { XUDT } from '../../models/Xudt'
import { Link } from '../../components/Link'
import Content from '../../components/Content'
Expand All @@ -29,7 +30,7 @@ import { scripts } from '../ScriptList'

type SortField = 'transactions' | 'addresses_count' | 'created_time' | 'mint_status'

const filterList = [
const getfilterList = (t: TFunction) => [
// TODO: maybe removed in the future, hold on
// {
// key: 'out-of-length-range',
Expand All @@ -39,19 +40,19 @@ const filterList = [
// },
{
key: 'layer-1-asset',
value: 'Layer 1 Asset',
value: t('layer-1-asset'),
title: <XUDTTag tagName="layer-1-asset" />,
to: '/xudts',
},
{
key: 'layer-2-asset',
value: 'Layer 2 Asset',
value: t('layer-2-asset'),
title: <XUDTTag tagName="layer-2-asset" />,
to: '/xudts',
},
{
key: 'supply-limited',
value: 'Supply Limited',
value: t('supply-simited'),
title: <XUDTTag tagName="supply-limited" />,
to: '/xudts',
},
Expand Down Expand Up @@ -135,7 +136,7 @@ export function TokensCard({
<FilterSortContainerOnMobile key="xudts-sort">
<span className={styles.sortOption}>
{t('xudt.title.tags')}
<MultiFilterButton filterName="tags" key="" filterList={filterList} />
<MultiFilterButton filterName="tags" key="" filterList={getfilterList(t)} />
</span>
<span className={styles.sortOption}>
{t('xudt.transactions')}
Expand Down Expand Up @@ -222,7 +223,7 @@ const TokenTable: FC<{
title: (
<>
{t('xudt.title.tags')}
<MultiFilterButton filterName="tags" key="" filterList={filterList} />
<MultiFilterButton filterName="tags" key="" filterList={getfilterList(t)} />
</>
),
className: styles.colTags,
Expand Down

0 comments on commit 7392a0f

Please sign in to comment.