import React from 'react' import {View} from 'react-native' import {useDialogStateControlContext} from '#/state/dialogs' import {atoms as a} from '#/alf' import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' import * as Menu from '#/components/Menu' import * as Prompt from '#/components/Prompt' import {H3, P, Text} from '#/components/Typography' import {PlatformInfo} from '../../../../modules/expo-bluesky-swiss-army' export function Dialogs() { const scrollable = Dialog.useDialogControl() const basic = Dialog.useDialogControl() const prompt = Prompt.usePromptControl() const withMenu = Dialog.useDialogControl() const testDialog = Dialog.useDialogControl() const {closeAllDialogs} = useDialogStateControlContext() const unmountTestDialog = Dialog.useDialogControl() const [reducedMotionEnabled, setReducedMotionEnabled] = React.useState() const [shouldRenderUnmountTest, setShouldRenderUnmountTest] = React.useState(false) const unmountTestInterval = React.useRef(undefined) const onUnmountTestStartPressWithClose = () => { setShouldRenderUnmountTest(true) setTimeout(() => { unmountTestDialog.open() }, 1000) setTimeout(() => { unmountTestDialog.close() }, 4950) setInterval(() => { setShouldRenderUnmountTest(prev => !prev) }, 5000) } const onUnmountTestStartPressWithoutClose = () => { setShouldRenderUnmountTest(true) setTimeout(() => { unmountTestDialog.open() }, 1000) setInterval(() => { setShouldRenderUnmountTest(prev => !prev) }, 5000) } const onUnmountTestEndPress = () => { setShouldRenderUnmountTest(false) clearInterval(unmountTestInterval.current) } return ( This is a prompt This is a generic prompt component. It accepts a title and a description, as well as two actions. {}} />

Dialog

A basic dialog

Dialog with Menu

{({props}) => ( )} console.log('item 1')}> Item 1 console.log('item 2')}> Item 2

Dialog

A scrollable dialog with an input within it.

{}} label="Type here" />
Watch the console logs to test each of these dialog edge cases. Functionality should be consistent across both native and web. If not then *sad face* something is wrong. {shouldRenderUnmountTest && (

Unmount Test Dialog

Will unmount in about 5 seconds

)}
) }