Skip to content

Commit

Permalink
update view pool info
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadex committed Jul 22, 2024
1 parent 5deed89 commit 96695c8
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
31 changes: 31 additions & 0 deletions mobile-app/app/api/token/dusdt_converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,34 @@ export function dusdt_converter_pool_pair(availablePairs: any) {
};
}
}

export function dusdt_converter_pair_data(pairData: any) {
return {
...pairData,
symbol: pairData.symbol.replace(/USDT/g, updated_dusdt_name),
displaySymbol: pairData.displaySymbol.replace(/dUSDT/g, updated_dusdt_name),
name: pairData.name.replace(/USDT/g, updated_dusdt_name),
tokenA: {
...pairData.tokenA,
symbol:
pairData.tokenA.symbol === "dUSDT"
? updated_dusdt_name
: pairData.tokenA.symbol,
displaySymbol:
pairData.tokenA.displaySymbol === "dUSDT"
? updated_dusdt_name
: pairData.tokenA.displaySymbol,
},
tokenB: {
...pairData.tokenB,
symbol:
pairData.tokenB.symbol === "dUSDT"
? updated_dusdt_name
: pairData.tokenB.symbol,
displaySymbol:
pairData.tokenB.displaySymbol === "dUSDT"
? updated_dusdt_name
: pairData.tokenB.displaySymbol,
},
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import { useToast } from "react-native-toast-notifications";
import { useBottomSheet } from "@hooks/useBottomSheet";
import { useDisplayUtxoWarning } from "@hooks/wallet/DisplayUtxoWarning";
import { ConvertDirection } from "@screens/enum";
import { dusdt_converter_pair_data } from "@api/token/dusdt_converter";
import { ViewPoolHeader } from "./components/ViewPoolHeader";
import { ViewPoolDetails, DataRoutes } from "./components/ViewPoolDetails";
import { LiquidityCalculationSummary } from "./components/LiquidityCalculationSummary";
Expand Down Expand Up @@ -196,7 +197,7 @@ export function AddLiquidityScreen(props: Props): JSX.Element {
stackScreenName: "ViewPoolShare",
component: ViewPoolDetails({
dataRoutes: DataRoutes.AddLiquidity,
pairData: pairData,
pairData: dusdt_converter_pair_data(pairData),
pairInfo: pairInfo,
}),
option: BottomSheetHeader,
Expand Down

0 comments on commit 96695c8

Please sign in to comment.