added adminbar to layout

This commit is contained in:
2025-10-10 13:35:09 -04:00
parent d8fbcbbf4d
commit 8bf4c7516f
13 changed files with 157 additions and 17 deletions

View File

@@ -3,9 +3,8 @@ import Image from 'next/image'
import { getPayload } from 'payload'
import type { Payload } from 'payload'
import React from 'react'
import { fileURLToPath } from 'url'
import config from '@/payload.config'
import config from '@/src/payload.config'
import './styles.css'
import { RichText } from '@payloadcms/richtext-lexical/react'
@@ -15,8 +14,6 @@ export default async function HomePage() {
const payload = await getPayload({ config: payloadConfig })
const { user } = await payload.auth({ headers })
const fileURL = `vscode://file/${fileURLToPath(import.meta.url)}`
const homePage = await payload.find({
collection: 'pages',
where: {
@@ -28,8 +25,6 @@ export default async function HomePage() {
const page = homePage.docs?.[0]
console.log(page)
return (
<div className="home">
<div className="content">
@@ -53,7 +48,7 @@ export default async function HomePage() {
/>
</picture>
{!user && <h1>Welcome to your new project.</h1>}
{user && <h1>Welcome back, {user.email}</h1>}
{user && <h1>Welcome back, {user.name}</h1>}
<div className="links">
<a
className="admin"
@@ -75,9 +70,7 @@ export default async function HomePage() {
</div>
<div className="footer">
<p>Update this page by editing</p>
<a className="codeLink" href={fileURL}>
<code>app/(frontend)/page.tsx</code>
</a>
<code>app/(frontend)/page.tsx</code>
</div>
</div>
)