Skip to content

Commit

Permalink
feat: remove course select page from main nav
Browse files Browse the repository at this point in the history
  • Loading branch information
ImJustChew committed Sep 28, 2024
1 parent f17e47d commit aa98283
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 48 deletions.
79 changes: 37 additions & 42 deletions src/components/BottomNav.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
"use client";
import * as I from "lucide-react";
import Link from "next/link";
import { FC, useEffect } from "react";
import { FC, useEffect, useMemo } from "react";
import { usePathname, useRouter } from "next/navigation";
import { Route } from "next";
import { useSettings } from "@/hooks/contexts/settings";
import useDictionary from "@/dictionaries/useDictionary";
import { link } from "fs";
import { Separator } from "@/components/ui/separator";

const BottomNav: FC = () => {
Expand All @@ -19,44 +17,41 @@ const BottomNav: FC = () => {
href: Route;
icon: JSX.Element;
color: string;
}[] = [
{
title: dict.navigation.today,
href: `/${language}/today`,
icon: <I.LayoutList strokeWidth="2" />,
color: "#7EC96D",
},
{
title: dict.navigation.timetable,
href: `/${language}/timetable`,
icon: <I.Calendar strokeWidth="2" />,
color: "#E47B86",
},
{
title: dict.navigation.courses,
href: `/${language}/courses`,
icon: <I.BookOpen strokeWidth="2" />,
color: "#7BC2CF",
},
{
title: dict.navigation.bus,
href: `/${language}/bus`,
icon: <I.Bus strokeWidth="2" />,
color: "#EB8751",
},
{
title: dict.applist.title,
href: `/${language}/apps`,
icon: <I.LayoutGrid strokeWidth="2" />,
color: "#AEA3C9",
},
{
title: dict.navigation.settings,
href: `/${language}/settings`,
icon: <I.Settings strokeWidth="2" />,
color: "#B46DD6",
},
];
}[] = useMemo(
() => [
{
title: dict.navigation.today,
href: `/${language}/today`,
icon: <I.LayoutList strokeWidth="2" />,
color: "#7EC96D",
},
{
title: dict.navigation.timetable,
href: `/${language}/timetable`,
icon: <I.Calendar strokeWidth="2" />,
color: "#E47B86",
},
{
title: dict.navigation.bus,
href: `/${language}/bus`,
icon: <I.Bus strokeWidth="2" />,
color: "#EB8751",
},
{
title: dict.applist.title,
href: `/${language}/apps`,
icon: <I.LayoutGrid strokeWidth="2" />,
color: "#AEA3C9",
},
{
title: dict.navigation.settings,
href: `/${language}/settings`,
icon: <I.Settings strokeWidth="2" />,
color: "#B46DD6",
},
],
[language, dict],
);

useEffect(() => {
links.forEach((link) => {
Expand All @@ -67,7 +62,7 @@ const BottomNav: FC = () => {
return (
<div className="fixed w-full bottom-0 md:hidden flex-col h-[5rem] bg-background z-50 flex">
<Separator />
<nav className="grid grid-cols-6 items-center py-2.5">
<nav className="grid grid-cols-5 items-center py-2.5">
{links.map((link, index) => (
<div
className={`flex flex-col items-center gap-1 ${link.href == pathname ? "text-primary" : "text-gray-400"}`}
Expand Down
6 changes: 0 additions & 6 deletions src/components/SideNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ const SideNav: FC = () => {
icon: <I.Calendar strokeWidth="2" />,
color: "#E47B86",
},
{
title: dict.navigation.courses,
href: `/${language}/courses`,
icon: <I.BookOpen strokeWidth="2" />,
color: "#7BC2CF",
},
{
title: dict.navigation.bus,
href: `/${language}/bus`,
Expand Down

0 comments on commit aa98283

Please sign in to comment.