Skip to content

Commit dc021a7

Browse files
committed
refactor: move theme determination logic above loading check in AppNavigator
1 parent 6db9d36 commit dc021a7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

frontend/navigation/AppNavigator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import MainNavigator from './MainNavigator';
88

99
const AppNavigator = () => {
1010
const { token, isLoading } = useContext(AuthContext);
11+
const scheme = useColorScheme();
12+
const theme = scheme === 'dark' ? navThemeDark : navTheme;
1113

1214
if (isLoading) {
1315
return (
@@ -17,8 +19,6 @@ const AppNavigator = () => {
1719
);
1820
}
1921

20-
const scheme = useColorScheme();
21-
const theme = scheme === 'dark' ? navThemeDark : navTheme;
2222
return (
2323
<NavigationContainer theme={theme}>
2424
{token ? <MainNavigator /> : <AuthNavigator />}

0 commit comments

Comments
 (0)