[fix] Fix dark mode (#5008)
## Context Fixing broken dark mode <img width="826" alt="Capture d’écran 2024-04-17 à 15 50 39" src="https://github.com/twentyhq/twenty/assets/51697796/94df50bd-5b43-4def-a39d-268a10ac560a"> ## How was it tested Locally Test of dark mode on storybook is added on another PR
This commit is contained in:
@ -1,7 +1,6 @@
|
|||||||
import { ErrorInfo, ReactNode } from 'react';
|
import { ErrorInfo, ReactNode } from 'react';
|
||||||
import { ErrorBoundary } from 'react-error-boundary';
|
import { ErrorBoundary } from 'react-error-boundary';
|
||||||
import { ThemeProvider } from '@emotion/react';
|
import { ThemeProvider, useTheme } from '@emotion/react';
|
||||||
import { THEME_LIGHT } from 'twenty-ui';
|
|
||||||
|
|
||||||
import { GenericErrorFallback } from '@/error-handler/components/GenericErrorFallback';
|
import { GenericErrorFallback } from '@/error-handler/components/GenericErrorFallback';
|
||||||
|
|
||||||
@ -10,8 +9,10 @@ export const AppErrorBoundary = ({ children }: { children: ReactNode }) => {
|
|||||||
// TODO: log error to Sentry
|
// TODO: log error to Sentry
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const theme = useTheme();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={THEME_LIGHT}>
|
<ThemeProvider theme={theme}>
|
||||||
<ErrorBoundary
|
<ErrorBoundary
|
||||||
FallbackComponent={GenericErrorFallback}
|
FallbackComponent={GenericErrorFallback}
|
||||||
onError={handleError}
|
onError={handleError}
|
||||||
|
|||||||
Reference in New Issue
Block a user