diff options
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; |