From 564404af45f7f3a6cbb36f26489eaa214f0625c4 Mon Sep 17 00:00:00 2001 From: Adw8 Date: Wed, 21 Feb 2024 18:18:01 +0530 Subject: [PATCH] Remove number limit --- components/HDPath.tsx | 50 +++++++++++-------------------------------- styles/stylesheet.js | 21 ++++++++++++++++++ 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/components/HDPath.tsx b/components/HDPath.tsx index 244b765..582d890 100644 --- a/components/HDPath.tsx +++ b/components/HDPath.tsx @@ -1,9 +1,10 @@ import React, { useState } from 'react'; -import { ScrollView, View, Text, StyleSheet } from 'react-native'; +import { ScrollView, View, Text } from 'react-native'; import { Button, TextInput } from 'react-native-paper'; import { addAccountFromHDPath } from '../utils/Accounts'; import { Account, PathState } from '../types'; +import styles from '../styles/stylesheet'; const HDPath = ({ pathCode, @@ -26,7 +27,7 @@ const HDPath = ({ const handleChange = (key: keyof PathState, value: string) => { setPath({ ...path, - [key]: value.replace(/[^0-9]/g, ''), // Allow only numeric characters + [key]: value.replace(/[^0-9]/g, ''), }); }; @@ -50,37 +51,34 @@ const HDPath = ({ }; return ( - - - {pathCode} + + + {pathCode} handleChange('firstNumber', text)} value={path.firstNumber} - style={styles.textInput} - maxLength={1} + style={styles.HDtextInput} /> - '/ + '/ handleChange('secondNumber', text)} value={path.secondNumber} - style={styles.textInput} - maxLength={1} + style={styles.HDtextInput} /> - / + / handleChange('thirdNumber', text)} value={path.thirdNumber} - style={styles.textInput} - maxLength={1} + style={styles.HDtextInput} /> - +