Use base layout and style
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
tobias 2024-06-24 08:47:53 +02:00
parent d6fe6446a5
commit f558be2bcd
6 changed files with 25 additions and 34 deletions

View File

@ -1,25 +1,16 @@
import React from 'react' import React from 'react'
import './global.css' import './global.css'
/* import { Inter } from 'next/font/google'
const inter = Inter({ import Header from '@/components/Header'
subsets: ['latin'], import Footer from '@/components/Footer'
display: 'swap',
})
*/
/* Our app sits here to not cause any conflicts with payload's root layout */
const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => { const Layout: React.FC<{ children: React.ReactNode }> = ({ children }) => {
{
/* <html className={inter.className}>
<body>{children}</body>
</html>
*/
}
return ( return (
<html> <html>
<body className="autonomic min-h-screen flex flex-col mx-auto max-w-7xl px-6 text-primary bg-background"> <body className="autonomic min-h-screen flex flex-col mx-auto max-w-7xl px-6 text-primary bg-background">
{children} <Header />
<main className="flex flex-col gap-4 flex-grow">{children}</main>
<Footer />
</body> </body>
</html> </html>
) )

View File

@ -12,8 +12,6 @@ interface Props {}
const Page = (props: Props) => { const Page = (props: Props) => {
return ( return (
<> <>
<main className="flex flex-col gap-4 flex-grow">
<Header />
<h1 className="">Nextload</h1> <h1 className="">Nextload</h1>
<p className="mt-3"> <p className="mt-3">
{`Nextload is a pre-configured setup for Nextjs and PayloadCMS that makes it easy to get started with building your website. With Nextload, you'll have a complete development environment that you can run locally using Docker. This makes it easy to test and develop your website before deploying it to a production environment.`} {`Nextload is a pre-configured setup for Nextjs and PayloadCMS that makes it easy to get started with building your website. With Nextload, you'll have a complete development environment that you can run locally using Docker. This makes it easy to test and develop your website before deploying it to a production environment.`}
@ -23,8 +21,6 @@ const Page = (props: Props) => {
<section className="mt-4"> <section className="mt-4">
<Posts /> <Posts />
</section> </section>
</main>
<Footer />
</> </>
) )
} }

View File

@ -30,7 +30,7 @@ const Page = async ({ params }: PageArgs) => {
depth: 3, depth: 3,
}) })
if (!post) notFound() if (!post) notFound()
return <PostPage post={post} /> return <PostPage post={post} locale="en" />
} }
export default Page export default Page

View File

@ -14,14 +14,14 @@ const AuthorComponent: React.FC<Props> = ({ author }) => {
{typeof author.avatar === 'object' && ( {typeof author.avatar === 'object' && (
<Image <Image
src={author.avatar.url || ''} src={author.avatar.url || ''}
width={150} width={100}
height={150} height={10}
alt={author.avatar.alt || ''} alt={author.avatar.alt || ''}
layout="fixed" layout="fixed"
/> />
)} )}
<div className="flex flex-col"> <div className="flex flex-col">
<h3 className="font-semibold text-base">{author.name}</h3> <h3 className="">{author.name}</h3>
<p className="text-sm font-light">{author.bio}</p> <p className="text-sm font-light">{author.bio}</p>
</div> </div>
</div> </div>

View File

@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import { Post } from 'types/payload-types' import { Post } from 'types/payload-types'
import Blocks from './Blocks' import Blocks from './Blocks'
import Author from './Blocks/Author'
interface Props { interface Props {
post: Post post: Post
@ -11,6 +12,9 @@ export default function PostPage(props: Props) {
return ( return (
<article> <article>
<Blocks blocks={props?.post.blocks} locale="en" /> <Blocks blocks={props?.post.blocks} locale="en" />
{props?.post.author && typeof props?.post.author !== 'string' && (
<Author author={props?.post.author} />
)}
</article> </article>
) )
} }

View File

@ -4,9 +4,9 @@ import deepmerge from 'deepmerge'
import { getDocument } from '@/utils/getDocument' import { getDocument } from '@/utils/getDocument'
import normalizePath from './normalizePath' import normalizePath from './normalizePath'
const defaultTitle = 'Payload SaaS Starter' const defaultTitle = 'Nextload'
const defaultDescription = 'An open-source website built with Payload and Next.js.' const defaultDescription = 'An open-source website built with Payload and Next.js.'
const siteName = 'Payload SaaS Starter' const siteName = 'Nextload'
const defaultOpenGraph: Metadata['openGraph'] = { const defaultOpenGraph: Metadata['openGraph'] = {
type: 'website', type: 'website',