diff --git a/src/components/Dialpad.tsx b/src/components/Dialpad.tsx index 30200a6..1a482fc 100644 --- a/src/components/Dialpad.tsx +++ b/src/components/Dialpad.tsx @@ -1,8 +1,9 @@ -import { SafeAreaView, StyleSheet, Text, View, Dimensions } from "react-native"; +import { SafeAreaView, StyleSheet, Text, View, Dimensions, useColorScheme } from "react-native"; import React, {FC, useState } from "react"; import DialpadKeypad from "./DialpadKeypad"; import Button from "./Button"; import DialpadPin from "./DialpadPin"; +import { Colors } from "react-native/Libraries/NewAppScreen"; const { width, height } = Dimensions.get("window"); @@ -13,6 +14,7 @@ import DialpadPin from "./DialpadPin"; }; const Dialpad: FC = props => { + const isDarkMode = useColorScheme() === 'dark'; const {prompt, onNextFunc, onCancelFunc} = props; const dialPadContent = [1, 2, 3, 4, 5, 6, 7, 8, 9, "", 0, "X"]; const dialPadSize = width * 0.2; @@ -20,7 +22,7 @@ const Dialpad: FC = props => { const [code, setCode] = useState([]); const pinLength = 6; const pinContainerSize = width / 2; - const pinSize = pinContainerSize / pinLength; + const pinSize = (pinContainerSize / pinLength) + 8; const updateCode = (item: never) => { if (item === "X") { @@ -40,7 +42,7 @@ const Dialpad: FC = props => { } return ( - + {prompt} Enter your secure six-digit code @@ -48,8 +50,8 @@ const Dialpad: FC = props => { - - + + )}; @@ -62,23 +64,25 @@ const styles = StyleSheet.create({ textContainer: { justifyContent: "center", alignItems: "center", - marginTop: 40, + marginTop: 30, position: "relative", }, pinText: { - fontSize: 30, - fontWeight: "medium", + fontSize: 28, + fontFamily: 'Inconsolata Medium', color: "white", }, pinSubText: { fontSize: 18, - fontWeight: "medium", + fontFamily: 'Inconsolata Regular', color: "white", marginVertical: 30, }, btnContainer: { flexDirection: 'row', - width: '100%', + width: '74%', + marginLeft: '13%', + marginRight: '13%', alignItems: 'center' } }); diff --git a/src/components/DialpadKeypad.tsx b/src/components/DialpadKeypad.tsx index ec37ccd..824553e 100644 --- a/src/components/DialpadKeypad.tsx +++ b/src/components/DialpadKeypad.tsx @@ -19,7 +19,7 @@ const DialpadKeypad: FC = props => { updateCodeFunc(item as never)}> = props => { ]} > {item === "X" ? ( - + ) : ( = props => { useEffect(() => { Animated.timing(animatedValue, { toValue: code.length, - duration: 300, + duration: 400, useNativeDriver: true, }).start(); }, [code]); @@ -53,16 +53,16 @@ const DialpadPin: FC = props => { {isSelected && ( = props => { const styles = StyleSheet.create({ dialPadPinContainer: { flexDirection: "row", - marginBottom: 30, + marginBottom: 25, alignItems: "flex-end", }, pinContentContainer: { flex: 1, - backgroundColor: "#fff", + backgroundColor: "#ffffff11", borderWidth: 1, justifyContent: "center", alignItems: "center", }, pinContent: { - backgroundColor: "#5E454B", + backgroundColor: "#199515", } }); diff --git a/src/components/steps/InitializationScreen.tsx b/src/components/steps/InitializationScreen.tsx index 38fbd40..45ccaf6 100644 --- a/src/components/steps/InitializationScreen.tsx +++ b/src/components/steps/InitializationScreen.tsx @@ -39,16 +39,12 @@ const InitializationScreen: FC = props => { return ( - { step == PinSteps.InsertPin && } - { step == PinSteps.RepeatPin && setStep(PinSteps.InsertPin)} onNextFunc={submitPin}> } + { step == PinSteps.InsertPin && } + { step == PinSteps.RepeatPin && setStep(PinSteps.InsertPin)} onNextFunc={submitPin}> } )}; const styles = StyleSheet.create({ - heading: { - textAlign: 'center', - fontSize: 16 - } }); export default InitializationScreen; \ No newline at end of file diff --git a/src/components/steps/MnemonicScreen.tsx b/src/components/steps/MnemonicScreen.tsx index ced0d25..7fff1df 100644 --- a/src/components/steps/MnemonicScreen.tsx +++ b/src/components/steps/MnemonicScreen.tsx @@ -2,6 +2,7 @@ import {FC, useState } from "react"; import { StyleSheet, Text, TextInput, View } from "react-native"; import Button from "../Button"; import { MNEMONIC } from "../../MnemonicList"; +import Dialpad from "../Dialpad"; enum LoadMnemonicSteps { InsertMnemonic, @@ -43,6 +44,11 @@ const MnemonicScreen: FC = props => { } } + const submitPin = (p: string) => { + onPressFunc(mnemonic, p); + return true; + } + return ( { step == LoadMnemonicSteps.InsertMnemonic && @@ -54,14 +60,7 @@ const MnemonicScreen: FC = props => { {errMessage} } - { step == LoadMnemonicSteps.InsertPin && - - Insert pin - - - - - } + { step == LoadMnemonicSteps.InsertPin && setStep(LoadMnemonicSteps.InsertMnemonic)} onNextFunc={submitPin}>} )};