mirror of
https://github.com/selfxyz/self.git
synced 2026-04-05 03:00:53 -04:00
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:
@@ -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(' '));
|
||||
|
||||
Reference in New Issue
Block a user