mobile styles

This commit is contained in:
2025-06-29 20:02:22 -04:00
parent bd63eac8d0
commit 6efc29c669
4 changed files with 42 additions and 52 deletions

View File

@@ -1,60 +1,53 @@
import AddFirstGuestBookEntryClient from '@/components/AddFirstGuestBookEntryClient'
import AddGuestBookEntryModal from '@/components/AddGuestBookEntryModal'
import CreateEventClient from '@/components/CreateEventClient'
import DashboardNavbar from '@/components/DashboardNavbar'
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 guestBookEntries = await queries.fetchGuestBookEntries(5);
const session = await getServerSession();
const user = await prisma.user.findUnique({
where: { email: session?.user.email }
})
return (
<div className='grid grid-cols-7 gap-4'>
<div className='col-span-5 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>
<CreateEventClient />
</div>
{!events.length && <>You don&apos;t have any events yet. Create your first event.</>}
<div className='grid grid-cols-3'>
{events.map((item) => (
<EventInfoQuickView key={item.id} {...item} />
))}
</div>
<div className='grid grid-cols-1 md:grid-cols-7 gap-4'>
<div className='md:col-span-5 md:row-span-3 bg-[#00000008] rounded-xl p-4 md:p-6 relative'>
<div>
<div className='w-full flex items-center justify-between'>
<h2 className='text-lg font-semibold py-4'>Your Events</h2>
<CreateEventClient />
</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-6 col-span-2 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.length && <AddFirstGuestBookEntryClient />}
{guestBookEntries.map(entry => (
<GuestBookQuickView key={entry.id} {...entry} />
{!events.length && <>You don&apos;t have any events yet. Create your first event.</>}
<div className='grid grid-cols-1 md:grid-cols-3'>
{events.map((item) => (
<EventInfoQuickView key={item.id} {...item} />
))}
</div>
</div>
<div className='w-full text-right mt-2'>
<Link href={'/events'} className='md:absolute bottom-4 right-4 text-sm text-brand-primary-400 hover:underline'>
View all
</Link>
</div>
</div>
<div className='md:row-span-5 md:col-start-6 col-span-2 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.length && <AddFirstGuestBookEntryClient />}
{guestBookEntries.map(entry => (
<GuestBookQuickView key={entry.id} {...entry} />
))}
</div>
</div>
</div>
)
}

View File

@@ -1,7 +1,6 @@
'use client'
import { SessionProvider } from 'next-auth/react'
import { redirect } from 'next/navigation'
import { ReactNode } from 'react'
import DashboardNavbar from '@/components/DashboardNavbar'
@@ -10,10 +9,10 @@ export default function AuthLayout({ children }: { children: ReactNode }) {
return (
<>
<SessionProvider>
<main className="p-4 max-w-[100rem] mx-auto">
<div className='grid grid-cols-5 gap-4'>
<main className="p-4 max-w-[100rem] mx-auto relative">
<div className='grid grid-cols-1 md:grid-cols-5 gap-4'>
<DashboardNavbar />
<section className="col-span-4">
<section className="md:col-span-4 mt-16 md:mt-0">
{children}
</section>
</div>