react-native-ios-context-menu/example/src/examples/ContextMenuViewExample14.tsx
2021-11-25 18:00:52 +08:00

44 lines
1.3 KiB
TypeScript

/* eslint-disable react-native/no-inline-styles */
import * as React from 'react';
import { Text, View } from 'react-native';
import { ContextMenuView } from 'react-native-ios-context-menu';
import type { ContextMenuExampleProps } from './SharedExampleTypes';
import { ContextMenuCard } from '../components/ContextMenuCard';
export function ContextMenuViewExample14(props: ContextMenuExampleProps) {
return (
<ContextMenuView
style={props.style}
previewConfig={{
previewType: 'CUSTOM',
previewSize: 'STRETCH',
backgroundColor: 'rgba(255,255,255,0.75)',
preferredCommitStyle: 'pop',
}}
renderPreview={() => (
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
<Text style={{fontSize: 32}}>
Hello World
</Text>
<Text style={{fontSize: 32}}>
Hello World
</Text>
<Text style={{fontSize: 32}}>
Hello World
</Text>
</View>
)}
>
<ContextMenuCard
index={props.index}
title={'ContextMenuViewExample14'}
description={[
`Show a custom preview for the context menu with the "preferredCommitStyle" property in the "PreviewConfig" prop set to "pop"`
]}
/>
</ContextMenuView>
);
};