import React, { useState } from 'react'; import { View } from 'react-native'; import { ContainerPressable, LinesBox, Line } from './styles'; import useSubtractAddButtonAnimation from './useAnimation'; export interface SubtractAddButtonProps { width?: number; height?: number; borderRadius?: number; backgroundColor?: string; activeOpacity?: number; lineColor?: string; disableBoxShadow?: boolean; onPress?: () => void; } export function SubtractAddButton(buttonProps: SubtractAddButtonProps) { const [linesBoxWidth, setLinesBoxWidth] = useState(0) const { toogleAnimations, verticalLineAnimatedStyle, horizontalLineAnimatedStyle, } = useSubtractAddButtonAnimation(linesBoxWidth); return ( { toogleAnimations() buttonProps.onPress && buttonProps.onPress() }} > { const width = event.nativeEvent.layout.width; setLinesBoxWidth(width); }} > ); } export default SubtractAddButton;