diff --git a/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx b/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx index a80b74da..8fe3a5f3 100644 --- a/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx +++ b/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx @@ -1,10 +1,10 @@ import { Stack, XStack, YStack } from 'tamagui' import { Button, InformationBox, Text } from '@status-im/components' -import { CloseCircleIcon } from '@status-im/icons' +import { CloseCircleIcon, CopyIcon, CheckIcon } from '@status-im/icons' import { useEffect, useState } from 'react' import { generateMnemonic } from 'web-bip39' -import wordlist from 'web-bip39/wordlists/english' import { useDispatch, useSelector } from 'react-redux' +import wordlist from 'web-bip39/wordlists/english' import { RootState } from '../../../redux/store' import { setGeneratedMnemonic } from '../../../redux/ValidatorOnboarding/KeyGeneration/slice' @@ -15,6 +15,7 @@ type RecoveryPhraseProps = { const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => { const [isReveal, setIsReveal] = useState(false) + const [isCopied, setIsCopied] = useState(false) const { generatedMnemonic } = useSelector((state: RootState) => state.keyGeneration) const dispatch = useDispatch() @@ -32,45 +33,52 @@ const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => { } const copyRecoveryPhraseHandler = () => { - if (isKeystoreFiles) { - return - } - const text = generatedMnemonic.join(' ') navigator.clipboard.writeText(text) + + setIsCopied(true) } return ( - - - - {generatedMnemonic.map((word, index) => ( + {generatedMnemonic.map((word, index) => ( + + + + {index + 1}. + + {word} - ))} - - - + + ))} + + {isCopied ? : } +