fix: move CartSnackbar inside BrowserRouter in App.tsx
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { BrowserRouter } from 'react-router-dom'
|
||||
import { AppProviders } from '@/app/providers/AppProviders'
|
||||
import { AppRoutes } from '@/app/routes'
|
||||
import { CartSnackbar } from '@/shared/ui/CartSnackbar'
|
||||
import { ErrorBoundary } from '@/shared/ui/ErrorBoundary'
|
||||
|
||||
export function App() {
|
||||
@@ -10,6 +11,7 @@ export function App() {
|
||||
<ErrorBoundary>
|
||||
<AppRoutes />
|
||||
</ErrorBoundary>
|
||||
<CartSnackbar />
|
||||
</BrowserRouter>
|
||||
</AppProviders>
|
||||
)
|
||||
|
||||
@@ -3,7 +3,6 @@ import CssBaseline from '@mui/material/CssBaseline'
|
||||
import { ThemeProvider, createTheme } from '@mui/material/styles'
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
||||
import { ThemeControllerProvider, useThemeController } from '@/app/providers/theme-controller'
|
||||
import { CartSnackbar } from '@/shared/ui/CartSnackbar'
|
||||
import { SseProvider } from './SseProvider'
|
||||
|
||||
function AppThemeInner({ children }: PropsWithChildren) {
|
||||
@@ -189,10 +188,7 @@ export function AppProviders({ children }: PropsWithChildren) {
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<SseProvider />
|
||||
<ThemeControllerProvider>
|
||||
<AppThemeInner>
|
||||
{children}
|
||||
<CartSnackbar />
|
||||
</AppThemeInner>
|
||||
<AppThemeInner>{children}</AppThemeInner>
|
||||
</ThemeControllerProvider>
|
||||
</QueryClientProvider>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user