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:
anovazzi1 2023-10-23 14:28:20 -03:00
commit 863cc853c3

View file

@ -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 { ProtectedRoute } from "./components/authGuard";
import { ProtectedLoginRoute } from "./components/authLoginGuard";
@ -19,6 +19,13 @@ import LoginPage from "./pages/loginPage";
import SignUp from "./pages/signUpPage";
const Router = () => {
const navigate = useNavigate();
// Redirect from root to /flows
if (window.location.pathname === "/") {
navigate("/flows");
}
return (
<Routes>
<Route