mirror of
https://github.com/status-im/nimbus-gui.git
synced 2025-03-03 12:30:34 +00:00
feat: add states and numbers to word inputs
This commit is contained in:
parent
7a7277e789
commit
74c7e221b6
@ -1,15 +1,33 @@
|
|||||||
import { Stack, YStack } from 'tamagui'
|
import { Stack, YStack } from 'tamagui'
|
||||||
import KeyGenerationTitle from './KeyGenerationTitle'
|
import KeyGenerationTitle from './KeyGenerationTitle'
|
||||||
import { Input, Text } from '@status-im/components'
|
import { Input, Text } from '@status-im/components'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
const ConfirmRecoveryPhrase = () => {
|
const ConfirmRecoveryPhrase = () => {
|
||||||
|
const [words, setWords] = useState<string[]>(Array.from({ length: 24 }, () => ''))
|
||||||
|
|
||||||
|
const changeWordHandler = (e: any, index: number) => {
|
||||||
|
const newWords = [...words]
|
||||||
|
newWords[index] = e.target.value
|
||||||
|
setWords(newWords)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<YStack space={'$4'} style={{ width: '100%', marginTop: '20px' }}>
|
<YStack space={'$4'} style={{ width: '100%', marginTop: '20px' }}>
|
||||||
<KeyGenerationTitle />
|
<KeyGenerationTitle />
|
||||||
<Text size={27}>Confirm Recovery Phrase</Text>
|
<Text size={27}>Confirm Recovery Phrase</Text>
|
||||||
<Stack style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: '16px 16px' }}>
|
<Stack style={{ display: 'grid', gridTemplateColumns: 'repeat(4, 1fr)', gap: '16px 16px' }}>
|
||||||
{Array.from({ length: 24 }, (_, index) => (
|
{words.map((word, index) => (
|
||||||
<Input key={`input-${index}`} />
|
<Input
|
||||||
|
key={index}
|
||||||
|
icon={
|
||||||
|
<Text size={15} color="#0D162566">
|
||||||
|
{index + 1}.{' '}
|
||||||
|
</Text>
|
||||||
|
}
|
||||||
|
value={word}
|
||||||
|
onChange={e => changeWordHandler(e, index)}
|
||||||
|
/>
|
||||||
))}
|
))}
|
||||||
</Stack>
|
</Stack>
|
||||||
</YStack>
|
</YStack>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user