diff options
author | Hailey <me@haileyok.com> | 2024-08-05 12:21:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-08-05 12:21:34 -0700 |
commit | 18b423396b75d8b4348a434412d0da1f38230717 (patch) | |
tree | 3a3032668f498bb2d17fbee7514493d4f82cc6b3 /src/view/screens/Storybook/Dialogs.tsx | |
parent | fb278384c64f55e5037275a23f4bd7af91dc7274 (diff) | |
download | voidsky-18b423396b75d8b4348a434412d0da1f38230717.tar.zst |
Add `PlatformInfo` module (#4877)
Diffstat (limited to 'src/view/screens/Storybook/Dialogs.tsx')
-rw-r--r-- | src/view/screens/Storybook/Dialogs.tsx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/view/screens/Storybook/Dialogs.tsx b/src/view/screens/Storybook/Dialogs.tsx index ca2420fed..3a9f67de8 100644 --- a/src/view/screens/Storybook/Dialogs.tsx +++ b/src/view/screens/Storybook/Dialogs.tsx @@ -9,6 +9,7 @@ import {Button, ButtonText} from '#/components/Button' import * as Dialog from '#/components/Dialog' 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() @@ -17,6 +18,8 @@ export function Dialogs() { const testDialog = Dialog.useDialogControl() const {closeAllDialogs} = useDialogStateControlContext() const unmountTestDialog = Dialog.useDialogControl() + const [reducedMotionEnabled, setReducedMotionEnabled] = + React.useState<boolean>() const [shouldRenderUnmountTest, setShouldRenderUnmountTest] = React.useState(false) const unmountTestInterval = React.useRef<number>() @@ -147,6 +150,22 @@ export function Dialogs() { <ButtonText>Open Shared Prefs Tester</ButtonText> </Button> + <Button + variant="solid" + color="primary" + size="small" + onPress={() => { + const isReducedMotionEnabled = + PlatformInfo.getIsReducedMotionEnabled() + setReducedMotionEnabled(isReducedMotionEnabled) + }} + label="two"> + <ButtonText> + Is reduced motion enabled?: ( + {reducedMotionEnabled?.toString() || 'undefined'}) + </ButtonText> + </Button> + <Prompt.Outer control={prompt}> <Prompt.TitleText>This is a prompt</Prompt.TitleText> <Prompt.DescriptionText> |