Add about page
This commit is contained in:
@ -524,6 +524,15 @@ model TermsOfService {
|
||||
version Int @default(autoincrement())
|
||||
}
|
||||
|
||||
model About {
|
||||
id String @id @default(cuid())
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
markdown String
|
||||
version Int @default(autoincrement())
|
||||
}
|
||||
|
||||
model User {
|
||||
id String @id
|
||||
name String
|
||||
|
||||
16
src/app/(normal)/about/page.tsx
Normal file
16
src/app/(normal)/about/page.tsx
Normal file
@ -0,0 +1,16 @@
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import ReactMarkdown from "react-markdown";
|
||||
|
||||
export default async function AboutPage() {
|
||||
const about = await prisma.about.findFirst({
|
||||
orderBy: [{ version: "desc" }],
|
||||
});
|
||||
|
||||
return (
|
||||
<div className="mx-auto w-full max-w-6xl px-4 py-8">
|
||||
<div className="markdown text-center">
|
||||
<ReactMarkdown>{about?.markdown}</ReactMarkdown>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@ -68,6 +68,11 @@ export default function AnimalStudiesGallery({
|
||||
maxRowItems={5}
|
||||
maxRowItemsMobile={1}
|
||||
gap={12}
|
||||
gapBreakpoints={[
|
||||
{ maxWidth: 685, gap: 6 },
|
||||
{ maxWidth: 910, gap: 8 },
|
||||
{ maxWidth: 1130, gap: 10 },
|
||||
]}
|
||||
onLoadMore={done ? undefined : () => void loadMore()}
|
||||
hasMore={!done}
|
||||
isLoadingMore={loading}
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
"use client"
|
||||
|
||||
import { NavigationMenu, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, navigationMenuTriggerStyle } from "@/components/ui/navigation-menu";
|
||||
import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, navigationMenuTriggerStyle } from "@/components/ui/navigation-menu";
|
||||
import { Menu } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { useState } from "react";
|
||||
@ -8,17 +8,20 @@ import { Button } from "../ui/button";
|
||||
import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from "../ui/sheet";
|
||||
|
||||
const links = [
|
||||
{ href: "/", label: "Home" },
|
||||
{ href: "/artworks", label: "Portfolio" },
|
||||
{ type: "link" as const, href: "/", label: "Home" },
|
||||
{ type: "link" as const, href: "/artworks", label: "Portfolio" },
|
||||
{
|
||||
type: "dropdown" as const,
|
||||
label: "Categories",
|
||||
items: [
|
||||
{ href: "/artworks/animalstudies", label: "Animal Studies" },
|
||||
{ href: "/commissions", label: "Commissions" },
|
||||
{ href: "/commissions/status", label: "Commission Status" },
|
||||
{ href: "/tos", label: "Terms of Service" },
|
||||
// { href: "/portfolio/artfight", label: "Artfight" },
|
||||
// { href: "/portfolio/minis", label: "Miniatures" },
|
||||
// { href: "/commissions", label: "Commissions" },
|
||||
// { href: "/ych", label: "YCH / Custom offers" },
|
||||
// { href: "/todo", label: "todo (temp)" },
|
||||
{ href: "/artworks/artfight", label: "Artfight" }
|
||||
],
|
||||
},
|
||||
{ type: "link" as const, href: "/commissions", label: "Commissions" },
|
||||
{ type: "link" as const, href: "/commissions/status", label: "Commission Status" },
|
||||
{ type: "link" as const, href: "/tos", label: "Terms of Service" },
|
||||
{ type: "link" as const, href: "/about", label: "About Me" },
|
||||
]
|
||||
|
||||
export default function TopNav() {
|
||||
@ -28,18 +31,41 @@ export default function TopNav() {
|
||||
<div className="w-full flex items-center justify-between">
|
||||
{/* Desktop Nav */}
|
||||
<div className="hidden md:flex">
|
||||
<NavigationMenu>
|
||||
<NavigationMenu viewport={false} delayDuration={0} skipDelayDuration={0}>
|
||||
<NavigationMenuList>
|
||||
{links.map(({ href, label }) => (
|
||||
<NavigationMenuItem key={href}>
|
||||
{links.map((item) => {
|
||||
if (item.type === "dropdown") {
|
||||
return (
|
||||
<NavigationMenuItem key={item.label}>
|
||||
<NavigationMenuTrigger className="hover:bg-hover data-[state=open]:bg-hover">
|
||||
{item.label}
|
||||
</NavigationMenuTrigger>
|
||||
<NavigationMenuContent>
|
||||
<ul className="min-w-48">
|
||||
{item.items.map(({ href, label }) => (
|
||||
<li key={href}>
|
||||
<NavigationMenuLink asChild className="w-full hover:bg-hover">
|
||||
<Link href={href}>{label}</Link>
|
||||
</NavigationMenuLink>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</NavigationMenuContent>
|
||||
</NavigationMenuItem>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<NavigationMenuItem key={item.href}>
|
||||
<NavigationMenuLink
|
||||
asChild
|
||||
className={`${navigationMenuTriggerStyle()} hover:bg-hover data-active:bg-hover focus:bg-hover active:bg-hover`}
|
||||
>
|
||||
<Link href={href}>{label}</Link>
|
||||
<Link href={item.href}>{item.label}</Link>
|
||||
</NavigationMenuLink>
|
||||
</NavigationMenuItem>
|
||||
))}
|
||||
);
|
||||
})}
|
||||
</NavigationMenuList>
|
||||
</NavigationMenu>
|
||||
</div>
|
||||
@ -56,7 +82,15 @@ export default function TopNav() {
|
||||
<SheetTitle className="text-lg">Navigation</SheetTitle>
|
||||
</SheetHeader>
|
||||
<nav className="mt-4 flex flex-col gap-2">
|
||||
{links.map(({ href, label }) => (
|
||||
{links.map((item) => {
|
||||
if (item.type === "dropdown") {
|
||||
return (
|
||||
<div key={item.label} className="px-2">
|
||||
<div className="px-2 py-1 text-xs uppercase tracking-wide text-muted-foreground">
|
||||
{item.label}
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
{item.items.map(({ href, label }) => (
|
||||
<Link
|
||||
key={href}
|
||||
href={href}
|
||||
@ -67,6 +101,23 @@ export default function TopNav() {
|
||||
{label}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<Link
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
onClick={() => setOpen(false)}
|
||||
className="block px-4 py-2 rounded-md text-sm font-medium transition-colors
|
||||
focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
||||
>
|
||||
{item.label}
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
</nav>
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import * as React from "react"
|
||||
import { Slot } from "@radix-ui/react-slot"
|
||||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
import type * as React from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user