113 lines
2.8 KiB
TypeScript
113 lines
2.8 KiB
TypeScript
import type { Block } from 'payload'
|
||
|
||
export const FDHeroBlock: Block = {
|
||
slug: 'fdHero',
|
||
imageURL: '/block-thumbnails/fd-hero.png',
|
||
imageAltText: 'FD Hero',
|
||
interfaceName: 'FDHeroBlock',
|
||
labels: {
|
||
singular: 'FD Hero',
|
||
plural: 'FD Heroes',
|
||
},
|
||
fields: [
|
||
{
|
||
name: 'heading',
|
||
type: 'text',
|
||
localized: true,
|
||
required: true,
|
||
label: 'Rubrik',
|
||
defaultValue: 'Sveriges bästa IT-ekosystem för företag',
|
||
},
|
||
{
|
||
name: 'subheading',
|
||
type: 'text',
|
||
localized: true,
|
||
label: 'Underrubrik',
|
||
defaultValue: 'Fiber, Backup, Colocation och Cloud',
|
||
},
|
||
{
|
||
name: 'body',
|
||
type: 'textarea',
|
||
localized: true,
|
||
label: 'Brödtext',
|
||
defaultValue:
|
||
'För företag som väljer Sverige. Vi levererar dedikerad fiber, backup, colocation och cloud – allt från en leverantör med svenskt huvudmannaskap.',
|
||
},
|
||
{
|
||
name: 'ctaText',
|
||
type: 'text',
|
||
localized: true,
|
||
label: 'CTA-knapp text',
|
||
defaultValue: 'Kom igång',
|
||
},
|
||
{
|
||
name: 'ctaLink',
|
||
type: 'text',
|
||
localized: true,
|
||
label: 'CTA-knapp länk',
|
||
defaultValue: '/kontakt',
|
||
},
|
||
{
|
||
name: 'secondaryCtaText',
|
||
type: 'text',
|
||
localized: true,
|
||
label: 'Sekundär CTA text',
|
||
defaultValue: 'Kontakta oss',
|
||
},
|
||
{
|
||
name: 'secondaryCtaLink',
|
||
type: 'text',
|
||
localized: true,
|
||
label: 'Sekundär CTA länk',
|
||
defaultValue: '/kontakt',
|
||
},
|
||
{
|
||
name: 'backgroundImage',
|
||
type: 'upload',
|
||
relationTo: 'media',
|
||
label: 'Bakgrundsbild (valfri)',
|
||
admin: {
|
||
description: 'Fullbreddsbild bakom texten. Lämna tom för enfärgad bakgrund.',
|
||
},
|
||
},
|
||
{
|
||
name: 'overlayOpacity',
|
||
type: 'select',
|
||
label: 'Overlay-styrka',
|
||
defaultValue: '50',
|
||
admin: {
|
||
condition: (_, siblingData) => Boolean(siblingData?.backgroundImage),
|
||
description: 'Hur mörk overlay över bilden (för läsbarhet)',
|
||
},
|
||
options: [
|
||
{ label: 'Lätt (30%)', value: '30' },
|
||
{ label: 'Medium (50%)', value: '50' },
|
||
{ label: 'Stark (70%)', value: '70' },
|
||
],
|
||
},
|
||
{
|
||
name: 'textColor',
|
||
type: 'select',
|
||
label: 'Textfärg',
|
||
defaultValue: 'auto',
|
||
options: [
|
||
{ label: 'Automatisk (baserat på tema)', value: 'auto' },
|
||
{ label: 'Vit', value: 'white' },
|
||
{ label: 'Blå (navy)', value: 'navy' },
|
||
],
|
||
},
|
||
{
|
||
name: 'theme',
|
||
type: 'select',
|
||
label: 'Tema',
|
||
defaultValue: 'light',
|
||
admin: {
|
||
description: 'Ignoreras om bakgrundsbild är vald',
|
||
},
|
||
options: [
|
||
{ label: 'Ljust', value: 'light' },
|
||
{ label: 'Mörkt', value: 'dark' },
|
||
],
|
||
},
|
||
],
|
||
} |