From 2ed65a61eddbcda3ad1a814f9dbeee3bcb2a2ca9 Mon Sep 17 00:00:00 2001 From: Francesco Sansalvadore Date: Mon, 26 May 2025 17:16:33 +0200 Subject: [PATCH] migration --- apps/cms/src/blocks/Quote/Component.tsx | 19 + apps/cms/src/blocks/Quote/config.ts | 27 + apps/cms/src/blocks/YouTube/Component.tsx | 22 + apps/cms/src/blocks/YouTube/config.ts | 17 + apps/cms/src/collections/Customers/index.ts | 4 +- apps/cms/src/collections/Events/index.ts | 4 +- apps/cms/src/collections/Posts/index.ts | 4 +- apps/cms/src/components/RichText/index.tsx | 8 +- apps/cms/src/migrations/20250526_130524.json | 11567 +++++++++++++++++ apps/cms/src/migrations/20250526_130524.ts | 2031 +++ apps/cms/src/migrations/index.ts | 9 + apps/cms/src/payload-types.ts | 25 + apps/www/pages/blog/[slug].tsx | 14 +- 13 files changed, 13739 insertions(+), 12 deletions(-) create mode 100644 apps/cms/src/blocks/Quote/Component.tsx create mode 100644 apps/cms/src/blocks/Quote/config.ts create mode 100644 apps/cms/src/blocks/YouTube/Component.tsx create mode 100644 apps/cms/src/blocks/YouTube/config.ts create mode 100644 apps/cms/src/migrations/20250526_130524.json create mode 100644 apps/cms/src/migrations/20250526_130524.ts create mode 100644 apps/cms/src/migrations/index.ts diff --git a/apps/cms/src/blocks/Quote/Component.tsx b/apps/cms/src/blocks/Quote/Component.tsx new file mode 100644 index 00000000000..8d7cca8af6f --- /dev/null +++ b/apps/cms/src/blocks/Quote/Component.tsx @@ -0,0 +1,19 @@ +import type { QuoteBlock as QuoteBlockProps } from 'src/payload-types' + +import { cn } from '@/utilities/ui' +import React from 'react' + +type Props = { + className?: string +} & QuoteBlockProps + +export const QuoteBlock: React.FC = ({ className, img, caption, text }) => { + return ( + ` + +{${text}} + + +` + ) +} \ No newline at end of file diff --git a/apps/cms/src/blocks/Quote/config.ts b/apps/cms/src/blocks/Quote/config.ts new file mode 100644 index 00000000000..03017495fdb --- /dev/null +++ b/apps/cms/src/blocks/Quote/config.ts @@ -0,0 +1,27 @@ +import type { Block } from 'payload' + +export const Quote: Block = { + slug: 'quote', + fields: [ + { + name: 'img', + type: 'upload', + relationTo: 'media', + label: 'Avatar', + required: false, + }, + { + name: 'caption', + type: 'text', + label: 'Caption', + required: false, + }, + { + name: 'text', + type: 'textarea', + label: 'Quote Text', + required: true, + }, + ], + interfaceName: 'QuoteBlock', +} \ No newline at end of file diff --git a/apps/cms/src/blocks/YouTube/Component.tsx b/apps/cms/src/blocks/YouTube/Component.tsx new file mode 100644 index 00000000000..f911b2bd198 --- /dev/null +++ b/apps/cms/src/blocks/YouTube/Component.tsx @@ -0,0 +1,22 @@ +import type { YouTubeBlock as YouTubeBlockProps } from 'src/payload-types' + +import { cn } from '@/utilities/ui' +import React from 'react' + +type Props = { + className?: string +} & YouTubeBlockProps + +export const YouTubeBlock: React.FC = ({ className, youtubeId }) => { + return ( +
+