File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 11import { Gap12 } from '@components/Gap'
2- import { SettText , SettWrapper } from '@components/Settings'
2+ import Range from '@components/Range'
3+ import { SettGroup , SettText , SettWrapper } from '@components/Settings'
4+ import { Txt } from '@components/Text'
35import type { NavProp } from '@utils/types'
4- import React from 'react'
6+ import React , { useState } from 'react'
7+ import { View } from 'react-native'
8+
9+ const MIN = 1
10+ const MAX = 49
11+ function getCurrVal ( len : number ) {
12+ return Math . floor ( len * MAX + MIN )
13+ }
514
615export default function RandomPassword ( { navigation } : NavProp ) {
16+ const [ len , setLen ] = useState < number > ( 10 / 50 )
17+
718 return (
819 < SettWrapper navigation = { navigation } title = 'Random Password' >
920 < Gap12 >
1021 < SettText className = 'mt-3' > Here you will set some options to generate a random password</ SettText >
22+ < SettGroup title = 'Password Length' >
23+ < View >
24+ < Range value = { len } setValue = { setLen } Left = { < Txt > 1</ Txt > } Right = { < Txt > 50</ Txt > } />
25+ < Txt className = 'pb-2 text-center' > Length { getCurrVal ( len ) } </ Txt >
26+ </ View >
27+ </ SettGroup >
1128 </ Gap12 >
1229 </ SettWrapper >
1330 )
You can’t perform that action at this time.
0 commit comments