Skip to content

Commit 2709d31

Browse files
Merge pull request #20257 from mozilla/actually-fix-dark-mode-error
fix(settings): ACTUALLY fix the dark mode error
2 parents 3ae21f2 + 8a02105 commit 2709d31

2 files changed

Lines changed: 30 additions & 38 deletions

File tree

packages/fxa-settings/src/components/App/index.tsx

Lines changed: 26 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
useLocalSignedInQueryState,
3232
useSession,
3333
isProbablyFirefox,
34-
ThemeProvider,
3534
} from '../../models';
3635
import {
3736
initializeSettingsContext,
@@ -381,48 +380,38 @@ export const App = ({
381380
isSignedIn === undefined ||
382381
metricsEnabled === undefined
383382
) {
384-
return (
385-
<ThemeProvider enabled={config.darkMode?.enabled}>
386-
{window.location.pathname?.includes('/settings') ? (
387-
<LoadingSpinner fullScreen />
388-
) : (
389-
<AppLayout cmsInfo={integration?.getCmsInfo()} loading />
390-
)}
391-
</ThemeProvider>
383+
return window.location.pathname?.includes('/settings') ? (
384+
<LoadingSpinner fullScreen />
385+
) : (
386+
<AppLayout cmsInfo={integration?.getCmsInfo()} loading />
392387
);
393388
}
394389

395390
const cmsInfo = integration.getCmsInfo();
396391

397392
return (
398-
<ThemeProvider enabled={config.darkMode?.enabled}>
399-
<Suspense
400-
fallback={
401-
<AppLayout
402-
cmsInfo={cmsInfo}
403-
loading
404-
splitLayout={currentSplitLayout}
405-
/>
406-
}
407-
>
408-
<Router basepath="/">
409-
<AuthAndAccountSetupRoutes
410-
{...{
411-
isSignedIn,
412-
integration,
413-
flowQueryParams: updatedFlowQueryParams,
414-
isSignedIntoFirefoxDesktop,
415-
setCurrentSplitLayout,
416-
}}
417-
path="/*"
418-
/>
419-
<SettingsRoutes
420-
{...{ isSignedIn, integration, setCurrentSplitLayout }}
421-
path="/settings/*"
422-
/>
423-
</Router>
424-
</Suspense>
425-
</ThemeProvider>
393+
<Suspense
394+
fallback={
395+
<AppLayout cmsInfo={cmsInfo} loading splitLayout={currentSplitLayout} />
396+
}
397+
>
398+
<Router basepath="/">
399+
<AuthAndAccountSetupRoutes
400+
{...{
401+
isSignedIn,
402+
integration,
403+
flowQueryParams: updatedFlowQueryParams,
404+
isSignedIntoFirefoxDesktop,
405+
setCurrentSplitLayout,
406+
}}
407+
path="/*"
408+
/>
409+
<SettingsRoutes
410+
{...{ isSignedIn, integration, setCurrentSplitLayout }}
411+
path="/settings/*"
412+
/>
413+
</Router>
414+
</Suspense>
426415
);
427416
};
428417

packages/fxa-settings/src/index.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import { NimbusProvider } from './models/contexts/NimbusContext';
1111
import config, { readConfigMeta } from './lib/config';
1212
import { searchParams } from './lib/utilities';
1313
import { AppContext, initializeAppContext } from './models';
14+
import { ThemeProvider } from './models/contexts/ThemeContext';
1415
import Storage from './lib/storage';
1516
import './styles/tailwind.out.css';
1617
import CookiesDisabled from './pages/CookiesDisabled';
@@ -83,7 +84,9 @@ try {
8384
<AppErrorBoundary>
8485
<AppContext.Provider value={appContext}>
8586
<NimbusProvider>
86-
<View />
87+
<ThemeProvider enabled={config.darkMode?.enabled}>
88+
<View />
89+
</ThemeProvider>
8790
</NimbusProvider>
8891
</AppContext.Provider>
8992
</AppErrorBoundary>

0 commit comments

Comments
 (0)