diff options
Diffstat (limited to 'src/components/LinearGradientBackground.tsx')
-rw-r--r-- | src/components/LinearGradientBackground.tsx | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/components/LinearGradientBackground.tsx b/src/components/LinearGradientBackground.tsx index 724df43f3..9b28b897c 100644 --- a/src/components/LinearGradientBackground.tsx +++ b/src/components/LinearGradientBackground.tsx @@ -6,12 +6,18 @@ import {gradients} from '#/alf/tokens' export function LinearGradientBackground({ style, + gradient = 'sky', children, + start, + end, }: { - style: StyleProp<ViewStyle> - children: React.ReactNode + style?: StyleProp<ViewStyle> + gradient?: keyof typeof gradients + children?: React.ReactNode + start?: [number, number] + end?: [number, number] }) { - const gradient = gradients.sky.values.map(([_, color]) => { + const colors = gradients[gradient].values.map(([_, color]) => { return color }) as [string, string, ...string[]] @@ -20,7 +26,7 @@ export function LinearGradientBackground({ } return ( - <LinearGradient colors={gradient} style={style}> + <LinearGradient colors={colors} style={style} start={start} end={end}> {children} </LinearGradient> ) |