From 2ca94bb182a4a5f4f041608dd19363fe5d405ef7 Mon Sep 17 00:00:00 2001 From: Antonella Sgarlatta Date: Fri, 12 Feb 2021 17:10:19 -0300 Subject: [PATCH] Use keyboard aware scrollview for authenticate screen --- package.json | 1 + src/screens/Authenticate/Authenticate.tsx | 47 ++++++++++++----------- yarn.lock | 13 +++++++ 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index c21eb991..8ef0a99d 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/screens/Authenticate/Authenticate.tsx b/src/screens/Authenticate/Authenticate.tsx index e4abceee..5bf00058 100644 --- a/src/screens/Authenticate/Authenticate.tsx +++ b/src/screens/Authenticate/Authenticate.tsx @@ -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 ( - - {(challenge.heading || challenge.subheading) && ( - - - {challenge.heading && {challenge.heading}} - {challenge.subheading && ( - {challenge.subheading} - )} - - - )} - {Object.values(challengeValues).map((challengeValue, index) => - renderAuthenticationSource(challengeValue, index) - )} - - + + + {(challenge.heading || challenge.subheading) && ( + + + {challenge.heading && {challenge.heading}} + {challenge.subheading && ( + {challenge.subheading} + )} + + + )} + {Object.values(challengeValues).map((challengeValue, index) => + renderAuthenticationSource(challengeValue, index) + )} + + + ); }; diff --git a/yarn.lock b/yarn.lock index 0603bcac..0217c69e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"