diff options
author | Hailey <153161762+haileyok@users.noreply.github.com> | 2024-01-19 16:13:29 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-19 16:13:29 -0800 |
commit | 89607d90aa3a9e29d50fde8c132187fc3be12e07 (patch) | |
tree | fe0090374d5f49d5dcbd90926a6a2f8c6ea70305 /src/Navigation.tsx | |
parent | 5522b581ece2fb9d1de7859d7038e7ee0cea68f6 (diff) | |
download | voidsky-89607d90aa3a9e29d50fde8c132187fc3be12e07.tar.zst |
set proper content style to fix background color (#2575)
* set the proper content style * lint
Diffstat (limited to 'src/Navigation.tsx')
-rw-r--r-- | src/Navigation.tsx | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/src/Navigation.tsx b/src/Navigation.tsx index 08cdd1d89..3689cfc90 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -1,5 +1,4 @@ import * as React from 'react' -import {StyleSheet} from 'react-native' import { NavigationContainer, createNavigationContainerRef, @@ -25,7 +24,6 @@ import { import {BottomBar} from './view/shell/bottom-bar/BottomBar' import {buildStateObject} from 'lib/routes/helpers' import {State, RouteParams} from 'lib/routes/types' -import {colors} from 'lib/styles' import {isAndroid, isNative} from 'platform/detection' import {useColorSchemeStyle} from 'lib/hooks/useColorSchemeStyle' import {router} from './routes' @@ -299,7 +297,7 @@ function TabsNavigator() { } function HomeTabNavigator() { - const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark) + const pal = usePalette('default') return ( <HomeTab.Navigator @@ -309,7 +307,7 @@ function HomeTabNavigator() { fullScreenGestureEnabled: true, headerShown: false, animationDuration: 250, - contentStyle, + contentStyle: pal.view, }}> <HomeTab.Screen name="Home" @@ -322,7 +320,7 @@ function HomeTabNavigator() { } function SearchTabNavigator() { - const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark) + const pal = usePalette('default') return ( <SearchTab.Navigator screenOptions={{ @@ -331,7 +329,7 @@ function SearchTabNavigator() { fullScreenGestureEnabled: true, headerShown: false, animationDuration: 250, - contentStyle, + contentStyle: pal.view, }}> <SearchTab.Screen name="Search" getComponent={() => SearchScreen} /> {commonScreens(SearchTab as typeof HomeTab)} @@ -340,7 +338,7 @@ function SearchTabNavigator() { } function FeedsTabNavigator() { - const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark) + const pal = usePalette('default') return ( <FeedsTab.Navigator screenOptions={{ @@ -349,7 +347,7 @@ function FeedsTabNavigator() { fullScreenGestureEnabled: true, headerShown: false, animationDuration: 250, - contentStyle, + contentStyle: pal.view, }}> <FeedsTab.Screen name="Feeds" @@ -362,7 +360,7 @@ function FeedsTabNavigator() { } function NotificationsTabNavigator() { - const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark) + const pal = usePalette('default') return ( <NotificationsTab.Navigator screenOptions={{ @@ -371,7 +369,7 @@ function NotificationsTabNavigator() { fullScreenGestureEnabled: true, headerShown: false, animationDuration: 250, - contentStyle, + contentStyle: pal.view, }}> <NotificationsTab.Screen name="Notifications" @@ -384,7 +382,7 @@ function NotificationsTabNavigator() { } function MyProfileTabNavigator() { - const contentStyle = useColorSchemeStyle(styles.bgLight, styles.bgDark) + const pal = usePalette('default') return ( <MyProfileTab.Navigator screenOptions={{ @@ -393,7 +391,7 @@ function MyProfileTabNavigator() { fullScreenGestureEnabled: true, headerShown: false, animationDuration: 250, - contentStyle, + contentStyle: pal.view, }}> <MyProfileTab.Screen // @ts-ignore // TODO: fix this broken type in ProfileScreen @@ -424,7 +422,7 @@ const FlatNavigator = () => { fullScreenGestureEnabled: true, headerShown: false, animationDuration: 250, - contentStyle: [pal.view], + contentStyle: pal.view, }}> <Flat.Screen name="Home" @@ -620,15 +618,6 @@ function handleLink(url: string) { } } -const styles = StyleSheet.create({ - bgDark: { - backgroundColor: colors.black, - }, - bgLight: { - backgroundColor: colors.white, - }, -}) - let didInit = false function logModuleInitTime() { if (didInit) { |