-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Styling , layout changes and many other interface changes.
Update: new Prisma migration.
- Loading branch information
1 parent
ca4b3ec
commit 85ab8b1
Showing
9 changed files
with
127 additions
and
47 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,86 @@ | ||
import { Nav, NavLink } from "@/components/Nav"; | ||
|
||
import { MobileNav, Nav, NavItem, NavLink } from "@/components/Nav"; | ||
export const dynamic = "force-dynamic"; | ||
|
||
import { | ||
Sheet, | ||
SheetContent, | ||
SheetDescription, | ||
SheetHeader, | ||
SheetTitle, | ||
SheetTrigger, | ||
} from "@/components/ui/sheet"; | ||
import { sign } from "crypto"; | ||
import { Menu, ShoppingCart } from "lucide-react"; | ||
|
||
export default function Layout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
// Define the nav items, some with href (NavLink) and some without (NavItem) | ||
const navItems = [ | ||
{ name: "Home", href: "/" }, | ||
{ name: "Products", href: "/products" }, | ||
{ name: "My orders", href: "/orders" }, | ||
{ name: "Sign In", href: "/sign-in" }, | ||
{ name: "Logout" }, // No href for NavItem | ||
{ name: "Cart (0)" }, // No href for NavItem | ||
]; | ||
|
||
return ( | ||
<div className="sm:flex sm:flex-row sm:min-h-screen relative"> | ||
{/* Large screen nav */} | ||
<Nav> | ||
<NavLink href="/">Home</NavLink> | ||
<NavLink href="/products">Products</NavLink> | ||
<NavLink href="/orders">My orders</NavLink> | ||
<NavLink href="/sign-in">Sign In</NavLink> | ||
{navItems.map((item) => | ||
item.href ? ( | ||
<NavLink key={item.href} href={item.href}> | ||
{item.name} | ||
</NavLink> | ||
) : ( | ||
<NavItem key={item.name}>{item.name}</NavItem> | ||
) | ||
)} | ||
</Nav> | ||
|
||
<div> | ||
<div className="flex justify-between"> | ||
<Sheet> | ||
<SheetTrigger className="text-xl">Open</SheetTrigger> | ||
<SheetContent side="left" className="max-w-40"> | ||
<SheetHeader> | ||
<SheetTitle>Are you absolutely sure?</SheetTitle> | ||
<SheetDescription> | ||
This action cannot be undone. This will permanently delete your | ||
account and remove your data from our servers. | ||
</SheetDescription> | ||
</SheetHeader> | ||
</SheetContent> | ||
</Sheet> | ||
{/* Mobile sheet nav */} | ||
<MobileNav> | ||
<Sheet> | ||
<SheetTrigger className="text-xl"> | ||
<Menu size={40} /> | ||
</SheetTrigger> | ||
<SheetContent side="left" className="max-w-40 flex flex-col p-0"> | ||
<SheetTitle className="text-center mt-20"> | ||
<span aria-hidden></span> | ||
</SheetTitle> | ||
{navItems.map((item) => | ||
item.href ? ( | ||
<NavLink key={item.href} href={item.href}> | ||
{item.name} | ||
</NavLink> | ||
) : ( | ||
<NavItem key={item.name}>{item.name}</NavItem> | ||
) | ||
)} | ||
</SheetContent> | ||
</Sheet> | ||
|
||
<Sheet> | ||
<SheetTrigger className="text-xl">Open</SheetTrigger> | ||
<SheetContent side="right" className="max-w-48"> | ||
<SheetHeader> | ||
<SheetTitle>Are you absolutely sure?</SheetTitle> | ||
<SheetDescription> | ||
This action cannot be undone. This will permanently delete your | ||
account and remove your data from our servers. | ||
</SheetDescription> | ||
</SheetHeader> | ||
</SheetContent> | ||
</Sheet> | ||
</div> | ||
</div> | ||
<Sheet> | ||
<SheetTrigger className="text-xl relative"> | ||
<ShoppingCart size={40} /> | ||
<p className="absolute top-2.5 right-3 text-xs">0</p> | ||
</SheetTrigger> | ||
<SheetContent side="right" className="max-w-72"> | ||
<SheetHeader> | ||
<SheetTitle>Are you absolutely sure?</SheetTitle> | ||
<p> | ||
This action cannot be undone. This will permanently delete your | ||
account and remove your data from our servers. | ||
</p> | ||
</SheetHeader> | ||
</SheetContent> | ||
</Sheet> | ||
</MobileNav> | ||
|
||
<div className="sm:ml-56 flex-1 container py-6">{children}</div> | ||
{/* Page content */} | ||
<div className="sm:ml-32 md:ml-40 flex-1 container py-6">{children}</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function ProductViewPage() { | ||
return <div></div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters