-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
67 additions
and
48 deletions.
There are no files selected for viewing
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
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,25 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { QueryClientProvider } from '@tanstack/react-query'; | ||
|
||
import ConfigContextProvider from 'providers/ConfigProvider'; | ||
import SettingsContextProvider from 'providers/SettingsProvider'; | ||
import AuthContextProvider from 'providers/AuthProvider'; | ||
import ToastsProvider from 'providers/ToastsProvider'; | ||
|
||
import { queryClient } from './query-client'; | ||
|
||
const AllProvidersExceptRouter = ({ children }: PropsWithChildren): JSX.Element => { | ||
return ( | ||
<ConfigContextProvider> | ||
<QueryClientProvider client={queryClient}> | ||
<SettingsContextProvider> | ||
<AuthContextProvider> | ||
<ToastsProvider>{children}</ToastsProvider> | ||
</AuthContextProvider> | ||
</SettingsContextProvider> | ||
</QueryClientProvider> | ||
</ConfigContextProvider> | ||
); | ||
}; | ||
|
||
export default AllProvidersExceptRouter; |
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,28 @@ | ||
import { PropsWithChildren } from 'react'; | ||
import { MemoryRouter } from 'react-router-dom'; | ||
import { QueryClientProvider } from '@tanstack/react-query'; | ||
|
||
import ConfigContextProvider from 'providers/ConfigProvider'; | ||
import SettingsContextProvider from 'providers/SettingsProvider'; | ||
import AuthContextProvider from 'providers/AuthProvider'; | ||
import ToastsProvider from 'providers/ToastsProvider'; | ||
|
||
import { queryClient } from './query-client'; | ||
|
||
const WithAllProviders = ({ children }: PropsWithChildren): JSX.Element => { | ||
return ( | ||
<ConfigContextProvider> | ||
<QueryClientProvider client={queryClient}> | ||
<SettingsContextProvider> | ||
<AuthContextProvider> | ||
<ToastsProvider> | ||
<MemoryRouter>{children}</MemoryRouter> | ||
</ToastsProvider> | ||
</AuthContextProvider> | ||
</SettingsContextProvider> | ||
</QueryClientProvider> | ||
</ConfigContextProvider> | ||
); | ||
}; | ||
|
||
export default WithAllProviders; |
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,9 @@ | ||
import { QueryClient } from '@tanstack/react-query'; | ||
|
||
export const queryClient = new QueryClient({ | ||
defaultOptions: { | ||
queries: { | ||
retry: false, | ||
}, | ||
}, | ||
}); |
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
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