-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #380 from metrico/fix/moment_locale_security
Feature: hash router
- Loading branch information
Showing
3 changed files
with
67 additions
and
64 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
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 |
---|---|---|
@@ -1,74 +1,71 @@ | ||
import React from "react"; | ||
import ReactDOM from "react-dom/client"; | ||
|
||
import React from 'react' | ||
import ReactDOM from 'react-dom/client' | ||
|
||
import axios from 'axios' | ||
import axios from "axios"; | ||
import "./scss/app.scss"; | ||
import errorInterceptor from '@ui/helpers/error.interceptor' | ||
|
||
import { Notification } from '@ui/qrynui/notifications' | ||
import errorInterceptor from "@ui/helpers/error.interceptor"; | ||
|
||
import {CookiesProvider } from 'react-cookie' | ||
import { Notification } from "@ui/qrynui/notifications"; | ||
|
||
import { BrowserRouter, Routes, Route } from 'react-router-dom' | ||
import { lazy, Suspense } from 'react' | ||
import ScreenLoader from '@ui/views/ScreenLoader' | ||
import { CookiesProvider } from "react-cookie"; | ||
|
||
import { Routes, Route, HashRouter } from "react-router-dom"; | ||
import { lazy, Suspense } from "react"; | ||
import ScreenLoader from "@ui/views/ScreenLoader"; | ||
|
||
import store from '@ui/store/store' | ||
import { Provider } from 'react-redux' | ||
import ProtectedRoute from './providers/ProtectedRoute' | ||
import store from "@ui/store/store"; | ||
import { Provider } from "react-redux"; | ||
import ProtectedRoute from "./providers/ProtectedRoute"; | ||
|
||
const AppRoute = lazy(()=> import('./App')) | ||
const AppRoute = lazy(() => import("./App")); | ||
|
||
const DataSourcesRoute = lazy(()=> import ('@ui/views/DataSources/DataSources')) | ||
const DataSourcesRoute = lazy( | ||
() => import("@ui/views/DataSources/DataSources") | ||
); | ||
|
||
const MainRoute = lazy(()=> import ("../views/Main")) | ||
const MainRoute = lazy(() => import("../views/Main")); | ||
|
||
const PluginsRoute = lazy(() => import("../plugins/Plugins")); | ||
|
||
const UserRoles = lazy(()=> import("../views/User/UserRoles")) | ||
const UserRoles = lazy(() => import("../views/User/UserRoles")); | ||
|
||
errorInterceptor(axios); | ||
|
||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( | ||
<React.StrictMode> | ||
<CookiesProvider> | ||
<Provider store={store}> | ||
<BrowserRouter> | ||
<Suspense fallback={<ScreenLoader />}> | ||
<Routes> | ||
<Route path="/" element={<AppRoute />}> | ||
<Route index element={<MainRoute />} /> | ||
<Route | ||
path="/search/*" | ||
index | ||
element={<MainRoute />} | ||
/> | ||
<Route | ||
path="/plugins" | ||
element={<PluginsRoute />} | ||
/> | ||
<Route | ||
path="/users" | ||
element={<UserRoles />} | ||
/> | ||
ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( | ||
<React.StrictMode> | ||
<CookiesProvider> | ||
<Provider store={store}> | ||
<HashRouter basename="/"> | ||
<Suspense fallback={<ScreenLoader />}> | ||
<Routes> | ||
<Route path="/" element={<AppRoute />}> | ||
<Route index element={<MainRoute />} /> | ||
<Route | ||
path="/search/*" | ||
index | ||
element={<MainRoute />} | ||
/> | ||
<Route | ||
path="/plugins" | ||
element={<PluginsRoute />} | ||
/> | ||
<Route path="/users" element={<UserRoles />} /> | ||
|
||
<Route | ||
path="/datasources/*" | ||
element={ | ||
<ProtectedRoute> | ||
{" "} | ||
<DataSourcesRoute /> | ||
</ProtectedRoute> | ||
} | ||
/> | ||
</Route> | ||
</Routes> | ||
</Suspense> | ||
</BrowserRouter> | ||
<Notification /> | ||
</Provider> | ||
</CookiesProvider> | ||
</React.StrictMode> | ||
<Route | ||
path="/datasources/*" | ||
element={ | ||
<ProtectedRoute> | ||
{" "} | ||
<DataSourcesRoute /> | ||
</ProtectedRoute> | ||
} | ||
/> | ||
</Route> | ||
</Routes> | ||
</Suspense> | ||
</HashRouter> | ||
<Notification /> | ||
</Provider> | ||
</CookiesProvider> | ||
</React.StrictMode> | ||
); |