From 863cc853c35f18df738c515853ef35cb99ac7e3b Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Mon, 23 Oct 2023 14:28:20 -0300 Subject: [PATCH] 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. --- src/frontend/src/routes.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/frontend/src/routes.tsx b/src/frontend/src/routes.tsx index 1ef18f3c6..e78e0f489 100644 --- a/src/frontend/src/routes.tsx +++ b/src/frontend/src/routes.tsx @@ -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 (