diff options
Diffstat (limited to 'src/components/onboarding/Background.tsx')
-rw-r--r-- | src/components/onboarding/Background.tsx | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/components/onboarding/Background.tsx b/src/components/onboarding/Background.tsx index 054eeff6..fb08e945 100644 --- a/src/components/onboarding/Background.tsx +++ b/src/components/onboarding/Background.tsx @@ -8,23 +8,27 @@ import { SafeAreaView, } from 'react-native'; import {CenteredView} from '../common'; +import {BackgroundGradientType} from '../../types'; +import {BACKGROUND_GRADIENT_MAP} from '../../constants'; interface BackgroundProps extends ViewProps { centered?: boolean; + gradientType: BackgroundGradientType; } const Background: React.FC<BackgroundProps> = (props) => { + const {centered, gradientType, children} = props; return ( <LinearGradient - colors={['#9F00FF', '#27EAE9']} + colors={BACKGROUND_GRADIENT_MAP[gradientType]} useAngle={true} angle={154.72} angleCenter={{x: 0.5, y: 0.5}} style={styles.container}> <TouchableWithoutFeedback accessible={false} onPress={Keyboard.dismiss}> - {props.centered ? ( - <CenteredView {...props}>{props.children}</CenteredView> + {centered ? ( + <CenteredView {...props}>{children}</CenteredView> ) : ( - <SafeAreaView {...props}>{props.children}</SafeAreaView> + <SafeAreaView {...props}>{children}</SafeAreaView> )} </TouchableWithoutFeedback> </LinearGradient> |