import React, { useState } from 'react'; import { View } from 'react-native'; import { MenuContent, LinesBox, Line } from './styles'; import useAnimationHorizontally from './useAnimation'; import { MenuContentProps } from 'src/components/AnimatedMenus/AnimatedMenuVertically'; export function AnimatedMenuHorizontally(menuProps: MenuContentProps) { const [linesBoxWidth, setLinesBoxWidth] = useState(0) const { toogleAnimations, topLineAnimatedStyle, middleLineAnimatedStyle, bottomLineAnimatedStyle, } = useAnimationHorizontally(linesBoxWidth); return ( { toogleAnimations() menuProps.onPress && menuProps.onPress() }} > { const width = event.nativeEvent.layout.width; setLinesBoxWidth(width); }} > ); } export default AnimatedMenuHorizontally;