From d97ccc8c9ec2b0633f24d6ce94be89c7a4b92f30 Mon Sep 17 00:00:00 2001 From: RadoslavDimchev Date: Fri, 13 Oct 2023 16:27:28 +0300 Subject: [PATCH] feat: add state for is copied phrase --- .../ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx b/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx index d9ac21d5..71cc09b3 100644 --- a/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx +++ b/src/pages/ValidatorOnboarding/KeyGeneration/RecoveryPhrase.tsx @@ -1,6 +1,6 @@ import { Stack, YStack } from 'tamagui' import { Button, InformationBox, Text } from '@status-im/components' -import { CloseCircleIcon, CopyIcon } 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' @@ -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,12 +33,10 @@ const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => { } const copyRecoveryPhraseHandler = () => { - if (isKeystoreFiles) { - return - } - const text = generatedMnemonic.join(' ') navigator.clipboard.writeText(text) + + setIsCopied(true) } return (