diff options
author | Jaz Volpert <ericvolp12@gmail.com> | 2024-10-04 14:28:52 -0700 |
---|---|---|
committer | Jaz Volpert <ericvolp12@gmail.com> | 2024-10-04 14:28:52 -0700 |
commit | 5f3c4c60dbf2232a76ddb591f0eb51359443113a (patch) | |
tree | e9308f1e3d3cc75d9ed3abd15d5e5183a5b62ef7 /src/components/Button.tsx | |
parent | 0d99b8b0550084ef55f294b33ef5e12608fd5035 (diff) | |
parent | 3fb14d184a84cb892c751338c9aea625f5767a47 (diff) | |
download | voidsky-5f3c4c60dbf2232a76ddb591f0eb51359443113a.tar.zst |
Merge branch 'main' into static_asset_cdn
Diffstat (limited to 'src/components/Button.tsx')
-rw-r--r-- | src/components/Button.tsx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/Button.tsx b/src/components/Button.tsx index 1c14b48c7..4acb4f1dc 100644 --- a/src/components/Button.tsx +++ b/src/components/Button.tsx @@ -87,6 +87,7 @@ export type ButtonProps = Pick< style?: StyleProp<ViewStyle> hoverStyle?: StyleProp<ViewStyle> children: NonTextElements | ((context: ButtonContext) => NonTextElements) + PressableComponent?: React.ComponentType<PressableProps> } export type ButtonTextProps = TextProps & VariantProps & {disabled?: boolean} @@ -114,6 +115,7 @@ export const Button = React.forwardRef<View, ButtonProps>( disabled = false, style, hoverStyle: hoverStyleProp, + PressableComponent = Pressable, ...rest }, ref, @@ -449,10 +451,11 @@ export const Button = React.forwardRef<View, ButtonProps>( const flattenedBaseStyles = flatten([baseStyles, style]) return ( - <Pressable + <PressableComponent role="button" accessibilityHint={undefined} // optional {...rest} + // @ts-ignore - this will always be a pressable ref={ref} aria-label={label} aria-pressed={state.pressed} @@ -500,7 +503,7 @@ export const Button = React.forwardRef<View, ButtonProps>( <Context.Provider value={context}> {typeof children === 'function' ? children(context) : children} </Context.Provider> - </Pressable> + </PressableComponent> ) }, ) |