Fix: Define isKeyboardOffset based on Platform

This commit is contained in:
Maria Zadnepryanets
2022-09-19 09:12:31 +00:00
parent dd1c2cd96d
commit 75823ed750
6 changed files with 41 additions and 48 deletions
@@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react'
import PropTypes from 'prop-types'
import { Alert, StyleSheet, View } from 'react-native'
import { Alert, KeyboardAvoidingView, StyleSheet, View } from 'react-native'
import nodejs from 'nodejs-mobile-react-native'
import AppTextInput from '../../common/app-text-input'
@@ -53,7 +53,7 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
const isPassword = password !== null
return (
<>
<KeyboardAvoidingView behavior="padding" keyboardVerticalOffset={150}>
<AppTextInput
onChangeText={setPassword}
placeholder={labels.enterCurrent}
@@ -70,7 +70,7 @@ const ConfirmWithPassword = ({ onSuccess, onCancel }) => {
{shared.confirmToProceed}
</Button>
</View>
</>
</KeyboardAvoidingView>
)
}
@@ -1,5 +1,5 @@
import React, { useState, useEffect } from 'react'
import { StyleSheet } from 'react-native'
import { KeyboardAvoidingView, StyleSheet } from 'react-native'
import nodejs from 'nodejs-mobile-react-native'
import PropTypes from 'prop-types'
@@ -41,9 +41,8 @@ const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
const isButtonActive = password.length > 0 && passwordConfirmation.length > 0
return (
<>
<KeyboardAvoidingView behavior="padding" keyboardVerticalOffset={150}>
<AppTextInput
isKeyboardOffset={false}
onChangeText={setPassword}
placeholder={labels.enterNew}
textContentType="password"
@@ -51,7 +50,6 @@ const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
secureTextEntry={true}
/>
<AppTextInput
isKeyboardOffset={false}
onChangeText={setPasswordConfirmation}
placeholder={labels.confirmPassword}
textContentType="password"
@@ -68,7 +66,7 @@ const EnterNewPassword = ({ changeEncryptionAndRestart }) => {
>
{labels.savePassword}
</Button>
</>
</KeyboardAvoidingView>
)
}