Skip to content

Commit

Permalink
fix: charkra theme 전역 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
a-honey committed Feb 1, 2024
1 parent 6da0bd4 commit 38f90a5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
19 changes: 2 additions & 17 deletions src/components/atoms/Toggle.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,12 @@
import React from 'react';
import { extendTheme, ThemeProvider, CSSReset, Switch } from '@chakra-ui/react';

const customTheme = extendTheme({
colors: {
primary2: {
500: '#3CAA8D',
},
},
});
import { Switch } from '@chakra-ui/react';

const Toggle: React.FC<{
isToggleOn?: boolean;
onClick?: () => void;
}> = ({ isToggleOn, onClick }) => {
return (
<ThemeProvider theme={customTheme}>
<CSSReset />
<Switch
colorScheme="primary2"
isChecked={isToggleOn}
onChange={onClick}
/>
</ThemeProvider>
<Switch colorScheme="primary2" isChecked={isToggleOn} onChange={onClick} />
);
};

Expand Down
16 changes: 13 additions & 3 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ChakraProvider, CSSReset, extendTheme } from '@chakra-ui/react';
import Layout from '@/components/templates/Layout';
import '@/styles/globals.css';
import type { AppProps } from 'next/app';
Expand All @@ -6,12 +7,21 @@ import 'dayjs/locale/ko';
import dayjs from 'dayjs';
dayjs.locale('ko');

const theme = extendTheme({
colors: {
primary2: { 500: '#3CAA8D' },
},
});

export default function App({ Component, pageProps }: AppProps): JSX.Element {
return (
<RecoilRoot>
<Layout>
<Component {...pageProps} />
</Layout>
<ChakraProvider theme={theme}>
<CSSReset />
<Layout>
<Component {...pageProps} />
</Layout>
</ChakraProvider>
</RecoilRoot>
);
}

0 comments on commit 38f90a5

Please sign in to comment.