import React from "react"; import { Pressable as NativePressable, PressableProps, ViewStyle, StyleProp, } from "react-native"; type Props = { style?: StyleProp; activeOpacity?: number; disabledOpacity?: number; androidRippleColor?: string; androidRippleBorderless?: boolean; androidRippleRadius?: number; androidRippleForeground?: boolean; } & Omit; export default function Pressable({ children, disabled, onPress, activeOpacity = 0.8, disabledOpacity = 0.8, delayLongPress, hitSlop, androidRippleColor, androidRippleBorderless, androidRippleRadius, androidRippleForeground, style, ...props }: Props) { return ( { return [ { opacity: pressed ? activeOpacity : disabled ? disabledOpacity : 1, }, style, ]; }} android_ripple={ androidRippleColor || androidRippleBorderless || androidRippleColor || androidRippleForeground ? { radius: androidRippleRadius, borderless: androidRippleBorderless, color: androidRippleColor, foreground: androidRippleForeground, } : null } {...props} > {children} ); }