diff --git a/frontend/src/pages/about/our-history.tsx b/frontend/src/pages/about/our-history.tsx index 53a9d23..368c3d4 100644 --- a/frontend/src/pages/about/our-history.tsx +++ b/frontend/src/pages/about/our-history.tsx @@ -1,9 +1,14 @@ import Navbar from "@/components/Navbar"; import Footer from "@/components/Footer"; +import { useState } from "react"; + +const MIN_YEAR = 2007; +const MAX_YEAR = 2020; +const DEFAULT_YEAR = 2020; const OurHistory = () => { - // Years from 2020 to 2007 - const years: number[] = Array.from({ length: 14 }, (_, i) => 2020 - i); + const [year, setYear] = useState(DEFAULT_YEAR); + const [shouldDisplayTip, setShouldDisplayTip] = useState(true); return (
@@ -42,14 +47,35 @@ const OurHistory = () => {
- {years.map((year: number) => ( -
-
-

{year}

- {`CSESoc -
+
+

{year}

+ + { + setYear(parseInt(e.target.value)) + setShouldDisplayTip(false) + }} + /> +
+

{MIN_YEAR}

+

{MAX_YEAR}

+
+ + {shouldDisplayTip && ( +

Use the slider to see the teams from past years!

+ )} + +
+ {`CSESoc
- ))} +