mirror of
https://github.com/complexcaresolutions/cms.c2sgmbh.git
synced 2026-03-17 19:44:12 +00:00
feat(blocks): add icon support to CardGridBlock
Cards can now display a Lucide icon as alternative to an image, with configurable position (top/left). Fields show conditionally based on mediaType selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8abf3a346e
commit
85c76a1eb4
1 changed files with 36 additions and 0 deletions
|
|
@ -20,11 +20,47 @@ export const CardGridBlock: Block = {
|
||||||
minRows: 1,
|
minRows: 1,
|
||||||
maxRows: 6,
|
maxRows: 6,
|
||||||
fields: [
|
fields: [
|
||||||
|
{
|
||||||
|
name: 'mediaType',
|
||||||
|
type: 'select',
|
||||||
|
defaultValue: 'none',
|
||||||
|
label: 'Visuelles Element',
|
||||||
|
options: [
|
||||||
|
{ label: 'Keins', value: 'none' },
|
||||||
|
{ label: 'Bild', value: 'image' },
|
||||||
|
{ label: 'Icon', value: 'icon' },
|
||||||
|
],
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'image',
|
name: 'image',
|
||||||
type: 'upload',
|
type: 'upload',
|
||||||
relationTo: 'media',
|
relationTo: 'media',
|
||||||
label: 'Bild',
|
label: 'Bild',
|
||||||
|
admin: {
|
||||||
|
condition: (_, siblingData) => siblingData?.mediaType === 'image',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'icon',
|
||||||
|
type: 'text',
|
||||||
|
label: 'Icon-Name',
|
||||||
|
admin: {
|
||||||
|
description: 'Lucide Icon-Name (z.B. "heart", "star", "shield-check", "camera")',
|
||||||
|
condition: (_, siblingData) => siblingData?.mediaType === 'icon',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'iconPosition',
|
||||||
|
type: 'select',
|
||||||
|
defaultValue: 'top',
|
||||||
|
label: 'Icon-Position',
|
||||||
|
options: [
|
||||||
|
{ label: 'Oben', value: 'top' },
|
||||||
|
{ label: 'Links', value: 'left' },
|
||||||
|
],
|
||||||
|
admin: {
|
||||||
|
condition: (_, siblingData) => siblingData?.mediaType === 'icon',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'title',
|
name: 'title',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue