From 4a2760401e83e72e6d82bdcb20b23c7444aa9363 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 18 Dec 2024 11:30:21 -0500 Subject: [PATCH] improved styling and added confirmation for resetting token list --- .../wallet/collectibles/ImportCollectible.tsx | 54 +++++++++++++------ src/components/wallet/tokens/ImportToken.tsx | 48 +++++++++++++---- 2 files changed, 77 insertions(+), 25 deletions(-) diff --git a/src/components/wallet/collectibles/ImportCollectible.tsx b/src/components/wallet/collectibles/ImportCollectible.tsx index 13f4bcb..b6a3817 100644 --- a/src/components/wallet/collectibles/ImportCollectible.tsx +++ b/src/components/wallet/collectibles/ImportCollectible.tsx @@ -5,6 +5,7 @@ import { ChevronLeftIcon, Divider, Image, + Modal, SearchIcon, Select, Spinner, @@ -45,6 +46,7 @@ export default function ImportCollectible({ onClose }: { onClose: () => void }) ) const [isAddingCollection, setIsAddingCollection] = useState(false) + const [confirmRefreshList, setConfirmRefreshList] = useState(false) const [collectionList, setCollectionList] = useState([]) const [collectionListDate, setCollectionListDate] = useState() @@ -334,6 +336,20 @@ export default function ImportCollectible({ onClose }: { onClose: () => void }) ) } + const handleRefreshCollectibleList = async () => { + if (contractType === CollectibleContractTypeValues.ERC721) { + const collectionData = await collectibleStore.resetERC721List(selectedNetwork.chainId) + setCollectionList(collectionData.tokens) + setCollectionListDate(new Date(collectionData.date)) + } else { + const collectionData = await collectibleStore.resetERC1155List(selectedNetwork.chainId) + setCollectionList(collectionData.tokens) + setCollectionListDate(new Date(collectionData.date)) + } + + setConfirmRefreshList(false) + } + return ( {selectedCollection ? ( @@ -445,7 +461,7 @@ export default function ImportCollectible({ onClose }: { onClose: () => void }) - + void }) onChange={handleFileChange} /> - {selectedNetwork && ( + {collectionListDate && (