add: bottom nav bar

This commit is contained in:
Mahyar Khanbolooki
2025-07-04 14:03:41 +03:30
parent 76ecb5839e
commit 691dc7c100
17 changed files with 368 additions and 122 deletions
-1
View File
@@ -1,4 +1,3 @@
"use client";
import { ReactQueryProvider } from '@/components/providers/ReactQueryProvider'
-1
View File
@@ -117,7 +117,6 @@ function AuthIndex({ }: Props) {
};
const onSubmit = async (e: FormEvent<HTMLFormElement>) => {
console.log(step);
e.preventDefault();
try {
setIsPending(true);
+1
View File
@@ -15,6 +15,7 @@
--color-disabled-text: #8C90A3;
--radius-normal: 10px;
--text-sm2: 13px;
--text-xs2: 10px;
--radius-container: 24px;
}
+7 -5
View File
@@ -1,20 +1,22 @@
import type { Metadata } from "next";
import { Metadata } from "next";
import "./globals.css";
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
title: 'Dashboard',
description: 'Webapp dashboard'
}
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en">
<body
className={`antialiased`}
className={`antialiased bg-background h-full`}
>
{children}
</body>
+22
View File
@@ -0,0 +1,22 @@
import BottomNavBar from "@/components/navigation/BottomNavBar";
import { ReactQueryProvider } from "@/components/providers/ReactQueryProvider";
export const metadata = {
title: 'Menu',
}
export default function MenuLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<ReactQueryProvider>
<main className="h-full pb-0">
{children}
</main>
<BottomNavBar />
</ReactQueryProvider>
);
}
+10
View File
@@ -0,0 +1,10 @@
'use client';
export default function MenuIndex() {
return (
<>
Menu
</>
);
}
+4 -111
View File
@@ -1,118 +1,11 @@
'use client';
import { useAuthStore } from "@/zustand/authStore";
import Image from "next/image";
import Link from "next/link";
export default function Home() {
const logout = useAuthStore((state) => state.logout);
const isAuthenticated = useAuthStore((state) => state.isAuthenticated);
return (
<div className="grid font-sans grid-rows-[20px_1fr_20px] items-center justify-items-center min-h-screen p-8 pb-20 gap-16 sm:p-20">
<main className="flex flex-col gap-[32px] row-start-2 items-center sm:items-start">
{!isAuthenticated && <Link href={"/auth"}>Login</Link>}
{isAuthenticated &&
<div>
{/* <Link href={"/profile"}>Profile</Link>
<br /> */}
<Link href={""} onClick={logout}>Logout</Link>
</div>}
<Image
className="dark:invert"
src="/next.svg"
alt="Next.js logo"
width={180}
height={38}
priority
/>
<ol className="list-inside list-decimal text-sm/6 text-center sm:text-left font-[family-name:var(--font-geist-mono)]">
<li className="mb-2 tracking-[-.01em]">
Get started by editing{" "}
<code className="bg-black/[.05] dark:bg-white/[.06] px-1 py-0.5 rounded font-[family-name:var(--font-geist-mono)] font-semibold">
src/app/page.tsx
</code>
.
</li>
<li className="tracking-[-.01em]">
Save and see your changes instantly.
</li>
</ol>
<div className="flex gap-4 items-center flex-col sm:flex-row">
<a
className="rounded-full border border-solid border-transparent transition-colors flex items-center justify-center bg-foreground text-background gap-2 hover:bg-[#383838] dark:hover:bg-[#ccc] font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 sm:w-auto"
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
className="dark:invert"
src="/vercel.svg"
alt="Vercel logomark"
width={20}
height={20}
/>
Deploy now
</a>
<a
className="rounded-full border border-solid border-black/[.08] dark:border-white/[.145] transition-colors flex items-center justify-center hover:bg-[#f2f2f2] dark:hover:bg-[#1a1a1a] hover:border-transparent font-medium text-sm sm:text-base h-10 sm:h-12 px-4 sm:px-5 w-full sm:w-auto md:w-[158px]"
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Read our docs
</a>
</div>
</main>
<footer className="row-start-3 flex gap-[24px] flex-wrap items-center justify-center">
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/file.svg"
alt="File icon"
width={16}
height={16}
/>
Learn
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/window.svg"
alt="Window icon"
width={16}
height={16}
/>
Examples
</a>
<a
className="flex items-center gap-2 hover:underline hover:underline-offset-4"
href="https://nextjs.org?utm_source=create-next-app&utm_medium=appdir-template-tw&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
<Image
aria-hidden
src="/globe.svg"
alt="Globe icon"
width={16}
height={16}
/>
Go to nextjs.org
</a>
</footer>
<div>
<Link href={'/auth'}>Auth</Link><br/>
<Link href={'/menu'}>Menu</Link><br/>
<Link href={'/'}>Index</Link><br/>
</div>
);
}