diff options
Diffstat (limited to 'src/components/LinearGradientBackground.tsx')
-rw-r--r-- | src/components/LinearGradientBackground.tsx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/components/LinearGradientBackground.tsx b/src/components/LinearGradientBackground.tsx new file mode 100644 index 000000000..f516b19f5 --- /dev/null +++ b/src/components/LinearGradientBackground.tsx @@ -0,0 +1,23 @@ +import React from 'react' +import {StyleProp, ViewStyle} from 'react-native' +import {LinearGradient} from 'expo-linear-gradient' + +import {gradients} from '#/alf/tokens' + +export function LinearGradientBackground({ + style, + children, +}: { + style: StyleProp<ViewStyle> + children: React.ReactNode +}) { + const gradient = gradients.sky.values.map(([_, color]) => { + return color + }) + + return ( + <LinearGradient colors={gradient} style={style}> + {children} + </LinearGradient> + ) +} |