SEL-483: Implement recovery backup prompts (#710)

* feat: prompt users to back up account

* feat: prompt users to back up account

* format

* Add tests for recovery prompt logic

* more lint updates

* fix imports

* fix unused import

* update cursor suggestions

* implement coderabbit suggestions and fix tests
This commit is contained in:
Justin Hernandez
2025-06-29 21:53:51 -07:00
committed by GitHub
parent a7e8e903d6
commit 180aeeca71
8 changed files with 317 additions and 1 deletions

View File

@@ -4,6 +4,7 @@ import Clipboard from '@react-native-clipboard/clipboard';
import React, { useCallback, useState } from 'react';
import { Button, Text, XStack, YStack } from 'tamagui';
import { useSettingStore } from '../stores/settingStore';
import {
black,
slate50,
@@ -50,11 +51,13 @@ const REDACTED = new Array(24)
const Mnemonic = ({ words = REDACTED, onRevealWords }: MnemonicProps) => {
const [revealWords, setRevealWords] = useState(false);
const [copied, setCopied] = useState(false);
const { setHasViewedRecoveryPhrase } = useSettingStore();
const copyToClipboardOrReveal = useCallback(async () => {
confirmTap();
if (!revealWords) {
// TODO: container jumps when words are revealed on android
await onRevealWords?.();
setHasViewedRecoveryPhrase(true);
return setRevealWords(previous => !previous);
}
Clipboard.setString(words.join(' '));