styling friday

This commit is contained in:
2025-06-27 12:01:46 -04:00
parent 29c91fee7f
commit 216d10855f
14 changed files with 309 additions and 67 deletions

View File

@@ -1,15 +1,68 @@
import EventInfoQuickView from '@/components/EventInfoQuickView'
import GuestBookQuickView from '@/components/GuestBookQuickView'
import { prisma } from '@/lib/prisma'
import { queries } from '@/lib/queries'
import { getServerSession } from 'next-auth'
import Link from 'next/link'
import React from 'react'
export default async function DashboardPage() {
const events = await queries.fetchEvents()
const events = await queries.fetchEvents();
const guestBookEntries = await queries.fetchGuestBookEntries(5);
const session = await getServerSession()
const user = await prisma.user.findUnique({
where: { email: session?.user.email }
})
// console.log(events)
return (
<div>
<h1 className='text-2xl font-bold'>Dashboard</h1>
<div className='border rounded-lg max-w-6xl mx-auto p-6 space-y-4'>
<div className='max-w-[100rem] mx-auto'>
<div className='grid grid-cols-5 grid-rows-5 gap-4'>
<div className='row-span-5 bg-[#00000008] rounded-xl p-6'>
<div className='py-4'>
<h2 className='text-lg font-semibold'>Hello, {user?.username}</h2>
</div>
<div className='bg-brand-primary-800 p-4 rounded-lg'>Overview</div>
</div>
<div className='col-span-3 row-span-3 bg-[#00000008] rounded-xl p-6 relative'>
<div>
<div className='w-full flex items-center justify-between'>
<h2 className='text-lg font-semibold py-4'>Your Events</h2>
<button
className='btn btn-primary h-fit'
>
Create Event
</button>
</div>
<div className='grid grid-cols-3'>
{events.map((item) => (
<EventInfoQuickView key={item.id} {...item} />
))}
</div>
</div>
<Link href={'/events'} className='absolute bottom-4 right-4 text-sm text-brand-primary-400 hover:underline'>
View all
</Link>
</div>
<div className='row-span-5 col-start-5 bg-[#00000008] rounded-xl p-6'>
<div className='py-4 flex justify-between'>
<h2 className='text-lg font-semibold'>Guest Book</h2>
<Link
href={'/guest-book'}
className='hover:cursor-pointer hover:underline text-brand-primary-500'
>
View All
</Link>
</div>
<div className='space-y-2'>
{guestBookEntries.map(entry => (
<GuestBookQuickView key={entry.id} {...entry} />
))}
</div>
</div>
</div>
{/* <div className='border rounded-lg max-w-6xl mx-auto p-6 space-y-4'>
<h2 className='text-xl font-bold'>Your Events</h2>
{events.map((item) => (
<Link key={item.id} href={`/events/${item.id}`} >
@@ -30,7 +83,7 @@ export default async function DashboardPage() {
>
See all events
</Link>
</div>
</div> */}
</div>
)
}

View File

@@ -8,13 +8,13 @@ export default async function UserPage({ params }: { params: { username: string
const username = raw.startsWith('@') ? raw.slice(1) : raw
const user = await prisma.user.findUnique({
where: { username },
select: {
id: true,
email: true,
name: true,
role: true,
createdAt: true,
where: { username },
select: {
id: true,
email: true,
name: true,
role: true,
createdAt: true,
},
})

View File

@@ -2,7 +2,61 @@
@theme {
--color-background: #fff5eb;
--color-text: #141d31;
--color-brand-text-50: rgb(15, 13, 10);
--color-brand-text-100: rgb(30, 27, 21);
--color-brand-text-200: rgb(60, 53, 42);
--color-brand-text-300: rgb(90, 80, 63);
--color-brand-text-400: rgb(120, 106, 84);
--color-brand-text-500: rgb(150, 133, 105);
--color-brand-text-600: rgb(171, 157, 135);
--color-brand-text-700: rgb(192, 182, 165);
--color-brand-text-800: rgb(213, 206, 195);
--color-brand-text-900: rgb(234, 231, 225);
--color-brand-text-950: rgb(245, 243, 240);
--color-brand-background-50: rgb(9, 14, 17);
--color-brand-background-100: rgb(18, 28, 33);
--color-brand-background-200: rgb(36, 56, 66);
--color-brand-background-300: rgb(54, 84, 99);
--color-brand-background-400: rgb(71, 112, 133);
--color-brand-background-500: rgb(89, 140, 166);
--color-brand-background-600: rgb(122, 163, 184);
--color-brand-background-700: rgb(156, 186, 201);
--color-brand-background-800: rgb(189, 209, 219);
--color-brand-background-900: rgb(222, 232, 237);
--color-brand-background-950: rgb(238, 244, 246);
--color-brand-primary-50: rgb(7, 11, 18);
--color-brand-primary-100: rgb(15, 22, 36);
--color-brand-primary-200: rgb(29, 44, 73);
--color-brand-primary-300: rgb(44, 67, 109);
--color-brand-primary-400: rgb(58, 89, 146);
--color-brand-primary-500: rgb(73, 111, 182);
--color-brand-primary-600: rgb(109, 140, 197);
--color-brand-primary-700: rgb(146, 169, 211);
--color-brand-primary-800: rgb(182, 197, 226);
--color-brand-primary-900: rgb(219, 226, 240);
--color-brand-primary-950: rgb(237, 241, 248);
/*
--color-brand-secondary-50: rgb(9, 17, 9);
--color-brand-secondary-100: rgb(18, 33, 18);
--color-brand-secondary-200: rgb(35, 67, 36);
--color-brand-secondary-300: rgb(53, 100, 54);
--color-brand-secondary-400: rgb(70, 134, 72);
--color-brand-secondary-500: rgb(88, 167, 91);
--color-brand-secondary-600: rgb(121, 185, 123);
--color-brand-secondary-700: rgb(155, 202, 156);
--color-brand-secondary-800: rgb(188, 220, 189);
--color-brand-secondary-900: rgb(222, 237, 222);
--color-brand-secondary-950: rgb(238, 246, 239); */
--color-brand-text: rgb(87, 77, 61);
--color-brand-background: rgb(242, 246, 248);
--color-brand-primary:rgb(134, 159, 207);
/* --color-brand-secondary: #8ac18c;
--color-brand-accent: #e9e154; */
}
/* @theme light {
@@ -13,4 +67,12 @@
@theme dark {
--color-background: #141d31;
--color-text: #fff5eb;
} */
} */
.btn {
@apply border px-4 py-2 rounded-lg hover:cursor-pointer transition-colors duration-300
}
.btn-primary{
@apply bg-brand-primary text-brand-background border-0 hover:bg-brand-primary-500 transition-colors duration-300
}

View File

@@ -15,7 +15,7 @@ export default async function RootLayout({
return (
<html lang="en">
<body
className="bg-background text-text"
className="bg-brand-background text-brand-text"
>
{children}
</body>