1- import { NavigationContainer } from '@react-navigation/native' ;
2- import moment from 'moment' ;
3- import { PersistGate as ReduxPersistGate } from 'redux-persist/integration/react' ;
4-
51import type { FC } from 'react' ;
62import { StrictMode , useEffect , useMemo , useState } from 'react' ;
73import { useTranslation } from 'react-i18next' ;
8- import { StatusBar , useColorScheme } from 'react-native' ;
94import type { MD3Theme } from 'react-native-paper' ;
105import {
116 adaptNavigationTheme ,
127 MD3DarkTheme ,
138 MD3LightTheme ,
149 PaperProvider ,
1510} from 'react-native-paper' ;
11+ import type { TranslationsType } from 'react-native-paper-dates' ;
1612import { registerTranslation } from 'react-native-paper-dates' ;
1713import { SafeAreaProvider } from 'react-native-safe-area-context' ;
1814import SplashScreen from 'react-native-splash-screen' ;
1915import { Provider as ReduxProvider } from 'react-redux' ;
2016
17+ import { StatusBar , useColorScheme } from 'react-native' ;
18+
19+ import moment from 'moment' ;
20+ import { PersistGate as ReduxPersistGate } from 'redux-persist/integration/react' ;
21+
22+ import { setLanguage } from '@/slices/settings' ;
23+
2124import AppOfflineModal from '@/components/modals/AppOfflineModal' ;
2225import EnableAppUpdatesModal from '@/components/modals/EnableAppUpdatesModal' ;
2326import EnableFetchOpenDtuUpdatesModal from '@/components/modals/EnableFetchOpenDtuUpdatesModal' ;
2427
25- import { rootLogger } from '@/utils/log' ;
28+ import { rootLogging } from '@/utils/log' ;
2629
2730import ApiProvider from '@/api/ApiHandler' ;
2831import DatabaseProvider from '@/database' ;
2932import GithubProvider from '@/github' ;
3033import FetchHandler from '@/github/FetchHandler' ;
31- import { store , persistor , useAppSelector , useAppDispatch } from '@/store' ;
34+ import { persistor , store , useAppDispatch , useAppSelector } from '@/store' ;
3235import { ReactNavigationDarkTheme , ReactNavigationLightTheme } from '@/style' ;
36+ import type { SupportedLanguage } from '@/translations' ;
3337import NavigationStack from '@/views/navigation/NavigationStack' ;
34- import type { TranslationsType } from 'react-native-paper-dates' ;
38+
3539import RNLanguageDetector from '@os-team/i18next-react-native-language-detector' ;
36- import { setLanguage } from '@/slices/settings' ;
37- import type { SupportedLanguage } from '@/translations' ;
3840import { useMaterial3Theme } from '@pchmn/expo-material3-theme' ;
41+ import { NavigationContainer } from '@react-navigation/native' ;
3942
40- const log = rootLogger . extend ( 'App' ) ;
43+ const log = rootLogging . extend ( 'App' ) ;
4144
4245const App = ( ) => {
4346 /*const onBeforeLift = useCallback(() => {
@@ -178,6 +181,9 @@ const _App: FC = () => {
178181 const { theme : m3theme } = useMaterial3Theme ( ) ;
179182
180183 const appTheme = useAppSelector ( state => state . settings . appTheme ) ;
184+ const allowMaterialYou = useAppSelector (
185+ state => state . settings . allowMaterialYou ,
186+ ) ;
181187
182188 const systemModeWantsDark = colorScheme === 'dark' ;
183189
@@ -194,12 +200,22 @@ const _App: FC = () => {
194200 const theme = useMemo ( ( ) => {
195201 if ( darkMode ) {
196202 log . debug ( 'darkMode' ) ;
197- return { ...DarkTheme , colors : m3theme . dark } ;
203+
204+ if ( allowMaterialYou ) {
205+ return { ...DarkTheme , colors : m3theme . dark } ;
206+ } else {
207+ return DarkTheme ;
208+ }
198209 }
199210
200211 log . debug ( 'lightMode' ) ;
201- return { ...LightTheme , colors : m3theme . light } ;
202- } , [ darkMode , m3theme . dark , m3theme . light ] ) ;
212+
213+ if ( allowMaterialYou ) {
214+ return { ...LightTheme , colors : m3theme . light } ;
215+ } else {
216+ return LightTheme ;
217+ }
218+ } , [ allowMaterialYou , darkMode , m3theme . dark , m3theme . light ] ) ;
203219
204220 const navigationTheme = useMemo ( ( ) => {
205221 if ( darkMode ) return AdaptedNavigationDarkTheme ;
0 commit comments