add tester
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import * as PlatformInfo from './src/PlatformInfo'
|
||||
import * as Referrer from './src/Referrer'
|
||||
import * as SharedPrefs from './src/SharedPrefs'
|
||||
|
||||
export {Referrer, SharedPrefs}
|
||||
export {PlatformInfo, Referrer, SharedPrefs}
|
||||
|
||||
@@ -2,6 +2,6 @@ import {requireNativeModule} from 'expo-modules-core'
|
||||
|
||||
const NativeModule = requireNativeModule('ExpoPlatformInfo')
|
||||
|
||||
export function getIsReducedMotionEnabled() {
|
||||
export function getIsReducedMotionEnabled(): boolean {
|
||||
return NativeModule.getIsReducedMotionEnabled()
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {NotImplementedError} from '../NotImplemented'
|
||||
|
||||
export function getIsReducedMotionEnabled() {
|
||||
export function getIsReducedMotionEnabled(): boolean {
|
||||
throw new NotImplementedError()
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export function getIsReducedMotionEnabled() {
|
||||
export function getIsReducedMotionEnabled(): boolean {
|
||||
if (typeof window === 'undefined') {
|
||||
return false
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user