Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(extension): update copy of copy/paste tooltip #1119

Merged
merged 3 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/common/src/analytics/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export enum PostHogAction {
OnboardingRestoreClick = 'onboarding | restore wallet revamp | restore | click',
OnboardingRestoreEnterRecoveryPhraseNextClick = 'onboarding | restore wallet revamp | enter your recovery phrase | next | click',
OnboardingRestoreEnterRecoveryPhrasePasteFromClipboardClick = 'onboarding | restore wallet revamp | enter your recovery phrase | paste from clipboard | click',
OnboardingRestoreEnterRecoveryPhrasePasteReadMoreClick = 'onboarding | restore wallet revamp | enter your recovery phrase | read more | click',
OnboardingRestoreEnterRecoveryPhrasePasteReadMoreClick = 'onboarding | restore wallet revamp | enter your recovery phrase | best practices faq | click',
OnboardingRestoreHdWallet = 'onboarding | restore wallet | hd wallet',
OnboardingRestoreEnterWalletClick = "onboarding | restore wallet revamp | let's set up your new wallet | enter wallet | click",
// Create new wallet
Expand All @@ -26,10 +26,10 @@ export enum PostHogAction {
OnboardingCreateEnterRecoveryPhraseNextClick = 'onboarding | new wallet revamp | enter your recovery phrase | next | click',
OnboardingCreateSaveRecoveryPhraseIntroPlayVideoClick = 'onboarding | new wallet revamp | save your recovery phrase | watch video | click',
OnboardingCreateSaveRecoveryPhraseCopyToClipboardClick = 'onboarding | new wallet revamp | save your recovery phrase | copy to clipboard | click',
OnboardingCreateSaveRecoveryPhraseCopyReadMoreClick = 'onboarding | new wallet revamp | save your recovery phrase | read more | click',
OnboardingCreateSaveRecoveryPhraseCopyReadMoreClick = 'onboarding | new wallet revamp | save your recovery phrase | best practices faq | click',
OnboardingCreateKeepWalletSecureGotItClick = 'onboarding | new wallet revamp | keeping your wallet secure | got it | click',
OnboardingCreateEnterRecoveryPhrasePasteFromClipboardClick = 'onboarding | new wallet revamp | enter your recovery phrase | paste from clipboard | click',
OnboardingCreateEnterRecoveryPhrasePasteReadMoreClick = 'onboarding | new wallet revamp | enter your recovery phrase | read more | click',
OnboardingCreateEnterRecoveryPhrasePasteReadMoreClick = 'onboarding | new wallet revamp | enter your recovery phrase | best practices faq | click',
OnboardingCreateEnterWalletClick = "onboarding | new wallet revamp | let's set up your new wallet | enter wallet | click",
// Multi wallet
MultiWalletSwitchWallet = 'multiwallet | switch wallet | click',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@
margin-top: size_unit(2) !important;
color: var(--color-pink, #ff5470);
}

:global(.ant-tooltip).copyPasteTooltip {
max-width: initial;
}
Original file line number Diff line number Diff line change
Expand Up @@ -155,25 +155,29 @@ export const WalletSetupMnemonicStepRevamp = ({
onNext={handleNext}
currentTimelineStep={WalletTimelineSteps.RECOVERY_PHRASE}
customAction={
mnemonicStage === 'writedown' ? (
<Tooltip placement="top" title={translations.copyPasteTooltipText} showArrow={false}>
<Tooltip
placement="top"
title={translations.copyPasteTooltipText}
showArrow={false}
overlayClassName={styles.copyPasteTooltip}
data-testid="mnemonic-copy-paste-tooltip"
>
{mnemonicStage === 'writedown' ? (
<Button type="link" onClick={copyRecoveryPhrase} data-testid="copy-to-clipboard-button">
<span className={styles.btnContentWrapper}>
<CopyIcon />
{translations.copyToClipboard}
</span>
</Button>
</Tooltip>
) : (
<Tooltip placement="top" title={translations.copyPasteTooltipText} showArrow={false}>
) : (
<Button type="link" onClick={() => pasteRecoveryPhrase()} data-testid="paste-from-clipboard-button">
<span className={styles.btnContentWrapper}>
<PasteIcon />
{translations.pasteFromClipboard}
</span>
</Button>
</Tooltip>
)
)}
</Tooltip>
}
isNextEnabled={isSubmitEnabled}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,12 @@ export const WalletSetupMnemonicVerificationStepRevamp = ({
onBack={onCancel}
onNext={onSubmit}
customAction={
<Tooltip placement="top" title={translations.copyPasteTooltipText} showArrow={false}>
<Tooltip
placement="top"
title={translations.copyPasteTooltipText}
showArrow={false}
data-testid="verification-copy-paste-tooltip"
>
<Button type="link" onClick={() => pasteRecoveryPhrase()} data-testid="paste-from-clipboard-button">
<span className={styles.btnContentWrapper}>
<PasteIcon />
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/ui/lib/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@
"core.walletSetupMnemonicStep.passphraseInfo3": "Find out more.",
"core.walletSetupMnemonicStep.writePassphrase": "Write down your secret passphrase",
"core.walletSetupMnemonicStepRevamp.copyToClipboard": "Copy to clipboard",
"core.walletSetupMnemonicStepRevamp.copyPasteTooltipText": "Best practices on copying and pasting. <a>Read more</a>",
"core.walletSetupMnemonicStepRevamp.copyPasteTooltipText": "Before using this feature, please read this <a>best practices FAQ</a>",
"core.walletSetupMnemonicStepRevamp.enterPassphrase": "Enter your recovery passphrase",
"core.walletSetupMnemonicStepRevamp.enterPassphraseDescription": "Let's check you've got the correct recovery phrase. Type each word in the right order or paste from clipboard to verify it.",
"core.walletSetupMnemonicStepRevamp.enterPassphraseLength": "Choose recovery phrase length",
Expand Down