From 89f51c72fcf7d16d5ad4fc54331894d5efa999a8 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Wed, 17 Apr 2024 01:08:40 +0100 Subject: [PATCH] don't change bg color on ios --- src/alf/util/useColorModeTheme.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/alf/util/useColorModeTheme.ts b/src/alf/util/useColorModeTheme.ts index 4f8921bf9b..9728bb77eb 100644 --- a/src/alf/util/useColorModeTheme.ts +++ b/src/alf/util/useColorModeTheme.ts @@ -1,11 +1,11 @@ import React from 'react' import {ColorSchemeName, useColorScheme} from 'react-native' - -import {useThemePrefs} from 'state/shell' -import {isWeb} from 'platform/detection' -import {ThemeName, light, dark, dim} from '#/alf/themes' import * as SystemUI from 'expo-system-ui' +import {isIOS, isWeb} from 'platform/detection' +import {useThemePrefs} from 'state/shell' +import {dark, dim, light, ThemeName} from '#/alf/themes' + export function useColorModeTheme(): ThemeName { const colorScheme = useColorScheme() const {colorMode, darkTheme} = useThemePrefs() @@ -13,7 +13,11 @@ export function useColorModeTheme(): ThemeName { React.useLayoutEffect(() => { const theme = getThemeName(colorScheme, colorMode, darkTheme) updateDocument(theme) - SystemUI.setBackgroundColorAsync(getBackgroundColor(theme)) + + // must be default on iOS due to the formSheet modal presentation style + if (!isIOS) { + SystemUI.setBackgroundColorAsync(getBackgroundColor(theme)) + } }, [colorMode, colorScheme, darkTheme]) return React.useMemo(