about summary refs log tree commit diff
path: root/src/components/LinearGradientBackground.tsx
blob: f516b19f5f1d4ab26ec7731e6ced2db6565fbf4a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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>
  )
}