about summary refs log tree commit diff
path: root/src/platform
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-05-16 12:01:26 +0100
committerGitHub <noreply@github.com>2024-05-16 12:01:26 +0100
commitaded49f65b09fc06ad07831df527da017e75bcec (patch)
tree4518d41c8b5302023bf9fc1e46883b5c227150e4 /src/platform
parent3674c8abcec927a5293a966027f54fe8a0b7c2fd (diff)
downloadvoidsky-aded49f65b09fc06ad07831df527da017e75bcec.tar.zst
Implement prefersReducedMotion on native (#4039)
* implement prefersReducedMotion on native

* just take the function from the reanimated source

* use patch-package to export internal function
Diffstat (limited to 'src/platform')
-rw-r--r--src/platform/detection.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/platform/detection.ts b/src/platform/detection.ts
index de4dfc07b..fffde1be2 100644
--- a/src/platform/detection.ts
+++ b/src/platform/detection.ts
@@ -1,4 +1,5 @@
 import {Platform} from 'react-native'
+import {isReducedMotion} from 'react-native-reanimated'
 import {getLocales} from 'expo-localization'
 
 import {dedupArray} from 'lib/functions'
@@ -20,7 +21,4 @@ export const deviceLocales = dedupArray(
     .filter(code => typeof code === 'string'),
 ) as string[]
 
-export const prefersReducedMotion =
-  isWeb &&
-  // @ts-ignore we know window exists -prf
-  !global.window.matchMedia('(prefers-reduced-motion: no-preference)')?.matches
+export const prefersReducedMotion = isReducedMotion()