Skip to content

Commit

Permalink
Merge pull request #382 from 42connected/feature/#378-recoil
Browse files Browse the repository at this point in the history
[Feature] recoil #378
  • Loading branch information
Seojunhwan authored Nov 18, 2022
2 parents b568931 + 8a08c55 commit cdcb648
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 6 deletions.
38 changes: 38 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"react-slick": "^0.29.0",
"react-table": "^7.8.0",
"react-to-print": "^2.14.7",
"recoil": "^0.7.6",
"serve": "^14.0.1",
"slick-carousel": "^1.8.1",
"styled-components": "^5.3.5",
Expand Down
13 changes: 8 additions & 5 deletions src/components/common/Providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ReactNode } from 'react';
import { BrowserRouter as Router } from 'react-router-dom';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { RecoilRoot } from 'recoil';

import defaultThemeV1 from '@/styles/theme';
import defaultThemeV2 from '@/styles/themeV2';
Expand All @@ -23,12 +24,14 @@ function Providers({ children }: Props) {
return (
<>
<QueryClientProvider client={queryClient}>
<ThemeProvider theme={defaultThemeV1}>
<ThemeProvider theme={defaultThemeV2}>
<Router basename="/">{children}</Router>
<ReactQueryDevtools initialIsOpen={false} />
<RecoilRoot>
<ThemeProvider theme={defaultThemeV1}>
<ThemeProvider theme={defaultThemeV2}>
<Router basename="/">{children}</Router>
<ReactQueryDevtools initialIsOpen={false} />
</ThemeProvider>
</ThemeProvider>
</ThemeProvider>
</RecoilRoot>
</QueryClientProvider>
</>
);
Expand Down
1 change: 1 addition & 0 deletions src/recoil/atoms/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './modalAtom';
6 changes: 6 additions & 0 deletions src/recoil/atoms/modalAtom.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { atom } from 'recoil';

export const isModalOpenState = atom({
key: 'isModalOpenState',
default: false,
});
3 changes: 2 additions & 1 deletion tsconfig.paths.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"@/states/*": ["src/states/*"],
"@/styles/*": ["src/styles/*"],
"@/utils/*": ["src/utils/*"],
"@/services/*": ["src/services/*"]
"@/services/*": ["src/services/*"],
"@/recoil/*": ["src/recoil/*"]
}
}
}

0 comments on commit cdcb648

Please sign in to comment.