Skip to content

Commit

Permalink
added to TokenSelectionScreen.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
nattadex committed Jul 18, 2024
1 parent 0fa94c1 commit e9273bc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mobile-app/app/api/token/dusdt_converter.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WalletToken } from "@waveshq/walletkit-ui/dist/store";

export function dusdt_converter(token: WalletToken): WalletToken {
export function dusdt_converter(token: any): WalletToken {
return { ...token, displaySymbol: "csUSDT" };
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import { ListRenderItemInfo } from "@shopify/flash-list";
import { DomainType, useDomainContext } from "@contexts/DomainContext";
import { ConvertDirection } from "@screens/enum";
import { dusdt_converter } from "@api/token/dusdt_converter";
import { PortfolioParamList } from "../PortfolioNavigator";
import { ActiveUSDValueV2 } from "../../Loans/VaultDetail/components/ActiveUSDValueV2";
import { TokenIcon } from "../components/TokenIcon";
Expand Down Expand Up @@ -106,12 +107,17 @@ export function TokenSelectionScreen(): JSX.Element {
item={item}
isEvmDomain={isEvmDomain}
onPress={() => {
let token = filteredTokensByDomain.find(
(t) => t.id === item.tokenId,
);

if (token && token.id === "3") {
token = dusdt_converter(token);
}
navigation.navigate({
name: "SendScreen",
params: {
token: filteredTokensByDomain.find(
(t) => t.id === item.tokenId,
),
token,
},
merge: true,
});
Expand Down Expand Up @@ -210,6 +216,9 @@ function TokenSelectionRow({
onPress,
isEvmDomain,
}: TokenSelectionRowProps): JSX.Element {
if (item.tokenId === "3") {
item.token = dusdt_converter(item.token);
}
return (
<ThemedTouchableOpacityV2
disabled={new BigNumber(item.available).lte(0)}
Expand Down

0 comments on commit e9273bc

Please sign in to comment.