diff --git a/public/assets/images/hero-default.webp b/public/assets/images/hero-default.webp new file mode 100644 index 0000000..6f35f8e Binary files /dev/null and b/public/assets/images/hero-default.webp differ diff --git a/src/app/(main)/[pageslug]/page.tsx b/src/app/(main)/[pageslug]/page.tsx index 62d3d78..86bcf48 100644 --- a/src/app/(main)/[pageslug]/page.tsx +++ b/src/app/(main)/[pageslug]/page.tsx @@ -4,8 +4,8 @@ import Image from "next/image"; import { Suspense } from "react"; export const metadata = { - title: "Page | Cochise Oncology", - description: "Page | Cochise Oncology", + title: "Cochise Oncology", + description: "Cochise Oncology", }; export default async function CustomPage({ params }: { params?: Promise<{ pageslug?: string }> }) { diff --git a/src/blocks/OurTeam.ts b/src/blocks/OurTeam.ts new file mode 100644 index 0000000..c3b56d4 --- /dev/null +++ b/src/blocks/OurTeam.ts @@ -0,0 +1,13 @@ +import { Block } from "payload"; + +export const OurTeamBlock: Block = { + slug: "ourTeamBlock", + fields: [ + { + name: "team", + type: "relationship", + relationTo: "teams", + hasMany: true, + }, + ], +}; diff --git a/src/collections/Pages.ts b/src/collections/Pages.ts index e318d14..15ceb4f 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 { OurTeamBlock } from "@/blocks/OurTeam"; import formatSlug from "@/utils/formatSlug"; import { CollectionConfig } from "payload"; @@ -34,7 +35,7 @@ export const Pages: CollectionConfig = { label: "Page Layout", type: "blocks", minRows: 1, - blocks: [ContentBlock, BeforeFooterBlock], + blocks: [ContentBlock, BeforeFooterBlock, OurTeamBlock], }, { name: "meta", diff --git a/src/collections/Teams.ts b/src/collections/Teams.ts new file mode 100644 index 0000000..68636e2 --- /dev/null +++ b/src/collections/Teams.ts @@ -0,0 +1,34 @@ +import type { CollectionConfig } from "payload"; +import { lexicalEditor } from "@payloadcms/richtext-lexical"; + +export const Teams: CollectionConfig = { + slug: "teams", + fields: [ + { + name: "name", + type: "text", + required: true, + }, + { + name: "role", + type: "text", + required: true, + }, + { + name: "img", + label: "Image", + type: "upload", + relationTo: "media", + required: true, + }, + { + name: "biography", + type: "richText", + editor: lexicalEditor({}), + }, + ], + admin: { + hideAPIURL: true, + useAsTitle: "name", + }, +}; diff --git a/src/components/Blocks/BeforeFooter/index.tsx b/src/components/Blocks/BeforeFooter/index.tsx index 143133a..23af317 100644 --- a/src/components/Blocks/BeforeFooter/index.tsx +++ b/src/components/Blocks/BeforeFooter/index.tsx @@ -10,10 +10,10 @@ export interface BeforeFooterBlockProps { export function BeforeFooterBlock({ title, description, buttonText }: BeforeFooterBlockProps) { return (
-
+

{title}

{description}

{!!buttonText && ( diff --git a/src/components/Blocks/OurTeam/index.tsx b/src/components/Blocks/OurTeam/index.tsx new file mode 100644 index 0000000..3413e2e --- /dev/null +++ b/src/components/Blocks/OurTeam/index.tsx @@ -0,0 +1,39 @@ +import { CardTeam } from "@/components/Teams/CardTeam"; + +type Team = { + id: number; + name: string; + role: string; + img: { url: string; alt: string }; + biography: string; +}; + +export interface OurTeamProps { + team: Team[]; +} + +export function OurTeamBlock({ team }: OurTeamProps) { + return ( +
+ {/* Decoration Circles */} +
+
+ {/* End Decoration Circles */} +
+

Our Team

+
+ {team.map((member, idx) => ( + + ))} +
+
+
+ ); +} diff --git a/src/components/Blocks/RenderBlocks.tsx b/src/components/Blocks/RenderBlocks.tsx index a4bc6c7..c32e572 100644 --- a/src/components/Blocks/RenderBlocks.tsx +++ b/src/components/Blocks/RenderBlocks.tsx @@ -3,10 +3,12 @@ import React, { Fragment } from "react"; import type { Page } from "@/payload-types"; import { ContentBlock } from "./Content"; import { BeforeFooterBlock } from "./BeforeFooter"; +import { OurTeamBlock } from "./OurTeam"; const blockComponents = { contentBlock: ContentBlock, beforeFooterBlock: BeforeFooterBlock, + ourTeamBlock: OurTeamBlock, }; export const RenderBlocks: React.FC<{ diff --git a/src/components/Pages/Page.tsx b/src/components/Pages/Page.tsx index b9fb2c6..9fa2824 100644 --- a/src/components/Pages/Page.tsx +++ b/src/components/Pages/Page.tsx @@ -30,9 +30,9 @@ export default async function Page({ slug }: PageProps) {
)} {!page?.heroImg?.url && ( -
+
+ {data.name} +

{data.name}

+

{data.role}

+ +
+ ); +} diff --git a/src/payload-types.ts b/src/payload-types.ts index 3692e8d..bfd8b52 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -15,6 +15,7 @@ export interface Config { media: Media; blogs: Blog; pages: Page; + teams: Team; forms: Form; 'form-submissions': FormSubmission; 'payload-locked-documents': PayloadLockedDocument; @@ -27,6 +28,7 @@ export interface Config { media: MediaSelect | MediaSelect; blogs: BlogsSelect | BlogsSelect; pages: PagesSelect | PagesSelect; + teams: TeamsSelect | TeamsSelect; forms: FormsSelect | FormsSelect; 'form-submissions': FormSubmissionsSelect | FormSubmissionsSelect; 'payload-locked-documents': PayloadLockedDocumentsSelect | PayloadLockedDocumentsSelect; @@ -168,6 +170,12 @@ export interface Page { blockName?: string | null; blockType: 'beforeFooterBlock'; } + | { + team?: (number | Team)[] | null; + id?: string | null; + blockName?: string | null; + blockType: 'ourTeamBlock'; + } )[] | null; meta?: { @@ -178,6 +186,33 @@ export interface Page { updatedAt: string; createdAt: string; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "teams". + */ +export interface Team { + id: number; + name: string; + role: string; + img: number | Media; + biography?: { + root: { + type: string; + children: { + type: string; + version: number; + [k: string]: unknown; + }[]; + direction: ('ltr' | 'rtl') | null; + format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | ''; + indent: number; + version: number; + }; + [k: string]: unknown; + } | null; + updatedAt: string; + createdAt: string; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "forms". @@ -371,6 +406,10 @@ export interface PayloadLockedDocument { relationTo: 'pages'; value: number | Page; } | null) + | ({ + relationTo: 'teams'; + value: number | Team; + } | null) | ({ relationTo: 'forms'; value: number | Form; @@ -494,6 +533,13 @@ export interface PagesSelect { id?: T; blockName?: T; }; + ourTeamBlock?: + | T + | { + team?: T; + id?: T; + blockName?: T; + }; }; meta?: | T @@ -505,6 +551,18 @@ export interface PagesSelect { updatedAt?: T; createdAt?: T; } +/** + * This interface was referenced by `Config`'s JSON-Schema + * via the `definition` "teams_select". + */ +export interface TeamsSelect { + name?: T; + role?: T; + img?: T; + biography?: T; + updatedAt?: T; + createdAt?: T; +} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "forms_select". diff --git a/src/payload.config.ts b/src/payload.config.ts index a68c5ae..776bfdb 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -11,6 +11,7 @@ import { fileURLToPath } from "url"; import { Blogs } from "@/collections/Blogs"; import { Media } from "@/collections/Media"; import { Pages } from "@/collections/Pages"; +import { Teams } from "@/collections/Teams"; import { Users } from "@/collections/Users"; import { BoldFeature, @@ -46,7 +47,7 @@ export default buildConfig({ }, theme: "dark", }, - collections: [Users, Media, Blogs, Pages], + collections: [Users, Media, Blogs, Pages, Teams], secret: process.env.PAYLOAD_SECRET || "", typescript: { outputFile: path.resolve(dirname, "payload-types.ts"),