diff --git a/src/Main.tsx b/src/Main.tsx index df7a27d..1131363 100644 --- a/src/Main.tsx +++ b/src/Main.tsx @@ -301,6 +301,14 @@ const Main = () => { setStep(Step.Home); } + const factoryResetMessage = () => { + if (pinCounter) { + return "This will remove all keys from this card and completely reset it. Do you want to proceed?"; + } else { + return "This card is blocked. You can only continue using it by performing a factory reset. Factory reset will remove all keys and reset the card."; + } + } + return ( {step == Step.Discovery && } @@ -309,9 +317,9 @@ const Main = () => { {step == Step.LoadSuccess && } {step == Step.Authentication && } {step == Step.Home && } - {step == Step.FactoryReset && } + {step == Step.FactoryReset && } {step == Step.LoginSuccess && } - {step == Step.LoginError && } + {step == Step.LoginError && } ); diff --git a/src/components/steps/FactoryResetScreen.tsx b/src/components/steps/FactoryResetScreen.tsx deleted file mode 100644 index 3c37f10..0000000 --- a/src/components/steps/FactoryResetScreen.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import {FC } from "react"; -import { StyleSheet, Text, View } from "react-native"; -import Button from "../Button"; - -type FactoryResetScreenProps = { - pinRetryCounter: number; - onPressFunc: () => void; - onCancelFunc: () => void; -}; - -const FactoryResetScreen: FC = props => { - const {pinRetryCounter, onPressFunc, onCancelFunc} = props; - - return ( - - - Factory reset - This will remove the keys from your card. Are you sure? - - - - - )}; - -const styles = StyleSheet.create({ - heading: { - textAlign: 'center', - fontSize: 30, - fontFamily: 'Inter', - color: '#199515', - marginTop: '50%' - }, - prompt: { - textAlign: 'center', - fontSize: 18, - fontFamily: 'Inter', - color: 'white', - marginTop: '5%' - } -}); - -export default FactoryResetScreen; \ No newline at end of file diff --git a/src/components/steps/InfoScreen.tsx b/src/components/steps/InfoScreen.tsx index 203fe9e..407dbda 100644 --- a/src/components/steps/InfoScreen.tsx +++ b/src/components/steps/InfoScreen.tsx @@ -9,10 +9,11 @@ type InfoScreenProps = { title: string; message: string; onPressFunc: () => void; + onCancelFunc?: () => void; }; const InfoScreen: FC = props => { - const {icon, title, message, onPressFunc} = props; + const {icon, title, message, onPressFunc, onCancelFunc} = props; return ( @@ -27,7 +28,10 @@ const InfoScreen: FC = props => { - + + {onCancelFunc && } + +