Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed Oct 21, 2024
1 parent c36b2a1 commit 81f7433
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { type ChakraProps } from '@chakra-ui/react';
import { useColorMode, type ChakraProps } from '@chakra-ui/react';
import { GrowthBookProvider } from '@growthbook/growthbook-react';
import * as Sentry from '@sentry/react';
import { QueryClientProvider } from '@tanstack/react-query';
Expand All @@ -18,6 +18,7 @@ import { growthBook } from 'lib/growthbook/init';
import useLoadFeatures from 'lib/growthbook/useLoadFeatures';
import useNotifyOnNavigation from 'lib/hooks/useNotifyOnNavigation';
import { SocketProvider } from 'lib/socket/context';
import theme from 'theme/theme';
import AppErrorBoundary from 'ui/shared/AppError/AppErrorBoundary';
import AppErrorGlobalContainer from 'ui/shared/AppError/AppErrorGlobalContainer';
import GoogleAnalytics from 'ui/shared/GoogleAnalytics';
Expand Down Expand Up @@ -47,6 +48,10 @@ function MyApp({ Component, pageProps }: AppPropsWithLayout) {

useLoadFeatures();
useNotifyOnNavigation();
const { setColorMode } = useColorMode();
if (setColorMode) {
setColorMode(theme.config.initialColorMode);
}

const queryClient = useQueryClientConfig();

Expand Down
2 changes: 0 additions & 2 deletions pages/_document.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ class MyDocument extends Document {
}

render() {
// eslint-disable-next-line no-console
console.log('theme.config.initialColorMode', theme.config.initialColorMode);
return (
<Html lang="en">
<Head>
Expand Down
4 changes: 3 additions & 1 deletion ui/shared/layout/components/Container.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, chakra, useColorModeValue } from '@chakra-ui/react';
import { Box, chakra, useColorMode, useColorModeValue } from '@chakra-ui/react';
import React from 'react';

interface Props {
Expand All @@ -7,6 +7,8 @@ interface Props {
}

const Container = ({ children, className }: Props) => {
// eslint-disable-next-line no-console
console.log('Container', useColorMode().colorMode);
const bgColor = useColorModeValue('white', 'black');

return (
Expand Down

0 comments on commit 81f7433

Please sign in to comment.