diff options
author | Leon Jiang <35908040+leonyjiang@users.noreply.github.com> | 2020-07-09 10:00:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-09 13:00:11 -0400 |
commit | df4b3f6608423922d0fefd040ab86d49f97bdc9b (patch) | |
tree | c2a9f19b0da21723e93a14c6df41f7f7f5f23084 /src/components/onboarding/Background.tsx | |
parent | e32241734c8cc258812ac12c7727aaa7f947eed5 (diff) |
[TMA-104] Registration wizard & footer positioning fix (#14)
* Remove KeyboardAvoidingView and add centered prop
* Fix layout to match updated Background component
* Add KeyboardAvoidingView to Login screen
* Fix arrows/wizard position & fix keyboard avoidance effect
Diffstat (limited to 'src/components/onboarding/Background.tsx')
-rw-r--r-- | src/components/onboarding/Background.tsx | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/src/components/onboarding/Background.tsx b/src/components/onboarding/Background.tsx index 98082022..85675b0d 100644 --- a/src/components/onboarding/Background.tsx +++ b/src/components/onboarding/Background.tsx @@ -5,12 +5,13 @@ import { TouchableWithoutFeedback, Keyboard, ViewProps, - KeyboardAvoidingView, View, - Platform, } from 'react-native'; +import {CenteredView} from '../common'; -interface BackgroundProps extends ViewProps {} +interface BackgroundProps extends ViewProps { + centered?: boolean; +} const Background: React.FC<BackgroundProps> = (props) => { return ( <LinearGradient @@ -19,15 +20,13 @@ const Background: React.FC<BackgroundProps> = (props) => { angle={154.72} angleCenter={{x: 0.5, y: 0.5}} style={styles.container}> - <KeyboardAvoidingView - behavior={Platform.OS === 'ios' ? 'padding' : 'height'} - style={styles.container}> - <TouchableWithoutFeedback accessible={false} onPress={Keyboard.dismiss}> - <View style={[styles.container, styles.view]} {...props}> - {props.children} - </View> - </TouchableWithoutFeedback> - </KeyboardAvoidingView> + <TouchableWithoutFeedback accessible={false} onPress={Keyboard.dismiss}> + {props.centered ? ( + <CenteredView {...props}>{props.children}</CenteredView> + ) : ( + <View {...props}>{props.children}</View> + )} + </TouchableWithoutFeedback> </LinearGradient> ); }; @@ -36,9 +35,6 @@ const styles = StyleSheet.create({ container: { flex: 1, }, - view: { - alignItems: 'center', - }, }); export default Background; |