Use keyboard aware scrollview for authenticate screen

This commit is contained in:
Antonella Sgarlatta
2021-02-12 17:10:19 -03:00
parent f83130aefa
commit 2ca94bb182
3 changed files with 39 additions and 22 deletions

View File

@@ -40,6 +40,7 @@
"react-native-flag-secure-android": "standardnotes/react-native-flag-secure-android#cb08e74",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.9.0",
"react-native-keyboard-aware-scroll-view": "^0.9.3",
"react-native-keychain": "^4.0.5",
"react-native-mail": "standardnotes/react-native-mail#f7f74be",
"react-native-privacy-snapshot": "standardnotes/react-native-privacy-snapshot#653e904",

View File

@@ -29,6 +29,7 @@ import React, {
import { Alert, BackHandler, Platform, TextInput } from 'react-native';
import FingerprintScanner from 'react-native-fingerprint-scanner';
import { HeaderButtons, Item } from 'react-navigation-header-buttons';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'
import { ThemeContext } from 'styled-components/native';
import {
BaseView,
@@ -737,27 +738,29 @@ export const Authenticate = ({
}
return (
<Container>
{(challenge.heading || challenge.subheading) && (
<StyledSectionedTableCell first>
<BaseView>
{challenge.heading && <Title>{challenge.heading}</Title>}
{challenge.subheading && (
<Subtitle>{challenge.subheading}</Subtitle>
)}
</BaseView>
</StyledSectionedTableCell>
)}
{Object.values(challengeValues).map((challengeValue, index) =>
renderAuthenticationSource(challengeValue, index)
)}
<ButtonCell
maxHeight={45}
disabled={singleValidation ? !readyToSubmit || pending : isPending}
title={submitButtonTitle}
bold={true}
onPress={onSubmitPress}
/>
</Container>
<KeyboardAwareScrollView>
<Container>
{(challenge.heading || challenge.subheading) && (
<StyledSectionedTableCell first>
<BaseView>
{challenge.heading && <Title>{challenge.heading}</Title>}
{challenge.subheading && (
<Subtitle>{challenge.subheading}</Subtitle>
)}
</BaseView>
</StyledSectionedTableCell>
)}
{Object.values(challengeValues).map((challengeValue, index) =>
renderAuthenticationSource(challengeValue, index)
)}
<ButtonCell
maxHeight={45}
disabled={singleValidation ? !readyToSubmit || pending : isPending}
title={submitButtonTitle}
bold={true}
onPress={onSubmitPress}
/>
</Container>
</KeyboardAwareScrollView>
);
};

View File

@@ -6850,11 +6850,24 @@ react-native-gesture-handler@^1.9.0:
invariant "^2.2.4"
prop-types "^15.7.2"
react-native-iphone-x-helper@^1.0.3:
version "1.3.1"
resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz#20c603e9a0e765fd6f97396638bdeb0e5a60b010"
integrity sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg==
react-native-iphone-x-helper@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.0.tgz#84fd13e6b89cc3aa4daa80ec514bf15cb724d86d"
integrity sha512-+/bcZWFeZt0xSS/+3CHM5K7qPL4vDO/3ARLIowzFpUPGZiPsv9+NET+XNqqseRYwFJwYMmtX+Q4TZKxAVy09ew==
react-native-keyboard-aware-scroll-view@^0.9.3:
version "0.9.3"
resolved "https://registry.yarnpkg.com/react-native-keyboard-aware-scroll-view/-/react-native-keyboard-aware-scroll-view-0.9.3.tgz#65ab4cab1a987b486d97924602756fa88b7fbfcc"
integrity sha512-EDyFp8wAJoKvi1T2pzoPRn8R0Inp3G+575jPAWEFTlXq26URMmk8760rzde2XLW+v/1+QwDyBg6d/5mz63/ZRA==
dependencies:
prop-types "^15.6.2"
react-native-iphone-x-helper "^1.0.3"
react-native-keychain@^4.0.5:
version "4.0.5"
resolved "https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-4.0.5.tgz#6d3aef8f2789fc0dfa8149b8400d82ff77be361a"