Add PlatformInfo
module (#4877)
This commit is contained in:
parent
fb278384c6
commit
18b423396b
13 changed files with 92 additions and 38 deletions
|
@ -1,8 +1,8 @@
|
|||
import React from 'react'
|
||||
import {AccessibilityInfo} from 'react-native'
|
||||
import {isReducedMotion} from 'react-native-reanimated'
|
||||
|
||||
import {isWeb} from '#/platform/detection'
|
||||
import {PlatformInfo} from '../../modules/expo-bluesky-swiss-army'
|
||||
|
||||
const Context = React.createContext({
|
||||
reduceMotionEnabled: false,
|
||||
|
@ -15,7 +15,7 @@ export function useA11y() {
|
|||
|
||||
export function Provider({children}: React.PropsWithChildren<{}>) {
|
||||
const [reduceMotionEnabled, setReduceMotionEnabled] = React.useState(() =>
|
||||
isReducedMotion(),
|
||||
PlatformInfo.getIsReducedMotionEnabled(),
|
||||
)
|
||||
const [screenReaderEnabled, setScreenReaderEnabled] = React.useState(false)
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {z} from 'zod'
|
||||
|
||||
import {deviceLocales, prefersReducedMotion} from '#/platform/detection'
|
||||
import {deviceLocales} from '#/platform/detection'
|
||||
import {PlatformInfo} from '../../../modules/expo-bluesky-swiss-army'
|
||||
|
||||
const externalEmbedOptions = ['show', 'hide'] as const
|
||||
|
||||
|
@ -128,7 +129,7 @@ export const defaults: Schema = {
|
|||
lastSelectedHomeFeed: undefined,
|
||||
pdsAddressHistory: [],
|
||||
disableHaptics: false,
|
||||
disableAutoplay: prefersReducedMotion,
|
||||
disableAutoplay: PlatformInfo.getIsReducedMotionEnabled(),
|
||||
kawaii: false,
|
||||
hasCheckedForStarterPack: false,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue