-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add memo tag information section in LLD recieve flow (#8055)
- Loading branch information
1 parent
9535221
commit b961229
Showing
8 changed files
with
166 additions
and
3 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": minor | ||
--- | ||
|
||
Add Memo tag info section in LLD |
20 changes: 20 additions & 0 deletions
20
apps/ledger-live-desktop/src/newArch/features/MemoTag/__tests__/MemoTagInfo.test.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,20 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import React from "react"; | ||
import { fireEvent, render, screen } from "tests/testUtils"; | ||
import MemoTagInfo from "../components/MemoTagInfo"; | ||
|
||
describe("MemoTagInfo", () => { | ||
it("should display MemoTagInfo", async () => { | ||
render(<MemoTagInfo />); | ||
const clickabelLabel = screen.getByText(/Need a Tag\/Memo?/); | ||
expect(clickabelLabel).toBeVisible(); | ||
fireEvent.click(clickabelLabel); | ||
const memoTagInfoBody = await screen.findByTestId("memo-tag-info-body"); | ||
// spec: when a user clicks on the label, it should display the memo tag info body | ||
expect(memoTagInfoBody).toBeVisible(); | ||
// spec: when a user clicks on the label, it should disappear | ||
expect(clickabelLabel).not.toBeInTheDocument(); | ||
}); | ||
}); |
30 changes: 30 additions & 0 deletions
30
apps/ledger-live-desktop/src/newArch/features/MemoTag/__tests__/MemoTagInfoBody.test.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,30 @@ | ||
/** | ||
* @jest-environment jsdom | ||
*/ | ||
import React from "react"; | ||
import { fireEvent, render, screen } from "tests/testUtils"; | ||
import MemoTagInfoBody from "../components/MemoTagInfoBody"; | ||
import { MEMO_TAG_LEARN_MORE_LINK } from "../constants"; | ||
import * as LinkingHelpers from "~/renderer/linking"; | ||
|
||
jest.mock("~/renderer/linking", () => ({ | ||
openURL: jest.fn(), | ||
})); | ||
|
||
describe("MemoTagInfoBody", () => { | ||
it("should display MemoTagInfoBody correctly", async () => { | ||
render(<MemoTagInfoBody />); | ||
|
||
const memoTagInfoBody = screen.getByTestId("memo-tag-info-body"); | ||
const learnMoreLink = screen.getByText(/Learn more about Tag\/Memo/); | ||
|
||
expect(memoTagInfoBody).toBeVisible(); | ||
expect(learnMoreLink).toBeVisible(); | ||
|
||
fireEvent.click(learnMoreLink); | ||
|
||
jest.spyOn(LinkingHelpers, "openURL"); | ||
// spec: when a user clicks on the learn more link, it should open the link | ||
expect(LinkingHelpers.openURL).toHaveBeenCalledWith(MEMO_TAG_LEARN_MORE_LINK); | ||
}); | ||
}); |
42 changes: 42 additions & 0 deletions
42
apps/ledger-live-desktop/src/newArch/features/MemoTag/components/MemoTagInfo.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,42 @@ | ||
import React, { useState } from "react"; | ||
import { Trans } from "react-i18next"; | ||
|
||
import { Alert } from "@ledgerhq/react-ui"; | ||
|
||
import { colors } from "~/renderer/styles/theme"; | ||
|
||
import Label from "~/renderer/components/Label"; | ||
|
||
import MemoTagInfoBody from "./MemoTagInfoBody"; | ||
|
||
const MemoTagInfo = () => { | ||
const [isAlertDisplayed, toggleAlertDisplay] = useState(false); | ||
|
||
const handleOnToggleAlertDisplay = () => { | ||
toggleAlertDisplay(!isAlertDisplayed); | ||
}; | ||
|
||
return !isAlertDisplayed ? ( | ||
<Label | ||
color={colors.wallet} | ||
style={{ | ||
fontSize: "13px", | ||
fontWeight: 600, | ||
cursor: "pointer", | ||
}} | ||
onClick={handleOnToggleAlertDisplay} | ||
> | ||
<Trans i18nKey="receive.memoTag.title" /> | ||
</Label> | ||
) : ( | ||
<Alert | ||
containerProps={{ | ||
p: 12, | ||
borderRadius: "4px", | ||
}} | ||
renderContent={() => <MemoTagInfoBody />} | ||
/> | ||
); | ||
}; | ||
|
||
export default MemoTagInfo; |
33 changes: 33 additions & 0 deletions
33
apps/ledger-live-desktop/src/newArch/features/MemoTag/components/MemoTagInfoBody.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,33 @@ | ||
import React from "react"; | ||
import { Link, Text } from "@ledgerhq/react-ui"; | ||
import { Trans } from "react-i18next"; | ||
import { openURL } from "~/renderer/linking"; | ||
import { MEMO_TAG_LEARN_MORE_LINK } from "../constants"; | ||
|
||
const MemoTagInfoBody = () => { | ||
const handleOpenLMLink = () => openURL(MEMO_TAG_LEARN_MORE_LINK); | ||
|
||
return ( | ||
<div data-testid="memo-tag-info-body"> | ||
<Text variant="paragraphLineHeight" color="neutral.c80" fontSize={13}> | ||
<Trans i18nKey="receive.memoTag.description"> | ||
<Text variant="paragraphLineHeight" fontWeight="700" color="neutral.c90"></Text> | ||
</Trans> | ||
</Text> | ||
<br /> | ||
<Link | ||
size="small" | ||
color={"neutral.c80"} | ||
onClick={handleOpenLMLink} | ||
textProps={{ | ||
fontSize: "13px", | ||
}} | ||
style={{ textDecoration: "underline" }} | ||
> | ||
<Trans i18nKey="receive.memoTag.learnMore" /> | ||
</Link> | ||
</div> | ||
); | ||
}; | ||
|
||
export default MemoTagInfoBody; |
14 changes: 14 additions & 0 deletions
14
apps/ledger-live-desktop/src/newArch/features/MemoTag/constants.ts
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,14 @@ | ||
export const MEMO_TAG_LEARN_MORE_LINK = "https://support.ledger.com/article/4409603715217-zd"; | ||
export const MEMO_TAG_COINS: string[] = [ | ||
"ripple", | ||
"stellar", | ||
"cosmos", | ||
"hedera", | ||
"injective", | ||
"crypto_org", | ||
"crypto_org_croeseid", | ||
"stacks", | ||
"ton", | ||
"eos", | ||
"bsc", | ||
]; |
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
b961229
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Bot] Daily non-reg on develop with 'Nitrogen' ✅ 117 txs ❌ 38 txs 💰 14 miss funds ($368.84) ⏲ 39min 24s
12 critical spec errors
Spec Casper failed!
Spec Crypto org failed!
Spec Stacks failed!
Spec VeChain VET failed!
Spec injective failed!
Spec Arbitrum failed!
Spec Moonbeam failed!
Spec Polygon zkEVM Testnet failed!
Spec Klaytn failed!
Spec Linea failed!
Spec Solana failed!
Spec Stellar failed!
❌ 38 mutation errors
Please increase the account target to at least 6 accounts
Please increase the account target to at least 6 accounts
Please increase the account target to at least 6 accounts
Please increase the account target to at least 4 accounts
Please increase the account target to at least 4 accounts
Please increase the account target to at least 4 accounts
Please increase the account target to at least 4 accounts
Please increase the account target to at least 4 accounts
Please increase the account target to at least 4 accounts
Please increase the account target to at least 8 accounts
Portfolio ($368.84) – Details of the 70 currencies
0x246FFDB387F1F8c48072E1C13443540017bC71b7
0.0.3663977
f2ed4c9253d3aca7d679bfa9f528d13e85c7f522b8857e094c850a157b750209
0xc4B17901FECf86932c3bb296BB00E7c6816Fd416
TM4WJOS4MZ2TD775W7GSXZMBUF74YT6SKSBXCZY3N7OUIAPXE54MZ5FCD4
tb1qva8ex44kkad8gz4m7yukmc9hdvhml29ych5esm
qryt752hhuxcuh25fvf3sqeunucmqf58cvrvz52rlw
AGYT7sT98AwDYB3yNcCYiAwiGGPRfrC52o
Xvfcsd7kid8sa59w5LZjwNgAkm73iwZqmm
dgb1qgunkau8y7t7kxmht26ulgezyuwh7k4fl9asjve
DJwaXtGggokQ43YDVS1Rx69272sHpWxQ3B
RUtBojx2obFG19dWXrYjTKNoHQG9qVTbjh
ltc1qxpt400sp3dtdq5gvfx85m2cu282cgplhcs2awv
t1SDpcaNZmbCH5TCCb5vNAh5bXs3isDtA5h
znRYwPxfAEoJFsVqHPAdbHYAXrF8GeN1mWE
osmo1rs97j43nfyvc689y5rjvnnhrq3tes6ghn8m44l
desmos1rs97j43nfyvc689y5rjvnnhrq3tes6gh0y9454
dydx1rs97j43nfyvc689y5rjvnnhrq3tes6ghj9xpr6
umee1rs97j43nfyvc689y5rjvnnhrq3tes6ghf2468l
persistence1rs97j43nfyvc689y5rjvnnhrq3tes6gh4swkdf
quick1rs97j43nfyvc689y5rjvnnhrq3tes6ghscch6l
onomy1rs97j43nfyvc689y5rjvnnhrq3tes6ghpaunjg
sei1rs97j43nfyvc689y5rjvnnhrq3tes6ghksen9v
stars1rs97j43nfyvc689y5rjvnnhrq3tes6gh0qlcgu
core1rs97j43nfyvc689y5rjvnnhrq3tes6ghgjs7yk
erd18n5sk95fq9dtgdsa9m9q5ddp66ch9cq5lpjflwn5j9z8x2e9h0qqrvk5qp
0x7584df0780C5eB83b26aE55abBc265014f8bf897
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0xe404f128644459C5A0F6FAc6824AdA8F94798c8f
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0xe404f128644459C5A0F6FAc6824AdA8F94798c8f
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
0x60A4E7657D8df28594ac4A06CDe01E18E948a892
hxdd614da5f057ce32185619f98edd81445a946ea5
0573d7a9c745fa9fe224b080832aa93d740760b94f192c9c141c709945e9aaaf
tz1aDK1uFAmnUXZ7KJPEmcCEFeYHiVZ56zVF
UQDL7vAIogYGacmfO0xTS1bwPEMJNh1g1Jliwq2p-qWkS1J0
r9etPtq3oboweMPju5gdYufmvwhH2euz8z
Performance ⏲ 39min 24s
Time spent for each spec: (total across mutations)
b961229
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Bot] Weekly non-reg on develop with 'Oxygen' ✅ 26 txs ❌ 11 txs 💰 2 miss funds ($393.46) ⏲ 12min 6s
4 critical spec errors
Spec Filecoin failed!
Spec secret_network failed!
Spec Telos failed!
Spec Polkadot failed!
❌ 11 mutation errors
Please increase the account target to at least 6 accounts
Please increase the account target to at least 4 accounts
Details of the 37 mutations
Spec Filecoin (0)
Spec Qtum (6)
Spec Decred (5)
Spec cardano (7)
Spec axelar (18)
Spec cosmos (16)
Spec secret_network (failed)
Spec Avalanche C-Chain (10)
Spec Binance Smart Chain (10)
Spec Cronos (6)
Spec Fantom (6)
Spec Boba (failed)
Spec Telos (failed)
Spec Polygon zkEVM (5)
Spec Polkadot (failed)
Spec Tron (11)
Details of the 37 uncovered mutations
Spec Filecoin (5)
Spec Qtum (1)
Spec Decred (2)
Spec cardano (2)
Spec axelar (2)
Spec cosmos (2)
Spec secret_network (6)
Spec Binance Smart Chain (1)
Spec Cronos (3)
Spec Fantom (1)
Spec Boba (3)
Spec Telos (2)
Spec Polkadot (7)
Portfolio ($393.46) – Details of the 16 currencies
MRB3qb23Mrm6XmmoQAD1WWEzMr2F56fjz8
DsaRSXkoTShXqwSPQgWmcUeqKzENatCH68k
addr1qx7wsgcsg0t5lac6tty6j6v89can4tfn26nklmkuw5kf6ehgyf2nkgrrlvjz49cn9cqr4el6y74l85d0z3jfj75gmamq2tfxdt
axelar123r3dwfylykx0fugawn6mu2h2smq3047pn5n9g
cosmos123r3dwfylykx0fugawn6mu2h2smq30479azmwf
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
0x731477De13B323A0cA90C1FE194EA5A0412937c2
TT2eHJXo5tRV2wYyZExr9W18mXghe6NFM1
Performance ⏲ 12min 6s
Time spent for each spec: (total across mutations)