Skip to content

Commit

Permalink
Merge pull request #2282 from gluestack/fix/actionsheet
Browse files Browse the repository at this point in the history
Fix/actionsheet
  • Loading branch information
Viraj-10 authored Jul 10, 2024
2 parents bc4be15 + 98f37eb commit 442a398
Show file tree
Hide file tree
Showing 6 changed files with 416 additions and 3,781 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import { Button, ButtonText } from '@/components/ui/button';
import { Center } from '@/components/ui/center';
import {
Actionsheet,
ActionsheetIcon,
Expand All @@ -17,44 +16,40 @@ import {
ActionsheetVirtualizedList,
} from '@/components/ui/actionsheet';

const ActionsheetBasic = ({ showActionsheetProp, ...props }: any) => {
const ActionsheetBasic = ({ ...props }: any) => {
const [showActionsheet, setShowActionsheet] = React.useState(false);

const handleClose = () => setShowActionsheet(false);

return (
<Center>
<>
<Button onPress={() => setShowActionsheet(true)}>
<ButtonText>Open</ButtonText>
<ButtonText>Open Actionsheet</ButtonText>
</Button>
<Actionsheet
isOpen={showActionsheet || showActionsheetProp}
onClose={handleClose}
{...props}
>
<Actionsheet isOpen={showActionsheet} onClose={handleClose} {...props}>
<ActionsheetBackdrop />
<ActionsheetContent>
<ActionsheetDragIndicatorWrapper>
<ActionsheetDragIndicator />
</ActionsheetDragIndicatorWrapper>
<ActionsheetItem onPress={handleClose}>
<ActionsheetItemText>Delete</ActionsheetItemText>
</ActionsheetItem>
<ActionsheetItem isDisabled onPress={handleClose}>
<ActionsheetItemText>Share</ActionsheetItemText>
<ActionsheetItemText>Edit Message</ActionsheetItemText>
</ActionsheetItem>
<ActionsheetItem onPress={handleClose}>
<ActionsheetItemText>Play</ActionsheetItemText>
<ActionsheetItemText>Mark Unread</ActionsheetItemText>
</ActionsheetItem>
<ActionsheetItem onPress={handleClose}>
<ActionsheetItemText>Favourite</ActionsheetItemText>
<ActionsheetItemText>Remind Me</ActionsheetItemText>
</ActionsheetItem>
<ActionsheetItem onPress={handleClose}>
<ActionsheetItemText>Cancel</ActionsheetItemText>
<ActionsheetItemText>Add to Saved Items</ActionsheetItemText>
</ActionsheetItem>
<ActionsheetItem isDisabled onPress={handleClose}>
<ActionsheetItemText>Delete</ActionsheetItemText>
</ActionsheetItem>
</ActionsheetContent>
</Actionsheet>
</Center>
</>
);
};

Expand Down
Loading

0 comments on commit 442a398

Please sign in to comment.