feat: centralize contact cms defaults
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { Field } from 'payload'
|
||||
|
||||
import { contactFormContent } from '@/spa/contactFormContent'
|
||||
import { contactContent } from '@/spa/contactContent'
|
||||
|
||||
const uploadField = (name: string, label: string, description?: string): Field => ({
|
||||
name,
|
||||
@@ -45,14 +45,14 @@ export const contactFields: Field[] = [
|
||||
type: 'group',
|
||||
admin: sectionAdmin('Top image, eyebrow, headline, and intro copy.'),
|
||||
fields: [
|
||||
uploadField('backgroundImage', 'Background image', 'Current frontend image: /images/gala-dinner.jpg'),
|
||||
text('imageAlt', 'Image alt text', 'BMP Gala'),
|
||||
text('eyebrow', 'Eyebrow', 'Dialog & Service'),
|
||||
textarea('heading', 'Headline', 'Wir sind\nfür Sie da.'),
|
||||
uploadField('backgroundImage', 'Background image', `Current frontend image: /images/${contactContent.hero.backgroundImageFilename}`),
|
||||
text('imageAlt', 'Image alt text', contactContent.hero.imageAlt),
|
||||
text('eyebrow', 'Eyebrow', contactContent.hero.eyebrow),
|
||||
textarea('heading', 'Headline', contactContent.hero.heading),
|
||||
textarea(
|
||||
'description',
|
||||
'Intro paragraph',
|
||||
'Fragen zur Bewerbung, zur Gala oder zu Partnermöglichkeiten – unser Team begleitet Sie persönlich.',
|
||||
contactContent.hero.description,
|
||||
),
|
||||
],
|
||||
},
|
||||
@@ -62,18 +62,13 @@ export const contactFields: Field[] = [
|
||||
type: 'group',
|
||||
admin: sectionAdmin('Left direct-contact list plus the gold contact form panel.'),
|
||||
fields: [
|
||||
text('eyebrow', 'Direct contact eyebrow', 'Direktkontakt'),
|
||||
textarea('heading', 'Direct contact heading', 'Kontaktmöglichkeiten'),
|
||||
text('eyebrow', 'Direct contact eyebrow', contactContent.info.eyebrow),
|
||||
textarea('heading', 'Direct contact heading', contactContent.info.heading),
|
||||
{
|
||||
name: 'items',
|
||||
label: 'Contact methods',
|
||||
type: 'array',
|
||||
defaultValue: [
|
||||
{ icon: 'mapPin', title: 'Geschäftsstelle', lines: 'Maximilianstraße 42\n80538 München' },
|
||||
{ icon: 'mail', title: 'E-Mail', lines: 'info@bmp-bayern.de' },
|
||||
{ icon: 'phone', title: 'Telefon', lines: '+49 89 123 456 78' },
|
||||
{ icon: 'clock', title: 'Bürozeiten', lines: 'Mo – Fr: 09:00 – 17:00 Uhr' },
|
||||
],
|
||||
defaultValue: contactContent.info.items,
|
||||
fields: [
|
||||
{
|
||||
name: 'icon',
|
||||
@@ -91,13 +86,13 @@ export const contactFields: Field[] = [
|
||||
textarea('lines', 'Lines'),
|
||||
],
|
||||
},
|
||||
text('nextAwardLabel', 'Next award label', 'Nächste Preisverleihung:'),
|
||||
text('nextAwardDate', 'Next award date', '22. Oktober 2026'),
|
||||
uploadField('formImage', 'Desktop form image', 'Current frontend image: /images/preistraeger-gruppe.jpg'),
|
||||
text('formImageAlt', 'Form image alt text', 'BMP Gala 2025'),
|
||||
text('formImageLabel', 'Form image label', 'Gala 2025 München'),
|
||||
text('formEyebrow', 'Form eyebrow', 'Kontaktformular'),
|
||||
text('formTitle', 'Form title', 'Schreiben Sie uns'),
|
||||
text('nextAwardLabel', 'Next award label', contactContent.info.nextAwardLabel),
|
||||
text('nextAwardDate', 'Next award date', contactContent.info.nextAwardDate),
|
||||
uploadField('formImage', 'Desktop form image', `Current frontend image: /images/${contactContent.info.formImageFilename}`),
|
||||
text('formImageAlt', 'Form image alt text', contactContent.info.formImageAlt),
|
||||
text('formImageLabel', 'Form image label', contactContent.info.formImageLabel),
|
||||
text('formEyebrow', 'Form eyebrow', contactContent.info.formEyebrow),
|
||||
text('formTitle', 'Form title', contactContent.info.formTitle),
|
||||
{
|
||||
name: 'formCopy',
|
||||
label: 'Contact form copy',
|
||||
@@ -108,14 +103,14 @@ export const contactFields: Field[] = [
|
||||
name: 'steps',
|
||||
label: 'Step labels',
|
||||
type: 'array',
|
||||
defaultValue: contactFormContent.steps,
|
||||
defaultValue: contactContent.info.formCopy.steps,
|
||||
fields: [text('label', 'Label')],
|
||||
},
|
||||
{
|
||||
name: 'subjects',
|
||||
label: 'Subject choices',
|
||||
type: 'array',
|
||||
defaultValue: contactFormContent.subjects,
|
||||
defaultValue: contactContent.info.formCopy.subjects,
|
||||
fields: [text('value', 'Value'), text('label', 'Label'), textarea('desc', 'Description')],
|
||||
},
|
||||
{
|
||||
@@ -123,9 +118,9 @@ export const contactFields: Field[] = [
|
||||
label: 'Prompts',
|
||||
type: 'group',
|
||||
fields: [
|
||||
text('subject', 'Subject step prompt', contactFormContent.prompts.subject),
|
||||
text('contact', 'Contact step prompt', contactFormContent.prompts.contact),
|
||||
text('message', 'Message step prompt', contactFormContent.prompts.message),
|
||||
text('subject', 'Subject step prompt', contactContent.info.formCopy.prompts.subject),
|
||||
text('contact', 'Contact step prompt', contactContent.info.formCopy.prompts.contact),
|
||||
text('message', 'Message step prompt', contactContent.info.formCopy.prompts.message),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -133,12 +128,12 @@ export const contactFields: Field[] = [
|
||||
label: 'Fields',
|
||||
type: 'group',
|
||||
fields: [
|
||||
text('nameLabel', 'Name label', contactFormContent.fields.nameLabel),
|
||||
text('namePlaceholder', 'Name placeholder', contactFormContent.fields.namePlaceholder),
|
||||
text('emailLabel', 'Email label', contactFormContent.fields.emailLabel),
|
||||
text('emailPlaceholder', 'Email placeholder', contactFormContent.fields.emailPlaceholder),
|
||||
text('messageLabel', 'Message label', contactFormContent.fields.messageLabel),
|
||||
text('messagePlaceholder', 'Message placeholder', contactFormContent.fields.messagePlaceholder),
|
||||
text('nameLabel', 'Name label', contactContent.info.formCopy.fields.nameLabel),
|
||||
text('namePlaceholder', 'Name placeholder', contactContent.info.formCopy.fields.namePlaceholder),
|
||||
text('emailLabel', 'Email label', contactContent.info.formCopy.fields.emailLabel),
|
||||
text('emailPlaceholder', 'Email placeholder', contactContent.info.formCopy.fields.emailPlaceholder),
|
||||
text('messageLabel', 'Message label', contactContent.info.formCopy.fields.messageLabel),
|
||||
text('messagePlaceholder', 'Message placeholder', contactContent.info.formCopy.fields.messagePlaceholder),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -146,10 +141,10 @@ export const contactFields: Field[] = [
|
||||
label: 'Validation messages',
|
||||
type: 'group',
|
||||
fields: [
|
||||
text('nameRequired', 'Name required', contactFormContent.validation.nameRequired),
|
||||
text('emailRequired', 'Email required', contactFormContent.validation.emailRequired),
|
||||
text('emailInvalid', 'Email invalid', contactFormContent.validation.emailInvalid),
|
||||
text('messageRequired', 'Message required', contactFormContent.validation.messageRequired),
|
||||
text('nameRequired', 'Name required', contactContent.info.formCopy.validation.nameRequired),
|
||||
text('emailRequired', 'Email required', contactContent.info.formCopy.validation.emailRequired),
|
||||
text('emailInvalid', 'Email invalid', contactContent.info.formCopy.validation.emailInvalid),
|
||||
text('messageRequired', 'Message required', contactContent.info.formCopy.validation.messageRequired),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -157,9 +152,9 @@ export const contactFields: Field[] = [
|
||||
label: 'Navigation labels',
|
||||
type: 'group',
|
||||
fields: [
|
||||
text('back', 'Back', contactFormContent.navigation.back),
|
||||
text('next', 'Next', contactFormContent.navigation.next),
|
||||
text('submit', 'Submit', contactFormContent.navigation.submit),
|
||||
text('back', 'Back', contactContent.info.formCopy.navigation.back),
|
||||
text('next', 'Next', contactContent.info.formCopy.navigation.next),
|
||||
text('submit', 'Submit', contactContent.info.formCopy.navigation.submit),
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -167,9 +162,9 @@ export const contactFields: Field[] = [
|
||||
label: 'Success copy',
|
||||
type: 'group',
|
||||
fields: [
|
||||
text('heading', 'Heading', contactFormContent.success.heading),
|
||||
text('prefix', 'Prefix', contactFormContent.success.prefix),
|
||||
text('suffixBeforeEmail', 'Suffix before email', contactFormContent.success.suffixBeforeEmail),
|
||||
text('heading', 'Heading', contactContent.info.formCopy.success.heading),
|
||||
text('prefix', 'Prefix', contactContent.info.formCopy.success.prefix),
|
||||
text('suffixBeforeEmail', 'Suffix before email', contactContent.info.formCopy.success.suffixBeforeEmail),
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -182,17 +177,13 @@ export const contactFields: Field[] = [
|
||||
type: 'group',
|
||||
admin: sectionAdmin('Dark 2026 timeline with three deadline columns.'),
|
||||
fields: [
|
||||
text('watermark', 'Large background year', '2026'),
|
||||
text('eyebrow', 'Eyebrow', 'Fahrplan 2026'),
|
||||
text('watermark', 'Large background year', contactContent.deadlines.watermark),
|
||||
text('eyebrow', 'Eyebrow', contactContent.deadlines.eyebrow),
|
||||
{
|
||||
name: 'items',
|
||||
label: 'Deadline items',
|
||||
type: 'array',
|
||||
defaultValue: [
|
||||
{ step: '01', label: 'Bewerbungsschluss', date: '30. Juni 2026', desc: 'Letzte Möglichkeit zur Einreichung Ihrer Unterlagen.' },
|
||||
{ step: '02', label: 'Nominierung', date: '15. August 2026', desc: 'Bekanntgabe der Nominierten nach Jury-Sichtung.' },
|
||||
{ step: '03', label: 'Preisverleihung', date: '22. Oktober 2026', desc: 'Festliche Gala in München.' },
|
||||
],
|
||||
defaultValue: contactContent.deadlines.items,
|
||||
fields: [text('step', 'Step'), text('label', 'Label'), text('date', 'Date'), textarea('desc', 'Description')],
|
||||
},
|
||||
],
|
||||
@@ -203,30 +194,13 @@ export const contactFields: Field[] = [
|
||||
type: 'group',
|
||||
admin: sectionAdmin('FAQ heading and accordion entries.'),
|
||||
fields: [
|
||||
text('eyebrow', 'Eyebrow', 'Antworten'),
|
||||
textarea('heading', 'Heading', 'Häufige\nFragen'),
|
||||
text('eyebrow', 'Eyebrow', contactContent.faq.eyebrow),
|
||||
textarea('heading', 'Heading', contactContent.faq.heading),
|
||||
{
|
||||
name: 'items',
|
||||
label: 'FAQ items',
|
||||
type: 'array',
|
||||
defaultValue: [
|
||||
{
|
||||
q: 'Was kostet die Teilnahme am BMP?',
|
||||
a: 'Die Teilnahme am Bayerischen Mittelstandspreis ist für alle Unternehmen vollständig kostenfrei. Wir finanzieren uns durch Partner und Sponsoren, um exzellenten Mittelstand ohne finanzielle Hürden zu fördern.',
|
||||
},
|
||||
{
|
||||
q: 'Nach welchen Kriterien wird bewertet?',
|
||||
a: 'Die Bewertung basiert auf vier Säulen: Zukunftsfähigkeit & Innovation, Nachhaltigkeit & Verantwortung, Unternehmenskultur sowie Regionale Verwurzelung. Jede Säule fließt mit 25 % in das Gesamtergebnis ein.',
|
||||
},
|
||||
{
|
||||
q: 'Wie läuft der Bewerbungsprozess ab?',
|
||||
a: 'Der Prozess ist mehrstufig: 1. Online-Bewerbung oder Vorschlag, 2. Formale Prüfung & erste Jury-Sichtung, 3. Fach-Audits bei den Finalisten vor Ort, 4. Finale Jury-Sitzung und abschließende Preisverleihung.',
|
||||
},
|
||||
{
|
||||
q: 'Wie lange dauert die Bewerbung?',
|
||||
a: 'Dank unseres optimierten Bewerbungsformulars benötigen Sie für die erste Einreichung ca. 30–45 Minuten. Tiefergehende Unterlagen werden erst in der Audit-Phase angefordert.',
|
||||
},
|
||||
],
|
||||
defaultValue: contactContent.faq.items,
|
||||
fields: [textarea('q', 'Question'), textarea('a', 'Answer')],
|
||||
},
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user