react-native-ios-context-menu/example/src/examples/ContextMenuViewExample04.tsx
2021-11-25 14:47:02 +08:00

61 lines
1.8 KiB
TypeScript

import * as React from 'react';
import { ContextMenuView } from 'react-native-ios-context-menu';
import type { ContextMenuExampleProps } from './SharedExampleTypes';
import { ContextMenuCard } from '../components/ContextMenuCard';
export function ContextMenuViewExample04(props: ContextMenuExampleProps) {
return (
<ContextMenuView
style={props.style}
menuConfig={{
menuTitle: 'ContextMenuViewSimpleExample04',
menuItems: [{
actionKey : 'key-01',
actionTitle : 'Disabled Action',
menuAttributes: ['disabled'],
icon: {
iconType : 'SYSTEM',
iconValue: 'folder',
}
}, {
actionKey : 'key-02' ,
actionTitle : 'Destructive Action',
menuAttributes: ['destructive'],
icon: {
iconType : 'SYSTEM',
iconValue: 'trash',
}
}, {
actionKey : 'key-03' ,
actionTitle : 'Hidden Action',
menuAttributes: ['hidden'],
icon: {
iconType : 'SYSTEM',
iconValue: 'trash',
}
}, {
actionKey : 'key-04' ,
actionTitle : 'Disabled/Destructive',
menuAttributes: ['disabled', 'destructive'],
icon: {
iconType : 'SYSTEM',
iconValue: 'trash.fill',
}
}],
}}
>
<ContextMenuCard
index={props.index}
title={'ContextMenuViewExample04'}
subtitle={'menuAttributes'}
description={[
`Context menu with a "disabled" action, a "destructive" action, a "hidden" action, and a disabled + destructive action.`,
`The "hidden action" is not visibile.`
]}
/>
</ContextMenuView>
);
};