This repository has been archived by the owner on Jun 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat/live 1625 hide nft collection v3 rebased (#2452)
* Update NFT send flow for new NFT model * Fix all linting issues * Add temp LLC dependency * LIVE-1625 Implement hide NFT collection feature * LIVE-1625 Implement unhide functionality on the settings screen * LIVE-1625 Polishing + add hide menu to gallery * LIVE-1625 Update hide menu wording * Add placeholder for NFTs in Account page * run ci * Update onLongPress Touchable method Co-authored-by: Juan Cortés Ross <juan@bohem.io> * Remove useless comparison Co-authored-by: Juan Cortés Ross <juan@bohem.io> * run ci * Remove hidden collections from Send flow Co-authored-by: Gabriel R. Soares <gabriel.soares@ledger.fr> Co-authored-by: Juan Cortés Ross <juan@bohem.io>
- Loading branch information
1 parent
e2f5571
commit 6538f69
Showing
18 changed files
with
507 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import React, { useCallback } from "react"; | ||
|
||
import { useDispatch } from "react-redux"; | ||
import { | ||
BottomDrawer, | ||
Text, | ||
Icons, | ||
BoxedIcon, | ||
Button, | ||
Flex, | ||
} from "@ledgerhq/native-ui"; | ||
import { Account, ProtoNFT } from "@ledgerhq/live-common/lib/types"; | ||
import { useTranslation } from "react-i18next"; | ||
import { hideNftCollection } from "../../actions/settings"; | ||
|
||
type Props = { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
collection: ProtoNFT[]; | ||
account: Account; | ||
}; | ||
|
||
const NftCollectionOptionsMenu = ({ | ||
isOpen, | ||
onClose, | ||
collection, | ||
account, | ||
}: Props) => { | ||
const { t } = useTranslation(); | ||
const dispatch = useDispatch(); | ||
|
||
const onConfirm = useCallback(() => { | ||
dispatch(hideNftCollection(`${account.id}|${collection?.[0]?.contract}`)); | ||
onClose(); | ||
}, [dispatch, account.id, collection, onClose]); | ||
|
||
return ( | ||
<BottomDrawer isOpen={isOpen} onClose={onClose}> | ||
<Flex alignItems="center"> | ||
<BoxedIcon Icon={Icons.EyeNoneMedium} size={48} /> | ||
<Text variant="h1" mt={20}> | ||
{t("settings.accounts.hideNFTCollectionModal.title")} | ||
</Text> | ||
<Text variant="body" textAlign="center" mt={20}> | ||
{t("settings.accounts.hideNFTCollectionModal.desc")} | ||
</Text> | ||
<Button type="main" alignSelf="stretch" mt={20} onPress={onConfirm}> | ||
{t("common.confirm")} | ||
</Button> | ||
<Button type="default" alignSelf="stretch" mt={20} onPress={onClose}> | ||
{t("common.cancel")} | ||
</Button> | ||
</Flex> | ||
</BottomDrawer> | ||
); | ||
}; | ||
|
||
export default React.memo(NftCollectionOptionsMenu); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.