import { component$, useStylesScoped$, $, QwikSubmitEvent, useSignal, } from '@builder.io/qwik'; import { $translate as t, useSpeakContext } from 'qwik-speak'; import Button, { ButtonTheme } from '../../button/button'; import { ContainerTheme } from '../../container/container'; import Section, { SectionHeader } from '../../section/section'; import styles from './contact.css?inline'; import { localizedUrl as locUrl } from '../../../speak-config'; export default component$(() => { useStylesScoped$(styles); const loading = useSignal(false); const success = useSignal(false); const speakState = useSpeakContext(); const localizedUrl = (url: string) => { return locUrl(url, speakState); }; const handleSubmit = $((event: QwikSubmitEvent) => { const form = event.target as any; const formData = new FormData(form); if (!formData.get('companyEmail')) { return; } if (!formData.get('name')) { return; } if (!formData.get('howCanWeHelp')) { return; } loading.value = true; success.value = false; fetch('/docs/submit-form', { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams(formData as any).toString(), }) .then(() => { success.value = true; loading.value = false; form.reset(); }) .catch((error) => (loading.value = false)); }); const title = t('contact.title@@Talk to our experts'); return (
handleSubmit(e as any)} preventdefault:submit >
{success.value && (
Form submitted successfully!
)}
{t( 'contact.disclaimer.text@@By submitting this form, I confirm that I have read and understood the', )}{' '} {t('contact.disclaimer.action@@Privacy & Policy')} .
{t( 'contact.quote.text@@There are now 4000 companies using Module Federation in a detectable way. Likely many more who we cannot trace, but 4000 is still an impressive number of known entities.', )}
{t('contact.quote.author.name@@Zack
{t('contact.quote.author.name@@Zack Jackson')}
{t( 'contact.quote.author.title@@the сreator of Module Federation', )}
); });