-
Notifications
You must be signed in to change notification settings - Fork 333
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨(lld): add hide inscription feature
- Loading branch information
1 parent
94b2e3d
commit 6632408
Showing
17 changed files
with
355 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"ledger-live-desktop": patch | ||
--- | ||
|
||
Add the hide inscription feature for ordinals |
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
60 changes: 60 additions & 0 deletions
60
...top/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/HideModal/Body.tsx
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,60 @@ | ||
import React from "react"; | ||
import { Text } from "@ledgerhq/react-ui"; | ||
import Box from "~/renderer/components/Box"; | ||
import { Trans, useTranslation } from "react-i18next"; | ||
import ModalBody from "~/renderer/components/Modal/ModalBody"; | ||
import Button from "~/renderer/components/Button"; | ||
import { useDispatch } from "react-redux"; | ||
import { hideOrdinalsAsset } from "~/renderer/actions/settings"; | ||
|
||
const Body = ({ | ||
onClose, | ||
inscriptionName, | ||
inscriptionId, | ||
}: { | ||
onClose: () => void; | ||
inscriptionName: string; | ||
inscriptionId: string; | ||
}) => { | ||
const { t } = useTranslation(); | ||
const dispatch = useDispatch(); | ||
|
||
const confirmHide = () => { | ||
dispatch(hideOrdinalsAsset(inscriptionId)); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<ModalBody | ||
onClose={onClose} | ||
title={t("ordinals.inscriptions.modal.title")} | ||
render={() => ( | ||
<Box> | ||
<Box | ||
color="palette.text.shade60" | ||
mb={2} | ||
mt={3} | ||
alignItems={"center"} | ||
textAlign={"center"} | ||
> | ||
<Trans | ||
i18nKey="ordinals.inscriptions.modal.desc" | ||
t={t} | ||
values={{ inscriptionName }} | ||
components={[<Text key={1} ff="Inter|SemiBold" alignSelf={"center"} />]} | ||
/> | ||
</Box> | ||
</Box> | ||
)} | ||
renderFooter={() => ( | ||
<Box horizontal alignItems="center" justifyContent="flex-end" flow={2}> | ||
<Button onClick={onClose}>{t("common.cancel")}</Button> | ||
<Button data-testid="modal-confirm-button" onClick={confirmHide} primary> | ||
{t("ordinals.inscriptions.hide")} | ||
</Button> | ||
</Box> | ||
)} | ||
/> | ||
); | ||
}; | ||
export default Body; |
21 changes: 21 additions & 0 deletions
21
...op/src/newArch/features/Collectibles/Ordinals/components/Inscriptions/HideModal/index.tsx
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,21 @@ | ||
import React from "react"; | ||
import Modal from "~/renderer/components/Modal"; | ||
import Body from "./Body"; | ||
|
||
const HideNftCollectionModal = () => ( | ||
<Modal | ||
name="MODAL_HIDE_INSCRIPTION" | ||
centered | ||
render={({ data, onClose }) => ( | ||
<Body | ||
inscriptionName={data.inscriptionName} | ||
inscriptionId={data.inscriptionId} | ||
onClose={() => { | ||
onClose?.(); | ||
data?.onClose?.(); | ||
}} | ||
/> | ||
)} | ||
/> | ||
); | ||
export default HideNftCollectionModal; |
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.