Files
examjam-frontend/app/(tabs)/layout.tsx
Dacca Retro 58d4d14a51 fix(api): fix api endpoint logic #5
chore(env): obscure api url in env

feat(ui): render subjects according to user preparation unit
2025-08-18 15:06:50 +06:00

41 lines
1.3 KiB
TypeScript

// app/tabs/layout.tsx
"use client";
import Link from "next/link";
import { ReactNode } from "react";
import { usePathname } from "next/navigation";
import clsx from "clsx";
import { House, LayoutGrid, Bookmark, Settings } from "lucide-react";
const tabs = [
{ name: "Home", href: "/home", component: <House size={30} /> },
{ name: "Subjects", href: "/subjects", component: <LayoutGrid size={30} /> },
{ name: "Bookmark", href: "/bookmark", component: <Bookmark size={30} /> },
{ name: "Settings", href: "/settings", component: <Settings size={30} /> },
];
export default function TabsLayout({ children }: { children: ReactNode }) {
const pathname = usePathname();
return (
<div className="min-h-screen flex flex-col">
<main className="flex-1">{children}</main>
<nav className="h-[70px] w-full flex justify-around items-center border-t border-t-neutral-400 p-4 rounded-t-4xl bg-white fixed bottom-0">
{tabs.map((tab) => (
<Link
key={tab.name}
href={tab.href}
className={clsx(
"text-center text-sm font-medium",
pathname === tab.href ? "text-blue-600" : "text-gray-500"
)}
>
{tab.component}
</Link>
))}
</nav>
</div>
);
}