-
-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Upgrade react-router v5 to v6
- Loading branch information
Showing
11 changed files
with
241 additions
and
451 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ | |
"rehype-raw": "7.0.0", | ||
"react-markdown": "9.0.1", | ||
"remark-gfm": "4.0.0", | ||
"react-router-dom": "5.3.3", | ||
"react-router-dom": "6.27.0", | ||
"react-scripts": "5.0.1", | ||
"semaphore": "1.1.0", | ||
"use-long-press": "3.2.0", | ||
|
@@ -63,7 +63,6 @@ | |
"@babel/plugin-proposal-private-property-in-object": "7.21.11", | ||
"@types/react": "18.3.8", | ||
"@types/react-dom": "18.3.0", | ||
"@types/react-router-dom": "5.3.3", | ||
"@types/uuid": "10.0.0", | ||
"tsutils": "3.21.0", | ||
"cra-build-watch": "git+https://[email protected]/Hypfer/cra-build-watch.git#5.0.0" | ||
|
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import {Route} from "react-router"; | ||
import {Navigate, Routes} from "react-router-dom"; | ||
import {useCapabilitiesSupported} from "../CapabilitiesProvider"; | ||
import {Capability} from "../api"; | ||
import ConnectivityOptions from "./connectivity/ConnectivityOptions"; | ||
import NTPConnectivityPage from "./connectivity/NTPConnectivityPage"; | ||
import AuthSettingsPage from "./connectivity/AuthSettingsPage"; | ||
import WifiConnectivityPage from "./connectivity/WifiConnectivityPage"; | ||
import NetworkAdvertisementSettingsPage from "./connectivity/NetworkAdvertisementSettingsPage"; | ||
import React from "react"; | ||
import MQTTConnectivityPage from "./connectivity/MQTTConnectivityPage"; | ||
|
||
const OptionsRouter = (): React.ReactElement => { | ||
const [ | ||
wifiConfigurationCapabilitySupported, | ||
] = useCapabilitiesSupported( | ||
Capability.WifiConfiguration | ||
); | ||
|
||
return ( | ||
<Routes> | ||
<Route path={""} element={<ConnectivityOptions />} /> | ||
<Route path={"auth"} element={<AuthSettingsPage />} /> | ||
<Route path={"mqtt"} element={<MQTTConnectivityPage />} /> | ||
<Route path={"networkadvertisement"} element={<NetworkAdvertisementSettingsPage />} /> | ||
<Route path={"ntp"} element={<NTPConnectivityPage />} /> | ||
|
||
{wifiConfigurationCapabilitySupported && ( | ||
<Route path={"wifi"} element={<WifiConnectivityPage />} /> | ||
)} | ||
|
||
<Route path="*" element={<Navigate to="/" />} /> | ||
</Routes> | ||
); | ||
}; | ||
|
||
export default OptionsRouter; |
Oops, something went wrong.