diff --git a/app/stacks/InsideStack.tsx b/app/stacks/InsideStack.tsx index 5c077081c..21b2004d8 100644 --- a/app/stacks/InsideStack.tsx +++ b/app/stacks/InsideStack.tsx @@ -296,11 +296,7 @@ const E2EEnterYourPasswordStackNavigator = () => { - + ); }; diff --git a/app/stacks/MasterDetailStack/index.tsx b/app/stacks/MasterDetailStack/index.tsx index c740c781f..bba752d80 100644 --- a/app/stacks/MasterDetailStack/index.tsx +++ b/app/stacks/MasterDetailStack/index.tsx @@ -201,11 +201,7 @@ const ModalStackNavigator = React.memo(({ navigation }: INavigation) => { options={E2ESaveYourPasswordView.navigationOptions} /> - + { + const [password, setPassword] = useState(''); + const { colors } = useTheme(); + const navigation = useNavigation(); + const dispatch = useDispatch(); -type TE2EEnterYourPasswordViewProps = IBaseScreen; + useLayoutEffect(() => { + navigation.setOptions({ + headerLeft: () => , + title: I18n.t('Enter_Your_E2E_Password') + }); + }, [navigation]); -class E2EEnterYourPasswordView extends React.Component { - private passwordInput?: RNTextInput; - - static navigationOptions = ({ navigation }: Pick): StackNavigationOptions => ({ - headerLeft: () => , - title: I18n.t('Enter_Your_E2E_Password') - }); - - constructor(props: TE2EEnterYourPasswordViewProps) { - super(props); - this.state = { - password: '' - }; - } - - submit = () => { + const submit = () => { logEvent(events.E2E_ENTER_PW_SUBMIT); - const { password } = this.state; - const { dispatch } = this.props; dispatch(encryptionDecodeKey(password)); }; - render() { - const { password } = this.state; - const { theme } = this.props; - - return ( - - - + + + - - { - this.passwordInput = e; - }} - placeholder={I18n.t('Password')} - returnKeyType='send' - secureTextEntry - onSubmitEditing={this.submit} - onChangeText={value => this.setState({ password: value })} - testID='e2e-enter-your-password-view-password' - textContentType='password' - /> -