diff options
author | Eric Bailey <git@esb.lol> | 2024-02-20 10:04:07 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-20 08:04:07 -0800 |
commit | 8a169dc6a14d422f65ea4afb5af7fe30efacf2bb (patch) | |
tree | 4ad0bf720d19868da897b85c7f9c04218622172d /src/view/screens/Storybook/Dialogs.tsx | |
parent | b52a742925cff4429885e94815d61f3f7cfb5a66 (diff) | |
download | voidsky-8a169dc6a14d422f65ea4afb5af7fe30efacf2bb.tar.zst |
Improve dialogs issue (#2941)
* Fix collapse, update backdrop color * Remove test prop * Remove debug code
Diffstat (limited to 'src/view/screens/Storybook/Dialogs.tsx')
-rw-r--r-- | src/view/screens/Storybook/Dialogs.tsx | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/src/view/screens/Storybook/Dialogs.tsx b/src/view/screens/Storybook/Dialogs.tsx index a18b3c62f..821ac3c88 100644 --- a/src/view/screens/Storybook/Dialogs.tsx +++ b/src/view/screens/Storybook/Dialogs.tsx @@ -9,7 +9,8 @@ import * as Prompt from '#/components/Prompt' import {useDialogStateControlContext} from '#/state/dialogs' export function Dialogs() { - const control = Dialog.useDialogControl() + const scrollable = Dialog.useDialogControl() + const basic = Dialog.useDialogControl() const prompt = Prompt.usePromptControl() const {closeAllDialogs} = useDialogStateControlContext() @@ -20,8 +21,31 @@ export function Dialogs() { color="secondary" size="small" onPress={() => { - control.open() + scrollable.open() prompt.open() + basic.open() + }} + label="Open basic dialog"> + Open all dialogs + </Button> + + <Button + variant="outline" + color="secondary" + size="small" + onPress={() => { + scrollable.open() + }} + label="Open basic dialog"> + Open scrollable dialog + </Button> + + <Button + variant="outline" + color="secondary" + size="small" + onPress={() => { + basic.open() }} label="Open basic dialog"> Open basic dialog @@ -48,8 +72,17 @@ export function Dialogs() { </Prompt.Actions> </Prompt.Outer> + <Dialog.Outer control={basic}> + <Dialog.Handle /> + + <Dialog.Inner label="test"> + <H3 nativeID="dialog-title">Dialog</H3> + <P nativeID="dialog-description">A basic dialog</P> + </Dialog.Inner> + </Dialog.Outer> + <Dialog.Outer - control={control} + control={scrollable} nativeOptions={{sheet: {snapPoints: ['100%']}}}> <Dialog.Handle /> @@ -77,9 +110,9 @@ export function Dialogs() { variant="outline" color="primary" size="small" - onPress={() => control.close()} + onPress={() => scrollable.close()} label="Open basic dialog"> - Close basic dialog + Close dialog </Button> </View> </View> |