feat(routes.tsx): add redirect from root to /flows to improve user experience
In this commit, a redirect from the root path ("/") to the "/flows" path was added in the routes.tsx file. This change was made to improve the user experience by automatically redirecting users to the "/flows" page when they visit the root URL. The redirect is implemented using the useNavigate hook from the react-router-dom library.
This commit is contained in:
parent
f060155fe6
commit
863cc853c3
1 changed files with 8 additions and 1 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
import { Route, Routes } from "react-router-dom";
|
import { Route, Routes, useNavigate } from "react-router-dom";
|
||||||
import { ProtectedAdminRoute } from "./components/authAdminGuard";
|
import { ProtectedAdminRoute } from "./components/authAdminGuard";
|
||||||
import { ProtectedRoute } from "./components/authGuard";
|
import { ProtectedRoute } from "./components/authGuard";
|
||||||
import { ProtectedLoginRoute } from "./components/authLoginGuard";
|
import { ProtectedLoginRoute } from "./components/authLoginGuard";
|
||||||
|
|
@ -19,6 +19,13 @@ import LoginPage from "./pages/loginPage";
|
||||||
import SignUp from "./pages/signUpPage";
|
import SignUp from "./pages/signUpPage";
|
||||||
|
|
||||||
const Router = () => {
|
const Router = () => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
// Redirect from root to /flows
|
||||||
|
if (window.location.pathname === "/") {
|
||||||
|
navigate("/flows");
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route
|
<Route
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue