diff --git a/src/alf/atoms.ts b/src/alf/atoms.ts index c0d20e9c77..203c2f282a 100644 --- a/src/alf/atoms.ts +++ b/src/alf/atoms.ts @@ -35,6 +35,10 @@ export const atoms = { zIndex: 50, }, + overflow_hidden: { + overflow: 'hidden', + }, + /* * Width */ diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 7896fdc878..b44fb05cac 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -7,10 +7,11 @@ import { ViewStyle, AccessibilityProps, } from 'react-native' +import LinearGradient from 'react-native-linear-gradient' import {useTheme, atoms, tokens, web, native} from '#/alf' -export type ButtonVariant = 'solid' | 'outline' | 'ghost' +export type ButtonVariant = 'solid' | 'outline' | 'ghost' | 'gradient' export type ButtonColor = 'primary' | 'secondary' | 'negative' export type ButtonSize = 'small' | 'large' export type VariantProps = { @@ -296,6 +297,7 @@ export function Button({ style={[ atoms.flex_row, atoms.align_center, + atoms.overflow_hidden, ...baseStyles, ...(state.hovered || state.pressed ? hoverStyles : []), ...(state.focused ? focusStyles : []), @@ -306,6 +308,18 @@ export function Button({ onHoverOut={onHoverOut} onFocus={onFocus} onBlur={onBlur}> + {variant === 'gradient' && ( + + )} {typeof children === 'string' ? ( ))} + + )