added adminbar to layout
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import React from 'react'
|
||||
import './styles.css'
|
||||
import { AdminBar } from '@/src/components/AdminBar'
|
||||
|
||||
export const metadata = {
|
||||
description: 'A blank template using Payload in a Next.js app.',
|
||||
@@ -12,6 +13,7 @@ export default async function RootLayout(props: { children: React.ReactNode }) {
|
||||
return (
|
||||
<html lang="en">
|
||||
<body>
|
||||
<AdminBar />
|
||||
<main>{children}</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
|
||||
@@ -22,6 +22,7 @@ import { StrikethroughFeatureClient as StrikethroughFeatureClient_e70f5e05f09f93
|
||||
import { UnderlineFeatureClient as UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||
import { BoldFeatureClient as BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||
import { ItalicFeatureClient as ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864 } from '@payloadcms/richtext-lexical/client'
|
||||
import { SlugField as SlugField_3817bf644402e67bfe6577f60ef982de } from '@payloadcms/ui'
|
||||
|
||||
export const importMap = {
|
||||
"@payloadcms/richtext-lexical/rsc#RscEntryLexicalCell": RscEntryLexicalCell_44fe37237e0ebf4470c9990d8cb7b07e,
|
||||
@@ -47,5 +48,6 @@ export const importMap = {
|
||||
"@payloadcms/richtext-lexical/client#StrikethroughFeatureClient": StrikethroughFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||
"@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||
"@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||
"@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864
|
||||
"@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_e70f5e05f09f93e00b997edb1ef0c864,
|
||||
"@payloadcms/ui#SlugField": SlugField_3817bf644402e67bfe6577f60ef982de
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user