import React from 'react';
import { Button, View } from '@ray-js/ray';
import ActionSheet from '@tuya-miniapp/miniapp-components-plus/actionSheet';
export default function Demo() {
const [isShowAtionSheet, setIsShowAtionSheet] = React.useState(false);
const groups = [
{ text: 'Sample menu', value: 1 },
{ text: 'Sample menu', value: 2 },
{ text: 'Sample menu', type: 'warn', value: 3 },
];
return (
<View>
<Button
onClick={() => {
setIsShowAtionSheet(true);
}}
>
Tap to bring up ActionSheet
</Button>
<ActionSheet
bindactiontap={(e) => {
console.log('Tap the button of ActionSheet', e);
}}
bindclose={(e) => {
console.log('Tap to close');
setIsShowAtionSheet(false);
}}
show={isShowAtionSheet}
actions={groups}
title="This is a title to be displayed in one or two lines."
></ActionSheet>
</View>
);
}