From f3c43f1725c42325cfc06832deaf61e16d2ef36e Mon Sep 17 00:00:00 2001 From: Nezumi-2711 Date: Wed, 30 Apr 2025 16:41:10 +0700 Subject: [PATCH] feat: implement the layout of the application --- src/app/(home)/about/page.tsx | 7 ++ src/app/(home)/contact/page.tsx | 7 ++ src/app/(home)/features/page.tsx | 7 ++ src/app/(home)/footer.tsx | 11 +++ src/app/(home)/layout.tsx | 22 ++++++ src/app/(home)/navbar-sidebar.tsx | 65 ++++++++++++++++ src/app/(home)/navbar.tsx | 120 ++++++++++++++++++++++++++++++ src/app/(home)/page.tsx | 7 ++ src/app/(home)/pricing/page.tsx | 7 ++ src/app/page.tsx | 9 --- src/components/ui/checkbox.tsx | 1 + src/components/ui/progress.tsx | 2 +- src/components/ui/textarea.tsx | 4 +- 13 files changed, 257 insertions(+), 12 deletions(-) create mode 100644 src/app/(home)/about/page.tsx create mode 100644 src/app/(home)/contact/page.tsx create mode 100644 src/app/(home)/features/page.tsx create mode 100644 src/app/(home)/footer.tsx create mode 100644 src/app/(home)/layout.tsx create mode 100644 src/app/(home)/navbar-sidebar.tsx create mode 100644 src/app/(home)/navbar.tsx create mode 100644 src/app/(home)/page.tsx create mode 100644 src/app/(home)/pricing/page.tsx delete mode 100644 src/app/page.tsx diff --git a/src/app/(home)/about/page.tsx b/src/app/(home)/about/page.tsx new file mode 100644 index 0000000..4765de8 --- /dev/null +++ b/src/app/(home)/about/page.tsx @@ -0,0 +1,7 @@ +const AboutPage = () => { + return ( +
AboutPage
+ ) +} + +export default AboutPage \ No newline at end of file diff --git a/src/app/(home)/contact/page.tsx b/src/app/(home)/contact/page.tsx new file mode 100644 index 0000000..16e4821 --- /dev/null +++ b/src/app/(home)/contact/page.tsx @@ -0,0 +1,7 @@ +const ContactPage = () => { + return ( +
Contact Page
+ ) +} + +export default ContactPage \ No newline at end of file diff --git a/src/app/(home)/features/page.tsx b/src/app/(home)/features/page.tsx new file mode 100644 index 0000000..76e3ef4 --- /dev/null +++ b/src/app/(home)/features/page.tsx @@ -0,0 +1,7 @@ +const FeaturesPage = () => { + return ( +
FeaturesPage
+ ) +} + +export default FeaturesPage \ No newline at end of file diff --git a/src/app/(home)/footer.tsx b/src/app/(home)/footer.tsx new file mode 100644 index 0000000..28c4202 --- /dev/null +++ b/src/app/(home)/footer.tsx @@ -0,0 +1,11 @@ +const Footer = () => { + return ( + + ) +} + +export default Footer \ No newline at end of file diff --git a/src/app/(home)/layout.tsx b/src/app/(home)/layout.tsx new file mode 100644 index 0000000..6fa6f14 --- /dev/null +++ b/src/app/(home)/layout.tsx @@ -0,0 +1,22 @@ +import { ReactNode } from 'react'; + +import Navbar from './navbar'; +import Footer from './footer'; + +interface LayoutProps { + children: ReactNode; +} + +const Layout = ({ children }: LayoutProps) => { + return ( +
+ + +
{children}
+ +
+
+ ); +}; + +export default Layout; diff --git a/src/app/(home)/navbar-sidebar.tsx b/src/app/(home)/navbar-sidebar.tsx new file mode 100644 index 0000000..2654b22 --- /dev/null +++ b/src/app/(home)/navbar-sidebar.tsx @@ -0,0 +1,65 @@ +import { ScrollArea } from '@/components/ui/scroll-area'; +import { + Sheet, + SheetContent, + SheetHeader, + SheetTitle, +} from '@/components/ui/sheet'; +import Link from 'next/link'; +import { ReactNode } from 'react'; + +interface NavbarItem { + href: string; + children: ReactNode; +} + +interface Props { + items: NavbarItem[]; + open: boolean; + onOpenChange: (open: boolean) => void; +} + +const NavbarSidebar = ({ items, open, onOpenChange }: Props) => { + return ( + + + + Menu + + + + {items.map((item) => ( + onOpenChange(false)} + > + {item.children} + + ))} + +
+ onOpenChange(false)} + > + Log in + + + onOpenChange(false)} + > + Start Selling + +
+
+
+
+ ); +}; + +export default NavbarSidebar; diff --git a/src/app/(home)/navbar.tsx b/src/app/(home)/navbar.tsx new file mode 100644 index 0000000..5635cce --- /dev/null +++ b/src/app/(home)/navbar.tsx @@ -0,0 +1,120 @@ +'use client'; + +import { ReactNode, useState } from 'react'; +import Link from 'next/link'; +import { Poppins } from 'next/font/google'; +import { MenuIcon } from 'lucide-react'; +import { usePathname } from 'next/navigation'; + +import { cn } from '@/lib/utils'; +import { Button } from '@/components/ui/button'; + +import NavbarSidebar from './navbar-sidebar'; + +const poppins = Poppins({ + subsets: ['latin'], + weight: ['700'], +}); + +interface NavbarItemProps { + href: string; + children: ReactNode; + isActive?: boolean; +} + +const navbarItems = [ + { + href: '/', + children: 'Home', + }, + { + href: '/about', + children: 'About', + }, + { + href: '/features', + children: 'Features', + }, + { + href: '/pricing', + children: 'Pricing', + }, + { + href: '/contact', + children: 'Contact', + }, +]; + +const NavbarItem = ({ href, children, isActive }: NavbarItemProps) => { + return ( + + ); +}; + +const Navbar = () => { + const pathname = usePathname(); + const [isSidebarOpen, setIsSidebarOpen] = useState(false); + + return ( + + ); +}; + +export default Navbar; diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx new file mode 100644 index 0000000..6656093 --- /dev/null +++ b/src/app/(home)/page.tsx @@ -0,0 +1,7 @@ +export default function Home() { + return ( +
+ Home page +
+ ); +} diff --git a/src/app/(home)/pricing/page.tsx b/src/app/(home)/pricing/page.tsx new file mode 100644 index 0000000..338b2f0 --- /dev/null +++ b/src/app/(home)/pricing/page.tsx @@ -0,0 +1,7 @@ +const PricingPage = () => { + return ( +
PricingPage
+ ) +} + +export default PricingPage \ No newline at end of file diff --git a/src/app/page.tsx b/src/app/page.tsx deleted file mode 100644 index 61e4e89..0000000 --- a/src/app/page.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { Button } from "@/components/ui/button"; - -export default function Home() { - return ( -
- -
- ); -} diff --git a/src/components/ui/checkbox.tsx b/src/components/ui/checkbox.tsx index fa0e4b5..bf9fc76 100644 --- a/src/components/ui/checkbox.tsx +++ b/src/components/ui/checkbox.tsx @@ -15,6 +15,7 @@ function Checkbox({ data-slot="checkbox" className={cn( "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50", + "bg-white", className )} {...props} diff --git a/src/components/ui/progress.tsx b/src/components/ui/progress.tsx index 9d9ba2f..cddb96b 100644 --- a/src/components/ui/progress.tsx +++ b/src/components/ui/progress.tsx @@ -15,7 +15,7 @@ function Progress({ data-slot="progress" className={cn( "relative h-3 w-full overflow-hidden rounded-full", - "border bg-transparent", + "border bg-white", className )} {...props} diff --git a/src/components/ui/textarea.tsx b/src/components/ui/textarea.tsx index d995988..d031971 100644 --- a/src/components/ui/textarea.tsx +++ b/src/components/ui/textarea.tsx @@ -7,8 +7,8 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {