diff --git a/src/lib/block-types.ts b/src/lib/block-types.ts index 5b06e0e..aa8e4b4 100644 --- a/src/lib/block-types.ts +++ b/src/lib/block-types.ts @@ -469,7 +469,7 @@ export type CalendarBlockData = Omit< }; /** Internal component block (_type: "internal_component"). */ -export type InternalComponentId = "form-contact" | "form-mitmachen" | "form-newsletter"; +export type InternalComponentId = "form-contact" | "form-mitmachen" | "form-newsletter" | "form-newsletter-inline"; export interface InternalComponentBlockData { _type?: "internal_component"; diff --git a/src/lib/components/blocks/InternalComponentBlock.svelte b/src/lib/components/blocks/InternalComponentBlock.svelte index 2f13fe6..6c69bba 100644 --- a/src/lib/components/blocks/InternalComponentBlock.svelte +++ b/src/lib/components/blocks/InternalComponentBlock.svelte @@ -4,6 +4,7 @@ import ContactFormComponent from "$lib/components/internal/ContactFormComponent.svelte"; import MitmachenFormComponent from "$lib/components/internal/MitmachenFormComponent.svelte"; import NewsletterFormComponent from "$lib/components/internal/NewsletterFormComponent.svelte"; + import NewsletterInlineFormComponent from "$lib/components/internal/NewsletterInlineFormComponent.svelte"; import FormCard from "$lib/components/internal/FormCard.svelte"; let { block }: { block: InternalComponentBlockData } = $props(); @@ -25,6 +26,8 @@ + {:else if component === "form-newsletter-inline"} + {:else}

Unbekannte interne Komponente: {component}

{/if} diff --git a/src/lib/components/internal/NewsletterInlineFormComponent.svelte b/src/lib/components/internal/NewsletterInlineFormComponent.svelte new file mode 100644 index 0000000..e26a67b --- /dev/null +++ b/src/lib/components/internal/NewsletterInlineFormComponent.svelte @@ -0,0 +1,180 @@ + + +
+

{t(T.newsletter_inline_heading)}

+ + {#if formState === "success"} +

{t(T.newsletter_success_body)}

+ {:else} +
+ + + +
+ + +
+ {#if showError("email")} + + {/if} + + + {#if showError("consent")} + + {/if} + + {#if TURNSTILE_ENABLED} +
+ {/if} + + {#if serverError} + + {/if} +
+ {/if} +
diff --git a/src/lib/translations.ts b/src/lib/translations.ts index 34f61cb..d033e33 100644 --- a/src/lib/translations.ts +++ b/src/lib/translations.ts @@ -369,6 +369,8 @@ const TRANSLATION_KEYS = [ "newsletter_error_email_invalid", "newsletter_error_email_max", // {{n}} "newsletter_error_consent_required", + "newsletter_inline_heading", + "newsletter_inline_consent", ] as const; export type TranslationKey = (typeof TRANSLATION_KEYS)[number];