feat: copy recovery phrase functionallity

This commit is contained in:
RadoslavDimchev 2023-10-08 14:20:29 +03:00
parent d715e222b1
commit 49129c6a82
1 changed files with 14 additions and 1 deletions

View File

@ -31,6 +31,15 @@ const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
setIsReveal(state => !state)
}
const copyRecoveryPhraseHandler = () => {
if (isKeystoreFiles) {
return
}
const text = generatedMnemonic.join(' ')
navigator.clipboard.writeText(text)
}
return (
<YStack space={'$4'} style={{ width: '100%', marginTop: isKeystoreFiles ? '20px' : '0px' }}>
<Stack
@ -42,7 +51,11 @@ const RecoveryPhrase = ({ isKeystoreFiles }: RecoveryPhraseProps) => {
width: '100%',
}}
>
<YStack space={'$2'} style={{ filter: `blur(${isReveal ? '0px' : '4px'})` }}>
<YStack
space={'$2'}
style={{ filter: `blur(${isReveal ? '0px' : '4px'})`, cursor: 'pointer' }}
onClick={copyRecoveryPhraseHandler}
>
<XStack
style={{
display: 'grid',