From 2de4a39516947fef92ad3e4ac580a5774bb241cb Mon Sep 17 00:00:00 2001 From: hiteshchoudhary Date: Mon, 6 Mar 2023 00:45:55 +0530 Subject: [PATCH] Take 2 updates --- passwordGenerator03/App.tsx | 64 ++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/passwordGenerator03/App.tsx b/passwordGenerator03/App.tsx index 6a29190..8de065a 100644 --- a/passwordGenerator03/App.tsx +++ b/passwordGenerator03/App.tsx @@ -1,7 +1,7 @@ import { SafeAreaView, ScrollView, StyleSheet, Text, TextInput, TouchableOpacity, View } from 'react-native' import React, { useState } from 'react' -import BouncyCheckbox from "react-native-bouncy-checkbox"; +import BouncyCheckbox from "react-native-bouncy-checkbox"; // Form validation import * as Yup from 'yup' @@ -75,17 +75,16 @@ export default function App() { } return ( - + - - Password Generator - + Password Generator + { - //console.log(values); - - generatePasswordString(+values.passwordLength) + onSubmit={ values => { + console.log(values); + generatePasswordString(+values.passwordLength) }} > {({ @@ -107,21 +106,22 @@ export default function App() { {errors.passwordLength} )} + + style={styles.inputStyle} + value={values.passwordLength} + onChangeText={handleChange('passwordLength')} + placeholder="Ex. 8" + keyboardType='numeric' + /> - Include lowerCase + Include lowercase setLowerCase(!lowerCase) } + onPress={() => setLowerCase(!lowerCase)} fillColor="#29AB87" /> @@ -152,37 +152,35 @@ export default function App() { fillColor="#FC80A5" /> - - Generate + Generate Password { - handleReset() + onPress={ () => { + handleReset(); resetPasswordState() - }}> - Reset - + }} + > + Reset )} - - - - {isPassGenerated ? ( - - Result - {password} + - ): null} + {isPassGenerated ? ( + + Result: + Long Press to copy + {password} + + ) : null} )