diff --git a/messages/en.json b/messages/en.json index 1157ca8d..eb37068a 100644 --- a/messages/en.json +++ b/messages/en.json @@ -1,6 +1,7 @@ { "Index": { "HomePage": { + "title":"Home", "hint": "Hint", "optimal-yellow-layer": "Optimal Yellow Layer", "solving": "Solving...", diff --git a/src/components/navbar/NavItem.tsx b/src/components/navbar/NavItem.tsx index 984948c9..0e47566d 100644 --- a/src/components/navbar/NavItem.tsx +++ b/src/components/navbar/NavItem.tsx @@ -1,12 +1,14 @@ import { Link, usePathname } from "@/i18n/routing"; import { twMerge } from "tailwind-merge"; +import { InteractiveIcon } from "../timer/InteractiveIcon"; interface NavItem { path: string; icon: React.ReactNode; + toolTipMessage:string; } -export function NavItem({ path, icon }: NavItem) { +export function NavItem({ path, icon , toolTipMessage}: NavItem) { const pathname = usePathname(); return ( <> @@ -20,7 +22,11 @@ export function NavItem({ path, icon }: NavItem) { } transition duration-300 py-2 flex flex-col justify-center items-center font-medium ` )} > - {icon} + diff --git a/src/components/navbar/Navbar.tsx b/src/components/navbar/Navbar.tsx index f6e7a688..3e1dbb42 100644 --- a/src/components/navbar/Navbar.tsx +++ b/src/components/navbar/Navbar.tsx @@ -6,38 +6,46 @@ import { CubeIcon, StackIcon, } from "@radix-ui/react-icons"; - -const navigation: Navigation = [ - { - path: "/", - icon: , - }, - { - path: "/solves", - icon: , - }, - { - path: "/stats", - icon: , - }, - { - path: "/cubes", - icon: , - }, -]; +import { useTranslations } from "next-intl"; type Navigation = NavItem[]; interface NavItem { path: string; icon: React.ReactNode; + toolTipMessage: string; } export default function Navbar() { + + const t = useTranslations("Index"); + + const navigation: Navigation = [ + { + path: "/", + icon: , + toolTipMessage: t("HomePage.title"), + }, + { + path: "/solves", + icon: , + toolTipMessage: t("SolvesPage.title"), + }, + { + path: "/stats", + icon: , + toolTipMessage: t("StatsPage.title"), + }, + { + path: "/cubes", + icon: , + toolTipMessage: t("CubesPage.title"), + }, + ]; return ( {navigation.map((item: NavItem) => { - return ; + return ; })} );