import {useTheme} from '../../theme/ThemeProvider'; import {Animated, Pressable, Text, View} from 'react-native'; import {renderIcon} from '../../helpers/renderIcon'; import {useLongPressButton} from '../../hooks'; import {longPressButtonStyles} from '../../theme'; import type {LongPressButtonProps} from '../../types'; export const LongPressButton = (props: LongPressButtonProps) => { const {colors} = useTheme(); const { accessibilityHint = 'Press and hold to confirm', accessibilityLabel, backgroundColor = colors.primary, behavior = 'left-to-right', borderRadius = 20, fontSize = 14, fullWidth, height = 40, icon, iconPosition = 'left', longPressTime, onFinish, progressColor = 'rgba(255, 255, 255, 0.3)', style, testID, text = 'Button', textColor = '#FFF', width = '50%', } = props; const {alignSelf, handlePressIn, handlePressOut, progressWidth, scaleValue} = useLongPressButton(longPressTime, onFinish); return ( {renderIcon(icon, {size: fontSize + 2, color: textColor})} {text} ); };