Skip to content

Commit

Permalink
fix(ui-ux): filter out burn symbol in DEX table (#1865)
Browse files Browse the repository at this point in the history
* fix(ui-ux): filter out burn symbols

* revert filter for tokens page

* code cleanup

* code cleanup
  • Loading branch information
chloezxyy authored Sep 7, 2023
1 parent 1f0d97a commit 6fcbfdd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/pages/dex/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,16 @@ export default function DexPage({
}

export async function getServerSideProps(
context: GetServerSidePropsContext
context: GetServerSidePropsContext,
): Promise<GetServerSidePropsResult<DexPageProps>> {
const api = getWhaleApiClient(context);

const next = CursorPagination.getNext(context);
const items = await api.poolpairs.list(100, next);
const sorted = items.filter(
(poolpair) => !poolpair.displaySymbol.includes("/")
(poolpair) =>
!poolpair.displaySymbol.includes("/") &&
!poolpair.symbol.includes("BURN"),
);

return {
Expand All @@ -141,7 +143,7 @@ export async function getServerSideProps(
while (poolpairsResponse.hasNext) {
poolpairsResponse = await api.poolpairs.list(
200,
poolpairsResponse.nextToken
poolpairsResponse.nextToken,
);
poolpairs.push(...poolpairsResponse);
}
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tokens/index.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function TokensPage({
}

export async function getServerSideProps(
context: GetServerSidePropsContext
context: GetServerSidePropsContext,
): Promise<GetServerSidePropsResult<TokensPageData>> {
const next = CursorPagination.getNext(context);
const items = await getWhaleApiClient(context).tokens.list(20, next);
Expand Down

0 comments on commit 6fcbfdd

Please sign in to comment.