diff --git a/app/auth/layout.tsx b/app/auth/layout.tsx new file mode 100644 index 0000000..0120eac --- /dev/null +++ b/app/auth/layout.tsx @@ -0,0 +1,14 @@ +import { AuthBottomNav } from "@/components/layout/auth-bottom-nav"; + +export default function AuthLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + <> + {children} + + + ); +} diff --git a/components/layout/auth-bottom-nav.tsx b/components/layout/auth-bottom-nav.tsx new file mode 100644 index 0000000..637f7ed --- /dev/null +++ b/components/layout/auth-bottom-nav.tsx @@ -0,0 +1,45 @@ +"use client"; + +import Link from "next/link"; +import { usePathname } from "next/navigation"; +import { Home, LogIn, UserPlus } from "lucide-react"; + +import { routes } from "@/lib/routes"; +import { cn } from "@/lib/utils"; + +const authNavItems = [ + { href: routes.home, label: "Home", icon: Home }, + { href: routes.login, label: "Sign in", icon: LogIn }, + { href: routes.signUp, label: "Sign up", icon: UserPlus }, +] as const; + +export function AuthBottomNav() { + const pathname = usePathname(); + + return ( + + ); +} diff --git a/components/logout-button.tsx b/components/logout-button.tsx index 4b8b90b..f8a0dc0 100644 --- a/components/logout-button.tsx +++ b/components/logout-button.tsx @@ -1,16 +1,19 @@ "use client"; -import { createClient } from "@/lib/supabase/client"; -import { Button } from "@/components/ui/button"; import { useRouter } from "next/navigation"; +import { Button } from "@/components/ui/button"; +import { createClient } from "@/lib/supabase/client"; +import { routes } from "@/lib/routes"; + export function LogoutButton() { const router = useRouter(); const logout = async () => { const supabase = createClient(); await supabase.auth.signOut(); - router.push("/auth/login"); + router.push(routes.home); + router.refresh(); }; return ;