diff --git a/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx b/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx index 5177e0c411..bedaeb6572 100644 --- a/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx +++ b/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20ManageToken.tsx @@ -1,5 +1,8 @@ +import { LaunchpadERC20DetailTokenBox } from "../component/LaunchpadERC20DetailTokenBox"; + import { BrandText } from "@/components/BrandText"; import { ScreenContainer } from "@/components/ScreenContainer"; +import { SpacerColumn } from "@/components/spacer"; import { useForceNetworkSelection } from "@/hooks/useForceNetworkSelection"; import { NetworkFeature, NetworkKind } from "@/networks"; import { ScreenFC, useAppNavigation } from "@/utils/navigation"; @@ -8,6 +11,7 @@ export const LaunchpadERC20ManageTokenScreen: ScreenFC< "LaunchpadERC20ManageToken" > = ({ route: { params } }) => { const network = params?.network; + const token = params.token; useForceNetworkSelection(network); const navigation = useAppNavigation(); @@ -19,6 +23,9 @@ export const LaunchpadERC20ManageTokenScreen: ScreenFC< isLarge responsive onBackPress={() => navigation.navigate("LaunchpadERC20Tokens")} - /> + > + + + ); }; diff --git a/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20TokensScreen.tsx b/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20TokensScreen.tsx index bb2a445a49..4d7a77e4f4 100644 --- a/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20TokensScreen.tsx +++ b/packages/screens/LaunchpadERC20/LaunchpadERC20Tokens/LaunchpadERC20TokensScreen.tsx @@ -31,7 +31,6 @@ export const LaunchpadERC20TokensScreen: ScreenFC<"LaunchpadERC20Tokens"> = ({ const selectedWallet = useSelectedWallet(); const caller = selectedWallet?.address; const { data: tokens } = useUserTokens(networkId, caller || ""); - const dropdownItems = tokens?.map((token) => token.name); const toggleModal = () => { setIsModalVisible(!isModalVisible); @@ -82,7 +81,7 @@ export const LaunchpadERC20TokensScreen: ScreenFC<"LaunchpadERC20Tokens"> = ({ diff --git a/packages/screens/LaunchpadERC20/component/LaunchpadERC20DetailTokenBox.tsx b/packages/screens/LaunchpadERC20/component/LaunchpadERC20DetailTokenBox.tsx new file mode 100644 index 0000000000..f6dee4a2a9 --- /dev/null +++ b/packages/screens/LaunchpadERC20/component/LaunchpadERC20DetailTokenBox.tsx @@ -0,0 +1,36 @@ +import { View } from "react-native"; + +import { BrandText } from "@/components/BrandText"; +import { neutralA3 } from "@/utils/style/colors"; +import { layout } from "@/utils/style/layout"; +import { Token } from "@/utils/types/types"; + +interface SelectTokenModalProps { + item: Token; +} + +export const LaunchpadERC20DetailTokenBox: React.FC = ({ + item, +}) => { + return ( + + {"Name: " + item.name} + {"Symbol: " + item.symbol} + {"Decimals: " + item.decimals} + + {"Total Supply : " + item.totalSupply + " " + item.symbol} + + {item.allowMint ? "Allow Mint" : "Not Allow Mint"} + {item.allowBurn ? "Allow Burn" : "Not Allow Burn"} + + ); +}; diff --git a/packages/screens/LaunchpadERC20/component/LaunchpadERC20SelectUserTokenModal.tsx b/packages/screens/LaunchpadERC20/component/LaunchpadERC20SelectUserTokenModal.tsx index fd6bb1f1f4..643c4832df 100644 --- a/packages/screens/LaunchpadERC20/component/LaunchpadERC20SelectUserTokenModal.tsx +++ b/packages/screens/LaunchpadERC20/component/LaunchpadERC20SelectUserTokenModal.tsx @@ -11,11 +11,12 @@ import { SpacerColumn } from "@/components/spacer"; import { useAppNavigation } from "@/utils/navigation"; import { errorColor, neutral77 } from "@/utils/style/colors"; import { fontSemibold14 } from "@/utils/style/fonts"; +import { emptyToken, Token } from "@/utils/types/types"; interface SelectTokenModalProps { isVisible: boolean; onClose: () => void; - items: string[] | undefined; + items: Token[] | undefined | null; } export const SelectUserTokenModal: React.FC = ({ @@ -23,7 +24,7 @@ export const SelectUserTokenModal: React.FC = ({ onClose, items, }) => { - const [selectedItem, setSelectedItem] = useState(null); + const [selectedItem, setSelectedItem] = useState(emptyToken); const props = { isVisible, onClose }; const navigation = useAppNavigation(); @@ -59,7 +60,9 @@ export const SelectUserTokenModal: React.FC = ({ { - navigation.navigate("LaunchpadERC20ManageToken", {}); + navigation.navigate("LaunchpadERC20ManageToken", { + token: selectedItem, + }); onClose(); }} text="Open" diff --git a/packages/screens/LaunchpadERC20/component/LaunchpadERC20TokensDropdown.tsx b/packages/screens/LaunchpadERC20/component/LaunchpadERC20TokensDropdown.tsx index ba7dd5ac5f..8b01720499 100644 --- a/packages/screens/LaunchpadERC20/component/LaunchpadERC20TokensDropdown.tsx +++ b/packages/screens/LaunchpadERC20/component/LaunchpadERC20TokensDropdown.tsx @@ -11,11 +11,12 @@ import { Label } from "@/components/inputs/TextInputCustom"; import { neutral17, neutralFF, secondaryColor } from "@/utils/style/colors"; import { fontSemibold16 } from "@/utils/style/fonts"; import { layout } from "@/utils/style/layout"; +import { Token } from "@/utils/types/types"; interface LaunchpadERC20TokensDropdownProps { - items: string[]; - setSelectedItem: (item: string) => void; - selectedItem?: string | null; + items: Token[]; + setSelectedItem: (token: Token) => void; + selectedItem?: Token | null; placeholder?: string; } @@ -29,7 +30,7 @@ export const LaunchpadERC20TokensDropdown: React.FC< }) => { const [isDropdownOpen, setDropdownState] = useState(false); - const selectItem = (item: string) => { + const selectItem = (item: Token) => { setSelectedItem(item); setDropdownState(false); }; @@ -68,7 +69,7 @@ export const LaunchpadERC20TokensDropdown: React.FC< }, ]} > - {selectedItem || placeholder} + {selectedItem?.name || placeholder} - {item} + {item.name} diff --git a/packages/utils/navigation.ts b/packages/utils/navigation.ts index 70a50c5673..a16b30cef7 100644 --- a/packages/utils/navigation.ts +++ b/packages/utils/navigation.ts @@ -6,6 +6,7 @@ import { feedsTabItems } from "./social-feed"; import { AppMode } from "./types/app-mode"; import { NewPostFormValues } from "./types/feed"; import { MessageFriendsTabItem } from "./types/message"; +import { Token } from "./types/types"; import { uppTabItems } from "./upp"; export type RouteName = keyof RootStackParamList; @@ -43,7 +44,7 @@ export type RootStackParamList = { LaunchpadERC20: undefined; LaunchpadERC20Tokens?: { network?: string }; LaunchpadERC20CreateToken: { step?: number }; - LaunchpadERC20ManageToken: { network?: string }; + LaunchpadERC20ManageToken: { network?: string; token: Token }; LaunchpadERC20Airdrops?: { network?: string }; LaunchpadERC20CreateAirdrop: { step?: number }; LaunchpadERC20Sales?: { network?: string }; diff --git a/packages/utils/types/types.ts b/packages/utils/types/types.ts index 9da691e6bf..fce712b6a8 100644 --- a/packages/utils/types/types.ts +++ b/packages/utils/types/types.ts @@ -14,6 +14,18 @@ export const zodToken = z.object({ export type Token = z.infer; +export const emptyToken = { + symbol: "", + name: "", + decimals: "", + admin: "", + image: "", + totalSupply: "", + totalSupplyCap: "", + allowMint: false, + allowBurn: false, +}; + export const zodAidrop = z.object({ id: z.string(), tokenName: z.string(),