From d07baa77bf48af44d6b6a97cb2ab2252f0c9d1f4 Mon Sep 17 00:00:00 2001 From: Rui Sousa Date: Tue, 8 Oct 2024 16:27:45 +0100 Subject: [PATCH] fix errors --- src/app/(pages)/[slug]/page.tsx | 40 +++++++------- src/app/(pages)/[slug]/staticHome.ts | 55 ------------------- src/app/_blocks/AuthorContentGrid/index.tsx | 2 +- src/app/_blocks/EpisodeContent/index.tsx | 2 +- .../_blocks/EpisodeHead/AudioPlayer/index.tsx | 2 +- src/app/_blocks/EpisodeHead/index.tsx | 36 ++++++------ src/app/_components/ArchiveButton/index.tsx | 8 +-- src/app/_components/AuthorPill/index.tsx | 28 ++++++---- src/app/_components/BackButton/index.tsx | 2 +- src/app/_components/ContentCard/index.tsx | 13 ++--- src/app/_components/MiniContentCard/index.tsx | 2 +- src/app/_components/PostSummary/index.tsx | 2 +- src/app/_icons/icons.tsx | 32 ++++++++--- src/app/_icons/socialIcons.tsx | 55 +++++++++++-------- tsconfig.json | 2 +- 15 files changed, 127 insertions(+), 154 deletions(-) delete mode 100644 src/app/(pages)/[slug]/staticHome.ts diff --git a/src/app/(pages)/[slug]/page.tsx b/src/app/(pages)/[slug]/page.tsx index b854bbc..8e80cb2 100644 --- a/src/app/(pages)/[slug]/page.tsx +++ b/src/app/(pages)/[slug]/page.tsx @@ -40,23 +40,23 @@ export default async function Page({ params: { slug = 'home' } }) { ) } -export async function generateMetadata({ params: { slug = 'home' } }): Promise { - const { isEnabled: isDraftMode } = draftMode() - - let page: Page | null = null - - try { - page = await fetchDoc({ - collection: 'pages', - slug, - draft: isDraftMode, - }) - } catch (error) { - // don't throw an error if the fetch fails - // this is so that we can render static fallback pages for the demo - // when deploying this template on Payload Cloud, this page needs to build before the APIs are live - // in production you may want to redirect to a 404 page or at least log the error somewhere - } - - return generateMeta({ doc: page }) -} +// export async function generateMetadata({ params: { slug = 'home' } }): Promise { +// const { isEnabled: isDraftMode } = draftMode() +// +// let page: Page | null = null +// +// try { +// page = await fetchDoc({ +// collection: 'pages', +// slug, +// draft: isDraftMode, +// }) +// } catch (error) { +// // don't throw an error if the fetch fails +// // this is so that we can render static fallback pages for the demo +// // when deploying this template on Payload Cloud, this page needs to build before the APIs are live +// // in production you may want to redirect to a 404 page or at least log the error somewhere +// } +// +// return generateMeta({ doc: page }) +// } diff --git a/src/app/(pages)/[slug]/staticHome.ts b/src/app/(pages)/[slug]/staticHome.ts deleted file mode 100644 index 85572b1..0000000 --- a/src/app/(pages)/[slug]/staticHome.ts +++ /dev/null @@ -1,55 +0,0 @@ -import type { Page } from '../payload-types' - -export const staticHome: Page = { - id: '', - title: 'Home', - slug: 'home', - createdAt: '', - updatedAt: '', - meta: { - title: 'Payload Website Template', - description: 'An open-source website built with Payload and Next.js.', - }, - hero: { - type: 'lowImpact', - links: null, - richText: [ - { - children: [ - { - text: 'Payload Website Template', - }, - ], - type: 'h1', - }, - ], - media: '', - }, - layout: [ - { - richText: [ - { - children: [ - { - text: 'There is nothing here for the moment. Go to dashboard and create some pages.', - }, - ], - type: 'h4', - }, - ], - links: [ - { - link: { - type: 'custom', - url: '/admin', - label: 'Go to dashboard', - appearance: 'primary', - reference: null, - }, - }, - ], - blockName: 'CTA', - blockType: 'cta', - }, - ], -} diff --git a/src/app/_blocks/AuthorContentGrid/index.tsx b/src/app/_blocks/AuthorContentGrid/index.tsx index 7f0a9a8..36d1ea3 100644 --- a/src/app/_blocks/AuthorContentGrid/index.tsx +++ b/src/app/_blocks/AuthorContentGrid/index.tsx @@ -14,7 +14,7 @@ export default function AuthorContentGrid({ content: { Blogposts: Blogpost[] PodcastEpisodes: PodcastEpisode[] - CasteStudies: CaseStudy[] + CaseStudies: CaseStudy[] TalksAndRoundtables: TalksAndRoundtable[] } }) { diff --git a/src/app/_blocks/EpisodeContent/index.tsx b/src/app/_blocks/EpisodeContent/index.tsx index 6cc17b2..926d2aa 100644 --- a/src/app/_blocks/EpisodeContent/index.tsx +++ b/src/app/_blocks/EpisodeContent/index.tsx @@ -31,7 +31,7 @@ export default function EpisodeContent({ episode }: { episode: PodcastEpisode }) {/* Share/Category Column */}
-
+
diff --git a/src/app/_blocks/EpisodeHead/AudioPlayer/index.tsx b/src/app/_blocks/EpisodeHead/AudioPlayer/index.tsx index a2d9eed..133b4b7 100644 --- a/src/app/_blocks/EpisodeHead/AudioPlayer/index.tsx +++ b/src/app/_blocks/EpisodeHead/AudioPlayer/index.tsx @@ -2,7 +2,7 @@ const AudioPlayer: React.FC<{ src: string; type: string }> = ({ src, type }) => { return ( -
+