From a0bef85c11f2bc257993cb8fd2ba202d44b51294 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Wed, 10 Apr 2024 06:46:05 -0600 Subject: [PATCH] Rename to reviews and redirect events to reviews --- web/src/App.tsx | 4 +++- web/src/components/navigation/Redirect.tsx | 14 ++++++++++++++ web/src/pages/site-navigation.ts | 9 +++++---- 3 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 web/src/components/navigation/Redirect.tsx diff --git a/web/src/App.tsx b/web/src/App.tsx index 2f0853200..d23f78917 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -7,6 +7,7 @@ import { isDesktop, isMobile } from "react-device-detect"; import Statusbar from "./components/Statusbar"; import Bottombar from "./components/navigation/Bottombar"; import { Suspense, lazy } from "react"; +import { Redirect } from "./components/navigation/Redirect"; const Live = lazy(() => import("@/pages/Live")); const Events = lazy(() => import("@/pages/Events")); @@ -35,7 +36,8 @@ function App() { } /> - } /> + } /> + } /> } /> } /> } /> diff --git a/web/src/components/navigation/Redirect.tsx b/web/src/components/navigation/Redirect.tsx new file mode 100644 index 000000000..d905666a9 --- /dev/null +++ b/web/src/components/navigation/Redirect.tsx @@ -0,0 +1,14 @@ +import { useEffect } from "react"; +import { useNavigate } from "react-router-dom"; + +type RedirectProps = { + to: string; +}; +export function Redirect({ to }: RedirectProps) { + const navigate = useNavigate(); + + useEffect(() => { + navigate(to); + }, [to, navigate]); + return
; +} diff --git a/web/src/pages/site-navigation.ts b/web/src/pages/site-navigation.ts index 2810c8371..545b25b15 100644 --- a/web/src/pages/site-navigation.ts +++ b/web/src/pages/site-navigation.ts @@ -1,5 +1,6 @@ import Logo from "@/components/Logo"; -import { FaCompactDisc, FaFlag, FaVideo } from "react-icons/fa"; +import { FaCompactDisc, FaVideo } from "react-icons/fa"; +import { TbTimelineEventFilled } from "react-icons/tb"; import { LuConstruction } from "react-icons/lu"; export const navbarLinks = [ @@ -11,9 +12,9 @@ export const navbarLinks = [ }, { id: 2, - icon: FaFlag, - title: "Events", - url: "/events", + icon: TbTimelineEventFilled, + title: "Reviews", + url: "/reviews", }, { id: 3,