This commit is contained in:
Mackie 2026-06-07 21:40:08 +08:00
parent 05fc57928b
commit a1fb68764a
2 changed files with 20 additions and 34 deletions

View file

@ -54,7 +54,7 @@ export const RenderBlocks: React.FC<{
if (Block) { if (Block) {
return ( return (
<div key={index}> <div key={index} id={blockType}>
<Block {...block} disableInnerContainer /> <Block {...block} disableInnerContainer />
</div> </div>
) )

View file

@ -4,43 +4,34 @@ export const ShowcaseBlock: Block = {
slug: 'showcase', slug: 'showcase',
labels: { singular: 'Showcase', plural: 'Showcases' }, labels: { singular: 'Showcase', plural: 'Showcases' },
fields: [ fields: [
{ { name: 'heading', type: 'text', label: 'Heading' },
name: 'heading', { name: 'subheading', type: 'text', label: 'Subheading' },
type: 'text',
label: 'Heading',
},
{
name: 'subheading',
type: 'text',
label: 'Subheading',
},
{ {
name: 'items', name: 'items',
type: 'array', type: 'array',
label: 'Items', label: 'Items',
minRows: 1, minRows: 1,
fields: [ fields: [
{ name: 'image', type: 'upload', relationTo: 'media', label: 'Image (optional)' },
{ name: 'imageUrl', type: 'text', label: 'Image click URL (optional)' },
{ name: 'title', type: 'text', label: 'Title', required: true },
{ name: 'description', type: 'textarea', label: 'Description' },
{ {
name: 'image', name: 'category',
type: 'upload', type: 'select',
relationTo: 'media', label: 'Category',
label: 'Image (optional)',
},
{
name: 'imageUrl',
type: 'text',
label: 'Image click URL (optional)',
},
{
name: 'title',
type: 'text',
label: 'Title',
required: true, required: true,
defaultValue: 'engineering',
options: [
{ label: 'Engineering', value: 'engineering' },
{ label: 'Design', value: 'design' },
],
}, },
{ {
name: 'description', name: 'featured',
type: 'textarea', type: 'checkbox',
label: 'Description', label: 'Featured',
defaultValue: false,
}, },
{ {
name: 'tags', name: 'tags',
@ -55,12 +46,7 @@ export const ShowcaseBlock: Block = {
fields: [ fields: [
{ name: 'label', type: 'text', label: 'Label', required: true }, { name: 'label', type: 'text', label: 'Label', required: true },
{ name: 'url', type: 'text', label: 'URL', required: true }, { name: 'url', type: 'text', label: 'URL', required: true },
{ { name: 'newTab', type: 'checkbox', label: 'Open in new tab', defaultValue: true },
name: 'newTab',
type: 'checkbox',
label: 'Open in new tab',
defaultValue: true,
},
], ],
}, },
], ],