From 1f0d97a5a16076ffad14f65311305d4460206e73 Mon Sep 17 00:00:00 2001 From: Lyka Labrada Date: Mon, 4 Sep 2023 12:55:25 +0800 Subject: [PATCH 1/3] feat(ui-ux): add svg icon for xchf token (#1863) * feat(ui-ux): add svg icon for xchf token * add dSUI token's proof of backing --- src/components/icons/assets/tokens/XCHF.tsx | 18 ++++++++++++++++++ src/components/icons/assets/tokens/dXCHF.tsx | 18 ++++++++++++++++++ src/components/icons/assets/tokens/index.ts | 4 ++++ src/constants/TokenBackedAddress.ts | 11 +++++++++++ src/pages/tokens/[id].page.tsx | 8 ++++++++ 5 files changed, 59 insertions(+) create mode 100644 src/components/icons/assets/tokens/XCHF.tsx create mode 100644 src/components/icons/assets/tokens/dXCHF.tsx diff --git a/src/components/icons/assets/tokens/XCHF.tsx b/src/components/icons/assets/tokens/XCHF.tsx new file mode 100644 index 000000000..1c3c53a99 --- /dev/null +++ b/src/components/icons/assets/tokens/XCHF.tsx @@ -0,0 +1,18 @@ +import { SVGProps } from "react"; + +export function XCHF(props: SVGProps): JSX.Element { + return ( + + + + + ); +} diff --git a/src/components/icons/assets/tokens/dXCHF.tsx b/src/components/icons/assets/tokens/dXCHF.tsx new file mode 100644 index 000000000..50d4e3ead --- /dev/null +++ b/src/components/icons/assets/tokens/dXCHF.tsx @@ -0,0 +1,18 @@ +import { SVGProps } from "react"; + +export function dXCHF(props: SVGProps): JSX.Element { + return ( + + + + + ); +} diff --git a/src/components/icons/assets/tokens/index.ts b/src/components/icons/assets/tokens/index.ts index 2d2763a02..703db2746 100644 --- a/src/components/icons/assets/tokens/index.ts +++ b/src/components/icons/assets/tokens/index.ts @@ -26,6 +26,8 @@ import { dDOT } from "./dDOT"; import { dSOL } from "./dSOL"; import { dMATIC } from "./dMATIC"; import { dSUI } from "./dSUI"; +import { dXCHF } from "./dXCHF"; +import { XCHF } from "./XCHF"; const mapping: Record) => JSX.Element> = { @@ -59,6 +61,8 @@ const mapping: Record) => JSX.Element> = dDOT: dDOT, dSOL: dSOL, dSUI: dSUI, + dXCHF: dXCHF, + XCHF: XCHF, }; // TODO(@defich): move assets into it's own repo where anyone can create pull request into. diff --git a/src/constants/TokenBackedAddress.ts b/src/constants/TokenBackedAddress.ts index 6a8f2624a..939515d0e 100644 --- a/src/constants/TokenBackedAddress.ts +++ b/src/constants/TokenBackedAddress.ts @@ -98,6 +98,13 @@ export const TOKEN_BACKED_ADDRESS: BackedAddress = { address: "12YfgqECReN4fQppa9BDoyGce43F54ZHYotE77mb5SmCBsUk", }, }, + SUI: { + cake: { + link: "https://suiexplorer.com/address/0x072e6de3fc10b1eacbe130127f6baf3111034fc0204f0edd7a1899d8c40a11a5", + address: + "0x072e6de3fc10b1eacbe130127f6baf3111034fc0204f0edd7a1899d8c40a11a5", + }, + }, }; interface TokenBacked { @@ -150,4 +157,8 @@ export const TOKEN_BACKED: TokenBacked[] = [ name: "dDOT", symbol: "DOT", }, + { + name: "dSUI", + symbol: "SUI", + }, ]; diff --git a/src/pages/tokens/[id].page.tsx b/src/pages/tokens/[id].page.tsx index f13d431c4..d7aba9158 100644 --- a/src/pages/tokens/[id].page.tsx +++ b/src/pages/tokens/[id].page.tsx @@ -336,6 +336,14 @@ function BackingAddress({ tokenSymbol }: { tokenSymbol: string }): JSX.Element { testId="BackingAddress.DOT" /> ); + case "SUI": + return ( + + ); case "ETH": case "USDC": case "USDT": From 6fcbfdd351e4bdb2ccd4b96542c06b553483edd7 Mon Sep 17 00:00:00 2001 From: Chloe <44501120+chloezxyy@users.noreply.github.com> Date: Thu, 7 Sep 2023 09:03:54 +0800 Subject: [PATCH 2/3] fix(ui-ux): filter out burn symbol in DEX table (#1865) * fix(ui-ux): filter out burn symbols * revert filter for tokens page * code cleanup * code cleanup --- src/pages/dex/index.page.tsx | 8 +++++--- src/pages/tokens/index.page.tsx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/dex/index.page.tsx b/src/pages/dex/index.page.tsx index a5c6029cf..98b29c790 100644 --- a/src/pages/dex/index.page.tsx +++ b/src/pages/dex/index.page.tsx @@ -109,14 +109,16 @@ export default function DexPage({ } export async function getServerSideProps( - context: GetServerSidePropsContext + context: GetServerSidePropsContext, ): Promise> { 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 { @@ -141,7 +143,7 @@ export async function getServerSideProps( while (poolpairsResponse.hasNext) { poolpairsResponse = await api.poolpairs.list( 200, - poolpairsResponse.nextToken + poolpairsResponse.nextToken, ); poolpairs.push(...poolpairsResponse); } diff --git a/src/pages/tokens/index.page.tsx b/src/pages/tokens/index.page.tsx index e7c8f575c..82b16e98a 100644 --- a/src/pages/tokens/index.page.tsx +++ b/src/pages/tokens/index.page.tsx @@ -46,7 +46,7 @@ export default function TokensPage({ } export async function getServerSideProps( - context: GetServerSidePropsContext + context: GetServerSidePropsContext, ): Promise> { const next = CursorPagination.getNext(context); const items = await getWhaleApiClient(context).tokens.list(20, next); From 1df73f12b02c8096a90d9547d73e082ed93f1df6 Mon Sep 17 00:00:00 2001 From: Pierre Gee Date: Fri, 8 Sep 2023 09:56:21 +0800 Subject: [PATCH 3/3] fix(ui-ux): redirect of dxchf (#1866) * fix(ui-ux): redirect of dxchf * fix mobile --- src/pages/dex/_components/PoolPairsCards.tsx | 5 +++-- src/pages/dex/_components/PoolPairsTable.tsx | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/dex/_components/PoolPairsCards.tsx b/src/pages/dex/_components/PoolPairsCards.tsx index bd39be8ab..a76b27e48 100644 --- a/src/pages/dex/_components/PoolPairsCards.tsx +++ b/src/pages/dex/_components/PoolPairsCards.tsx @@ -70,7 +70,7 @@ export function PoolPairsCards({ sortKey, reverse: sortOrder === "desc", }), - [poolPairsPrices, sortKey, sortOrder] + [poolPairsPrices, sortKey, sortOrder], ); function changeSort(sortType: { @@ -131,7 +131,8 @@ export function PoolPairsCard({ poolPair.displaySymbol.includes("dUSDC") || poolPair.displaySymbol.includes("dBTC") || poolPair.displaySymbol.includes("dETH") || - poolPair.displaySymbol.includes("dEUROC") + poolPair.displaySymbol.includes("dEUROC") || + poolPair.displaySymbol.includes("dXCHF") ? poolPair.displaySymbol : poolPair.tokenA.displaySymbol }`} diff --git a/src/pages/dex/_components/PoolPairsTable.tsx b/src/pages/dex/_components/PoolPairsTable.tsx index 1fa741b7d..56cb0b5b5 100644 --- a/src/pages/dex/_components/PoolPairsTable.tsx +++ b/src/pages/dex/_components/PoolPairsTable.tsx @@ -36,7 +36,7 @@ export function PoolPairsTable({ sortKey, reverse: sortOrder === "desc", }), - [poolPairsPrices, sortKey, sortOrder] + [poolPairsPrices, sortKey, sortOrder], ); function changeSort(key: SortKeys): void { @@ -94,7 +94,8 @@ export function PoolPairsTable({ data.poolPair.displaySymbol.includes("dUSDC") || data.poolPair.displaySymbol.includes("dBTC") || data.poolPair.displaySymbol.includes("dETH") || - data.poolPair.displaySymbol.includes("dEUROC") + data.poolPair.displaySymbol.includes("dEUROC") || + data.poolPair.displaySymbol.includes("dXCHF") ? data.poolPair.displaySymbol : data.poolPair.tokenA.displaySymbol }`,