mirror of
https://github.com/sasjs/server.git
synced 2026-01-19 11:50:05 +00:00
chore: fix breaking changes caused by react-router-dom update
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { useContext } from 'react'
|
import React, { useContext } from 'react'
|
||||||
import { Route, HashRouter, Switch } from 'react-router-dom'
|
import { Route, HashRouter, Routes } from 'react-router-dom'
|
||||||
import { ThemeProvider } from '@mui/material/styles'
|
import { ThemeProvider } from '@mui/material/styles'
|
||||||
import { theme } from './theme'
|
import { theme } from './theme'
|
||||||
|
|
||||||
@@ -22,11 +22,9 @@ function App() {
|
|||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<Header />
|
<Header />
|
||||||
<Switch>
|
<Routes>
|
||||||
<Route path="/">
|
<Route path="/" element={<Login />} />
|
||||||
<Login />
|
</Routes>
|
||||||
</Route>
|
|
||||||
</Switch>
|
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
)
|
)
|
||||||
@@ -36,23 +34,13 @@ function App() {
|
|||||||
<ThemeProvider theme={theme}>
|
<ThemeProvider theme={theme}>
|
||||||
<HashRouter>
|
<HashRouter>
|
||||||
<Header />
|
<Header />
|
||||||
<Switch>
|
<Routes>
|
||||||
<Route exact path="/">
|
<Route path="/" element={<Home />} />
|
||||||
<Home />
|
<Route path="/SASjsDrive" element={<Drive />} />
|
||||||
</Route>
|
<Route path="/SASjsStudio" element={<Studio />} />
|
||||||
<Route exact path="/SASjsDrive">
|
<Route path="/SASjsSettings" element={<Settings />} />
|
||||||
<Drive />
|
<Route path="/SASjsLogon" element={<AuthCode />} />
|
||||||
</Route>
|
</Routes>
|
||||||
<Route exact path="/SASjsStudio">
|
|
||||||
<Studio />
|
|
||||||
</Route>
|
|
||||||
<Route exact path="/SASjsSettings">
|
|
||||||
<Settings />
|
|
||||||
</Route>
|
|
||||||
<Route exact path="/SASjsLogon">
|
|
||||||
<AuthCode />
|
|
||||||
</Route>
|
|
||||||
</Switch>
|
|
||||||
<ToastContainer />
|
<ToastContainer />
|
||||||
</HashRouter>
|
</HashRouter>
|
||||||
</ThemeProvider>
|
</ThemeProvider>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React, { useState, useEffect, useContext } from 'react'
|
import React, { useState, useEffect, useContext } from 'react'
|
||||||
import { Link, useHistory, useLocation } from 'react-router-dom'
|
import { Link, useNavigate, useLocation } from 'react-router-dom'
|
||||||
|
|
||||||
import {
|
import {
|
||||||
AppBar,
|
AppBar,
|
||||||
@@ -24,7 +24,7 @@ const baseUrl =
|
|||||||
const validTabs = ['/', '/SASjsDrive', '/SASjsStudio']
|
const validTabs = ['/', '/SASjsDrive', '/SASjsStudio']
|
||||||
|
|
||||||
const Header = (props: any) => {
|
const Header = (props: any) => {
|
||||||
const history = useHistory()
|
const navigate = useNavigate()
|
||||||
const { pathname } = useLocation()
|
const { pathname } = useLocation()
|
||||||
const appContext = useContext(AppContext)
|
const appContext = useContext(AppContext)
|
||||||
const [tabValue, setTabValue] = useState(
|
const [tabValue, setTabValue] = useState(
|
||||||
@@ -74,7 +74,7 @@ const Header = (props: any) => {
|
|||||||
}}
|
}}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setTabValue('/')
|
setTabValue('/')
|
||||||
history.push('/')
|
navigate('/')
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Tabs
|
<Tabs
|
||||||
|
|||||||
Reference in New Issue
Block a user