This repository has been archived by the owner on Jun 15, 2023. It is now read-only.
generated from Team-INSERT/Repository-generator-Frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider): settings react query, react-toastify, recoil in helper
- Loading branch information
1 parent
a895832
commit 0af07f5
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"use client"; | ||
|
||
import Header from "@/components/Header"; | ||
import React, { PropsWithChildren } from "react"; | ||
import { QueryClient, QueryClientProvider } from "react-query"; | ||
import { ToastContainer, toast } from "react-toastify"; | ||
import { RecoilRoot } from "recoil"; | ||
import styled from "styled-components"; | ||
|
||
const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
refetchOnWindowFocus: false, | ||
suspense: false, | ||
}, | ||
}, | ||
}); | ||
|
||
const CustomToastContainer = styled(ToastContainer)` | ||
.Toastify__toast { | ||
color: black; | ||
font-size: 14px; | ||
} | ||
`; | ||
|
||
const Provider = ({ children }: PropsWithChildren) => { | ||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<RecoilRoot> | ||
<CustomToastContainer | ||
autoClose={1000} | ||
position={toast.POSITION.TOP_RIGHT} | ||
/> | ||
<Header /> | ||
<React.Fragment>{children}</React.Fragment> | ||
</RecoilRoot> | ||
</QueryClientProvider> | ||
); | ||
}; | ||
|
||
export default Provider; |