diff options
author | Hailey <153161762+haileyok@users.noreply.github.com> | 2024-01-22 15:17:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-22 15:17:56 -0800 |
commit | 6569f8a870f214646957debb27e0e51ad8cca622 (patch) | |
tree | 7853d4dbd254bde9243a8840d94e0e0e3b0889bc /src/state/preferences | |
parent | 010e94a6a9581cfec7a7a03ceb716149291b4ea0 (diff) | |
download | voidsky-6569f8a870f214646957debb27e0e51ad8cca622.tar.zst |
use color scheme in in-app browser (#2580)
Diffstat (limited to 'src/state/preferences')
-rw-r--r-- | src/state/preferences/in-app-browser.tsx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/state/preferences/in-app-browser.tsx b/src/state/preferences/in-app-browser.tsx index 628663af4..4f033db65 100644 --- a/src/state/preferences/in-app-browser.tsx +++ b/src/state/preferences/in-app-browser.tsx @@ -4,6 +4,7 @@ import {Linking} from 'react-native' import * as WebBrowser from 'expo-web-browser' import {isNative} from '#/platform/detection' import {useModalControls} from '../modals' +import {usePalette} from 'lib/hooks/usePalette' type StateContext = persisted.Schema['useInAppBrowser'] type SetContext = (v: persisted.Schema['useInAppBrowser']) => void @@ -52,6 +53,7 @@ export function useSetInAppBrowser() { export function useOpenLink() { const {openModal} = useModalControls() const enabled = useInAppBrowser() + const pal = usePalette('default') const openLink = React.useCallback( (url: string, override?: boolean) => { @@ -66,13 +68,14 @@ export function useOpenLink() { WebBrowser.openBrowserAsync(url, { presentationStyle: WebBrowser.WebBrowserPresentationStyle.FULL_SCREEN, + toolbarColor: pal.colors.backgroundLight, }) return } } Linking.openURL(url) }, - [enabled, openModal], + [enabled, openModal, pal.colors.backgroundLight], ) return openLink |