flockstr/app/(app)/_layout/BottomNav.tsx

69 lines
1.9 KiB
TypeScript
Raw Normal View History

2023-10-27 14:55:53 -04:00
"use client";
2023-10-13 19:02:59 -04:00
import Link from "next/link";
import {
2023-10-27 17:48:49 -04:00
RiCalendarEventFill,
2023-10-13 19:02:59 -04:00
RiCompass3Fill,
RiQuestionAnswerFill,
} from "react-icons/ri";
import { cn } from "@/lib/utils";
2023-10-27 14:55:53 -04:00
import { usePathname } from "next/navigation";
2023-10-13 19:02:59 -04:00
export default function BottomNav() {
2023-10-27 14:55:53 -04:00
const pathname = usePathname();
2023-10-13 19:02:59 -04:00
const navigationItems = [
{
2023-10-27 14:55:53 -04:00
href: "/explore",
2023-10-13 19:02:59 -04:00
name: "explore",
icon: RiCompass3Fill,
},
2023-10-27 17:48:49 -04:00
{
href: "/events",
name: "events",
icon: RiCalendarEventFill,
},
2023-10-13 19:02:59 -04:00
{
2023-11-03 08:41:02 -04:00
href: "/explore",
2023-10-13 19:02:59 -04:00
name: "messages",
icon: RiQuestionAnswerFill,
},
];
return (
2023-10-15 00:14:22 -04:00
<footer className="z-header- flex h-[var(--bottom-nav-height)] w-full sm:hidden">
2023-10-15 00:18:08 -04:00
<div className="bottom-tabs fixed inset-x-0 bottom-0 flex h-[var(--bottom-nav-height)] flex-1 items-stretch justify-between border-t bg-background px-4">
2023-10-14 23:41:59 -04:00
{navigationItems.map((item) => (
2023-10-15 12:11:39 -04:00
<Link
key={item.name}
href={item.href}
className="center group group flex-1"
>
2023-10-14 23:41:59 -04:00
<item.icon
className={cn(
2023-10-27 14:55:53 -04:00
pathname === item.href
2023-10-14 23:41:59 -04:00
? "text-foreground"
: "text-muted-foreground group-hover:text-foreground",
"h-6 w-6 shrink-0",
)}
aria-hidden="true"
/>
</Link>
))}
2023-10-13 19:02:59 -04:00
</div>
</footer>
);
}
const test = {
id: "cd6bff4b8ddc18e8d99d4075c229d174b5101f6c3ae3bf178abe9176dd9e50c0",
pubkey: "17717ad4d20e2a425cda0a2195624a0a4a73c4f6975f16b1593fc87fa46f2d58",
created_at: 1699013775,
kind: 1,
tags: [
[
"a",
"naddr1qqyxzdmyvyukyerpqyfhwumn8ghj7un9d3shjctzd3jjummjvupzqjm3fx8tusvwrsytszzf6k2jv73stwe208dnuznuw6xduxzqu50dqvzqqqrukvqkqn72",
],
],
content: "This Event looks awesome!",
sig: "68f3590eaf2a11a4b23692a029d11bc6cfe8bf15d7dc955553795fbbeb5eeec5786fb4bb9ca559af842582e086aa13f9005f2a8079b753ee95b49fcca33f6297",
};