diff --git a/src/blocks/About/Component.tsx b/src/blocks/About/Component.tsx new file mode 100644 index 0000000..294e1ce --- /dev/null +++ b/src/blocks/About/Component.tsx @@ -0,0 +1,97 @@ +'use client' + +import React from 'react' +import { Container } from '@/components/ui/Container' // Ensure this path is correct +import type { Skill } from '@/payload-types' // Adjust import based on your project + +type AboutProps = { + aboutHeading?: string + aboutText?: string + aboutCta?: { label?: string; url?: string; newTab?: boolean } + skillsHeading?: string + skills?: Skill[] +} + +export function AboutBlock(props: AboutProps) { + const { aboutHeading, aboutText, aboutCta, skillsHeading, skills } = props + + return ( + // Replaced hardcoded max-w-5xl and section with the unified Container + + + {/* About Section */} + + + {aboutHeading && ( + + {aboutHeading} + + )} + {aboutText && ( + + {aboutText} + + )} + + {aboutCta && aboutCta.label && aboutCta.url && ( + + + {aboutCta.label} + + )} + + + {/* Skills Section */} + + {skillsHeading && ( + + {skillsHeading} + + )} + {Array.isArray(skills) && skills.length > 0 && ( + + {skills.map(function (skill, i) { + const tags = skill.tags + ? skill.tags + .split(',') + .map((t) => t.trim()) + .filter(Boolean) + : [] + return ( + + + {skill.title} + + {tags.map(function (tag, j) { + return ( + + {tag} + + ) + })} + + + ) + })} + + )} + + + + ) +} diff --git a/src/blocks/About/config.ts b/src/blocks/About/config.ts new file mode 100644 index 0000000..0d20da3 --- /dev/null +++ b/src/blocks/About/config.ts @@ -0,0 +1,50 @@ +import type { Block } from 'payload' + +export const AboutBlock: Block = { + slug: 'about', + labels: { singular: 'About (About + Skills)', plural: 'About' }, + fields: [ + { + name: 'aboutHeading', + type: 'text', + label: 'About heading', + }, + { + name: 'aboutText', + type: 'textarea', + label: 'About text', + }, + { + name: 'aboutCta', + type: 'group', + label: 'About CTA button', + fields: [ + { name: 'label', type: 'text', label: 'Label', defaultValue: 'Download CV' }, + { name: 'url', type: 'text', label: 'URL' }, + { name: 'newTab', type: 'checkbox', label: 'Open in new tab', defaultValue: true }, + ], + }, + { + name: 'skillsHeading', + type: 'text', + label: 'Skills heading', + defaultValue: 'Expertise', + }, + { + name: 'skills', + type: 'array', + label: 'Skill cards', + maxRows: 6, + fields: [ + { + name: 'icon', + type: 'text', + label: 'Tabler icon name (e.g. ti-components)', + required: true, + }, + { name: 'title', type: 'text', label: 'Title', required: true }, + { name: 'tags', type: 'text', label: 'Tags (comma separated)', required: true }, + ], + }, + ], +} diff --git a/src/blocks/Process/Component.tsx b/src/blocks/Process/Component.tsx new file mode 100644 index 0000000..f98a53a --- /dev/null +++ b/src/blocks/Process/Component.tsx @@ -0,0 +1,76 @@ +'use client' + +import React from 'react' +import { Container } from '@/components/ui/Container' + +const colorMap: Record = { + gray: { border: 'border-t-[#888780]', dot: 'bg-[#888780]' }, + blue: { border: 'border-t-[#378ADD]', dot: 'bg-[#378ADD]' }, + green: { border: 'border-t-[#1D9E75]', dot: 'bg-[#1D9E75]' }, + amber: { border: 'border-t-[#BA7517]', dot: 'bg-[#BA7517]' }, + red: { border: 'border-t-[#E24B4A]', dot: 'bg-[#E24B4A]' }, + purple: { border: 'border-t-[#7F77DD]', dot: 'bg-[#7F77DD]' }, + teal: { border: 'border-t-[#1D9E75]', dot: 'bg-[#1D9E75]' }, +} + +type Card = { title: string; subtitle?: string } +type Column = { title: string; color?: string; cards?: Card[] } +type Props = { columns?: Column[] } + +export function ProcessBlock({ columns }: Props) { + if (!Array.isArray(columns) || columns.length === 0) return null + + return ( + + + {columns.map((col, i) => { + const { border, dot } = colorMap[col.color ?? 'gray'] ?? colorMap.gray + + return ( + + + + + {col.title} + + + + + {col.cards?.map((card, j) => ( + + + {card.title} + {card.subtitle && ( + {card.subtitle} + )} + + + {/* Vertical Connector Arrow */} + {j < (col.cards?.length || 0) - 1 && ( + + + + + + )} + + ))} + + + ) + })} + + + ) +} diff --git a/src/blocks/Process/config.ts b/src/blocks/Process/config.ts new file mode 100644 index 0000000..93ca828 --- /dev/null +++ b/src/blocks/Process/config.ts @@ -0,0 +1,47 @@ +// src/blocks/KanbanColor/config.ts +import type { Block } from 'payload' + +export const ProcessBlock: Block = { + slug: 'process', + labels: { singular: 'Process', plural: 'Process' }, + fields: [ + { + name: 'columns', + type: 'array', + label: 'Columns', + minRows: 1, + fields: [ + { + name: 'title', + type: 'text', + label: 'Column title', + required: true, + }, + { + name: 'color', + type: 'select', + label: 'Accent color', + defaultValue: 'gray', + options: [ + { label: 'Gray', value: 'gray' }, + { label: 'Blue', value: 'blue' }, + { label: 'Green', value: 'green' }, + { label: 'Amber', value: 'amber' }, + { label: 'Red', value: 'red' }, + { label: 'Purple', value: 'purple' }, + { label: 'Teal', value: 'teal' }, + ], + }, + { + name: 'cards', + type: 'array', + label: 'Cards', + fields: [ + { name: 'title', type: 'text', label: 'Title', required: true }, + { name: 'subtitle', type: 'text', label: 'Subtitle / Category' }, + ], + }, + ], + }, + ], +} diff --git a/src/blocks/RenderBlocks.tsx b/src/blocks/RenderBlocks.tsx index 2c55358..192ee28 100644 --- a/src/blocks/RenderBlocks.tsx +++ b/src/blocks/RenderBlocks.tsx @@ -9,12 +9,14 @@ import { FormBlock } from '@/blocks/Form/Component' import { MediaBlock } from '@/blocks/MediaBlock/Component' import { SkillsBlock } from '@/blocks/Skills/Component' import { SkillsMarqueeBlock } from '@/blocks/SkillsMarquee/Component' -import { KanbanColorBlock } from '@/blocks/KanbanColor/Component' +import { ProcessBlock } from '@/blocks/Process/Component' +import { KanbanColor } from '@/blocks/KanbanColor/Component' import { KanbanHoriBlock } from '@/blocks/KanbanHori/Component' import { ShowcaseBlock } from '@/blocks/Showcase/Component' import { AboutProfileBlock } from '@/blocks/AboutProfile/Component' import { StatsStripBlock } from '@/blocks/StatsStrip/Component' -import { BentoRowBlock } from '@/blocks/BentoRow/Component' +import { AboutBlock } from '@/blocks/About/Component' +import { BentoRow } from '@/blocks/BentoRow/Component' import { ContactBlock } from '@/blocks/Contact/Component' import { ToolStackBlock } from '@/blocks/ToolStack/Component' @@ -26,6 +28,8 @@ const blockComponents = { mediaBlock: MediaBlock, skills: SkillsBlock, skillsMarquee: SkillsMarqueeBlock, + about: AboutBlock, + process: ProcessBlock, kanbanColor: KanbanColorBlock, kanbanHori: KanbanHoriBlock, showcase: ShowcaseBlock,
+ {aboutHeading} +
+ {aboutText} +
+ {skillsHeading} +
{skill.title}
{card.title}
{card.subtitle}