import * as React from 'react'; import { ContextMenuView, OnPressMenuItemEvent } from 'react-native-ios-context-menu'; import type { ContextMenuExampleProps } from './SharedExampleTypes'; import { ContextMenuCard } from '../components/ContextMenuCard'; export function ContextMenuViewTest03(props: ContextMenuExampleProps) { const [actionState1, setActionState1] = React.useState(false); const [actionState2, setActionState2] = React.useState(false); const [actionState3, setActionState3] = React.useState(false); const isResetEnabled = ( actionState1 || actionState2 || actionState3 ); const handleOnPressMenuItem: OnPressMenuItemEvent = ({nativeEvent}) => { switch (nativeEvent.actionKey) { case 'key-01': setActionState1((prevValue) => (!prevValue)); break; case 'key-02': setActionState2((prevValue) => (!prevValue)); break; case 'key-03': setActionState3((prevValue) => (!prevValue)); break; case 'key-04': setActionState1((prevValue) => (!prevValue)); setActionState2((prevValue) => (!prevValue)); setActionState3((prevValue) => (!prevValue)); break; }; }; return ( ); };