aboutsummaryrefslogtreecommitdiff
path: root/src/components/onboarding/Background.tsx
diff options
context:
space:
mode:
authorAshm Walia <40498934+ashmgarv@users.noreply.github.com>2020-12-22 08:50:27 -0800
committerGitHub <noreply@github.com>2020-12-22 11:50:27 -0500
commita954d6b6b88485dddc0ccfda634ffd102cb34ccd (patch)
tree560f152dd92ccb482a2bbf6b094060525373322c /src/components/onboarding/Background.tsx
parent49ed044f5103cf6288fcf5b3ff6d3d720795860c (diff)
[TMA 446] Create category (#144)
* Added welcome page * Working code * Small fix * Some more cleanup * Fixes * Cleanup * Fix again * Use gradient for white bg as well * Fixed type
Diffstat (limited to 'src/components/onboarding/Background.tsx')
-rw-r--r--src/components/onboarding/Background.tsx12
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>