2024-02-01 13:18:16 +00:00
|
|
|
import { CssBaseline, ThemeProvider } from "@mui/material";
|
|
|
|
import { LocalizationProvider } from "@mui/x-date-pickers";
|
|
|
|
import { AdapterMoment } from "@mui/x-date-pickers/AdapterMoment";
|
|
|
|
import { ruRU } from '@mui/x-date-pickers/locales';
|
2024-02-08 13:42:31 +00:00
|
|
|
import ErrorBoundaryFallback from "@ui_kit/ErrorBoundaryFallback";
|
2024-02-02 14:35:02 +00:00
|
|
|
import LoadingSkeleton from "@ui_kit/LoadingSkeleton";
|
|
|
|
import { handleComponentError } from "@utils/handleComponentError";
|
2024-02-01 13:18:16 +00:00
|
|
|
import moment from "moment";
|
|
|
|
import { SnackbarProvider } from 'notistack';
|
2024-02-02 14:35:02 +00:00
|
|
|
import { Suspense } from "react";
|
|
|
|
import { ErrorBoundary } from "react-error-boundary";
|
2024-02-01 13:18:16 +00:00
|
|
|
import { SWRConfig } from "swr";
|
2024-02-08 13:42:31 +00:00
|
|
|
import ViewPublicationPage from "./pages/ViewPublicationPage/ViewPublicationPage";
|
2024-02-01 13:18:16 +00:00
|
|
|
import lightTheme from "./utils/themes/light";
|
|
|
|
|
|
|
|
|
|
|
|
moment.locale("ru");
|
|
|
|
const localeText = ruRU.components.MuiLocalizationProvider.defaultProps.localeText;
|
|
|
|
|
2024-02-02 14:35:02 +00:00
|
|
|
export default function QuizAnswerer() {
|
2024-02-01 13:18:16 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<SWRConfig value={{
|
|
|
|
revalidateOnFocus: false,
|
|
|
|
shouldRetryOnError: false,
|
|
|
|
}}>
|
|
|
|
<LocalizationProvider dateAdapter={AdapterMoment} adapterLocale="ru" localeText={localeText}>
|
|
|
|
<ThemeProvider theme={lightTheme}>
|
|
|
|
<SnackbarProvider
|
|
|
|
preventDuplicate={true}
|
|
|
|
style={{ backgroundColor: lightTheme.palette.brightPurple.main }}
|
|
|
|
>
|
|
|
|
<CssBaseline />
|
2024-02-02 14:35:02 +00:00
|
|
|
<ErrorBoundary
|
2024-02-08 13:42:31 +00:00
|
|
|
FallbackComponent={ErrorBoundaryFallback}
|
2024-02-02 14:35:02 +00:00
|
|
|
onError={handleComponentError}
|
|
|
|
>
|
|
|
|
<Suspense fallback={<LoadingSkeleton />}>
|
2024-02-08 13:42:31 +00:00
|
|
|
<ViewPublicationPage />
|
2024-02-02 14:35:02 +00:00
|
|
|
</Suspense>
|
|
|
|
</ErrorBoundary>
|
2024-02-01 13:18:16 +00:00
|
|
|
</SnackbarProvider>
|
|
|
|
</ThemeProvider>
|
|
|
|
</LocalizationProvider>
|
|
|
|
</SWRConfig>
|
|
|
|
);
|
2024-02-02 14:35:02 +00:00
|
|
|
}
|