Fix FAQFull: Use isDraft boolean for draft filtering, fix Kontakt ID override

This commit is contained in:
MichalC
2026-09-16 12:31:19 +02:00
parent 437e1e4823
commit 9043301da6
140 changed files with 23337 additions and 724 deletions
+13 -2
View File
@@ -6,7 +6,7 @@ import type { Page } from '../../payload-types'
type Props = Extract<NonNullable<Page['layout']>[0], { blockType: 'faqTeaser' }>
export const FAQTeaserBlock: React.FC<Props> = ({ title, questions }) => {
export const FAQTeaserBlock: React.FC<Props> = ({ title, questions, ctaText, ctaUrl }) => {
const [openIndex, setOpenIndex] = useState<number | null>(0)
const toggleQuestion = (index: number) => {
@@ -14,7 +14,7 @@ export const FAQTeaserBlock: React.FC<Props> = ({ title, questions }) => {
}
return (
<section className="py-20 md:py-32 bg-card/40 border-t border-border" id="faq">
<section className="py-20 md:py-32" id="faq">
<div className="container-premium max-w-4xl">
<div className="mb-12 md:mb-16 text-center">
<h2 className="font-heading text-3xl sm:text-4xl md:text-5xl font-extrabold text-foreground tracking-tight text-balance">
@@ -63,6 +63,17 @@ export const FAQTeaserBlock: React.FC<Props> = ({ title, questions }) => {
)
})}
</div>
{ctaText && ctaUrl && (
<div className="mt-12 text-center">
<a
href={ctaUrl}
className="inline-flex items-center justify-center h-14 px-8 text-base sm:text-lg font-bold text-background bg-accent rounded-[6px] hover:bg-accent-hover transition-colors"
>
{ctaText}
</a>
</div>
)}
</div>
</section>
)
+3
View File
@@ -10,9 +10,12 @@ export const FAQTeaser: Block = {
minRows: 1,
localized: true,
fields: [
{ name: 'category', type: 'text', required: false },
{ name: 'question', type: 'text', required: true },
{ name: 'answer', type: 'textarea', required: true },
],
},
{ name: 'ctaText', type: 'text', required: false, localized: true },
{ name: 'ctaUrl', type: 'text', required: false },
],
}