Skip to content

Commit

Permalink
Handle new tokens param
Browse files Browse the repository at this point in the history
  • Loading branch information
buberdds committed Feb 27, 2025
1 parent c2f94dd commit 1c6b6a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .changelog/1772.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Filter tokens list by a type
7 changes: 6 additions & 1 deletion src/app/pages/TokensOverviewPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ import { TokenList } from '../../components/Tokens/TokenList'
import { TokenDetails } from '../../components/Tokens/TokenDetails'
import { VerticalList } from '../../components/VerticalList'
import { TokenTypeFilter } from '../../components/Tokens/TokenTypeFilter'
import { useTypedSearchParam } from 'app/hooks/useTypedSearchParam'

const PAGE_SIZE = NUMBER_OF_ITEMS_ON_SEPARATE_PAGE

export const TokensPage: FC = () => {
const [tableView, setTableView] = useState<TableLayout>(TableLayout.Horizontal)
const [type, setType] = useState(EvmTokenType.ERC20)
const [type, setType] = useTypedSearchParam<EvmTokenType>('type', EvmTokenType.ERC20, {
deleteParams: ['page'],
})
const { isMobile } = useScreenSize()
const { t } = useTranslation()
const pagination = useSearchParamsPagination('page')
Expand All @@ -46,6 +49,8 @@ export const TokensPage: FC = () => {
{
limit: tableView === TableLayout.Vertical ? offset + PAGE_SIZE : PAGE_SIZE,
offset: tableView === TableLayout.Vertical ? 0 : offset,
// @ts-expect-error Object literal may only specify known properties
type,
},
{
query: {
Expand Down

0 comments on commit 1c6b6a0

Please sign in to comment.