diff --git a/src/components/BottomNav.tsx b/src/components/BottomNav.tsx index c9840295..d15d01b3 100644 --- a/src/components/BottomNav.tsx +++ b/src/components/BottomNav.tsx @@ -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 = () => { @@ -19,44 +17,41 @@ const BottomNav: FC = () => { href: Route; icon: JSX.Element; color: string; - }[] = [ - { - title: dict.navigation.today, - href: `/${language}/today`, - icon: , - color: "#7EC96D", - }, - { - title: dict.navigation.timetable, - href: `/${language}/timetable`, - icon: , - color: "#E47B86", - }, - { - title: dict.navigation.courses, - href: `/${language}/courses`, - icon: , - color: "#7BC2CF", - }, - { - title: dict.navigation.bus, - href: `/${language}/bus`, - icon: , - color: "#EB8751", - }, - { - title: dict.applist.title, - href: `/${language}/apps`, - icon: , - color: "#AEA3C9", - }, - { - title: dict.navigation.settings, - href: `/${language}/settings`, - icon: , - color: "#B46DD6", - }, - ]; + }[] = useMemo( + () => [ + { + title: dict.navigation.today, + href: `/${language}/today`, + icon: , + color: "#7EC96D", + }, + { + title: dict.navigation.timetable, + href: `/${language}/timetable`, + icon: , + color: "#E47B86", + }, + { + title: dict.navigation.bus, + href: `/${language}/bus`, + icon: , + color: "#EB8751", + }, + { + title: dict.applist.title, + href: `/${language}/apps`, + icon: , + color: "#AEA3C9", + }, + { + title: dict.navigation.settings, + href: `/${language}/settings`, + icon: , + color: "#B46DD6", + }, + ], + [language, dict], + ); useEffect(() => { links.forEach((link) => { @@ -67,7 +62,7 @@ const BottomNav: FC = () => { return (
-