diff --git a/src/blocks/BeforeFooter.ts b/src/blocks/BeforeFooter.ts index 5f25cdf..76f475b 100644 --- a/src/blocks/BeforeFooter.ts +++ b/src/blocks/BeforeFooter.ts @@ -2,6 +2,7 @@ import { Block } from "payload"; export const BeforeFooterBlock: Block = { slug: "beforeFooterBlock", + labels: { plural: "Call To Action", singular: "Call To Action" }, fields: [ { name: "title", diff --git a/src/blocks/Content.ts b/src/blocks/Content.ts index 0314635..fed61d9 100644 --- a/src/blocks/Content.ts +++ b/src/blocks/Content.ts @@ -3,6 +3,7 @@ import { Block } from "payload"; export const ContentBlock: Block = { slug: "contentBlock", + labels: { plural: "Contents", singular: "Content" }, fields: [ { name: "content", diff --git a/src/blocks/HorizontalImageContent.ts b/src/blocks/HorizontalImageContent.ts new file mode 100644 index 0000000..a54a0d6 --- /dev/null +++ b/src/blocks/HorizontalImageContent.ts @@ -0,0 +1,21 @@ +import { lexicalEditor } from "@payloadcms/richtext-lexical"; +import { Block } from "payload"; + +export const HorizontalImageContentBlock: Block = { + slug: "horizontalImageContentBlock", + labels: { plural: "Horizontal Image & Content", singular: "Horizontal Image & Content" }, + fields: [ + { + name: "img", + type: "upload", + relationTo: "media", + required: true, + }, + { + name: "content", + type: "richText", + editor: lexicalEditor({}), + required: true, + }, + ], +}; diff --git a/src/blocks/OurTeam.ts b/src/blocks/OurTeam.ts index c3b56d4..70d6435 100644 --- a/src/blocks/OurTeam.ts +++ b/src/blocks/OurTeam.ts @@ -2,6 +2,7 @@ import { Block } from "payload"; export const OurTeamBlock: Block = { slug: "ourTeamBlock", + labels: { plural: "Our Team", singular: "Our Team" }, fields: [ { name: "team", diff --git a/src/collections/Pages.ts b/src/collections/Pages.ts index 15ceb4f..533af53 100644 --- a/src/collections/Pages.ts +++ b/src/collections/Pages.ts @@ -1,5 +1,6 @@ import { BeforeFooterBlock } from "@/blocks/BeforeFooter"; import { ContentBlock } from "@/blocks/Content"; +import { HorizontalImageContentBlock } from "@/blocks/HorizontalImageContent"; import { OurTeamBlock } from "@/blocks/OurTeam"; import formatSlug from "@/utils/formatSlug"; import { CollectionConfig } from "payload"; @@ -35,7 +36,7 @@ export const Pages: CollectionConfig = { label: "Page Layout", type: "blocks", minRows: 1, - blocks: [ContentBlock, BeforeFooterBlock, OurTeamBlock], + blocks: [ContentBlock, BeforeFooterBlock, OurTeamBlock, HorizontalImageContentBlock], }, { name: "meta", diff --git a/src/components/Blocks/Content/index.tsx b/src/components/Blocks/Content/index.tsx index fbabe54..44e07a4 100644 --- a/src/components/Blocks/Content/index.tsx +++ b/src/components/Blocks/Content/index.tsx @@ -9,7 +9,7 @@ export function ContentBlock(props: any) { {/* Content */}