// FastFund website — interactive multi-step "Apply" flow (modal) // Submissions POST to Web3Forms -> emailed to FastFund inbox. function ApplyFlow({ open, onClose }) { const { Button, Field, Select, Checkbox, Logo } = window.CapFrontDesignSystem_019e08; const { mobile } = window.useBreakpoint(); const WEB3FORMS_KEY = '841d6bce-eb09-417b-8309-4db6c5f2ed48'; const emptyForm = { business: '', name: '', email: '', phone: '', timeInBusiness: '2+ years', industry: 'Retail', amount: '', revenue: '$50K–$150K', useOfFunds: 'Working capital', agree: false, }; const [step, setStep] = React.useState(0); // 0,1 = form steps; 2 = confirmation const [form, setForm] = React.useState(emptyForm); const [status, setStatus] = React.useState('idle'); // idle | sending | error const [errors, setErrors] = React.useState({}); React.useEffect(() => { if (open) { setStep(0); setForm(emptyForm); setStatus('idle'); setErrors({}); } }, [open]); React.useEffect(() => { window.lucide && window.lucide.createIcons(); }); if (!open) return null; const set = (k) => (e) => { const v = e && e.target ? (e.target.type === 'checkbox' ? e.target.checked : e.target.value) : e; setForm((f) => ({ ...f, [k]: v })); setErrors((er) => ({ ...er, [k]: undefined })); }; const steps = ['Your business', 'Funding need', 'Done']; const validateStep0 = () => { const er = {}; if (!form.business.trim()) er.business = 'Required'; if (!form.name.trim()) er.name = 'Required'; if (!form.email.trim()) er.email = 'Required'; else if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(form.email)) er.email = 'Enter a valid email'; if (!form.phone.trim()) er.phone = 'Required'; setErrors(er); return Object.keys(er).length === 0; }; const validateStep1 = () => { const er = {}; if (!form.amount.trim()) er.amount = 'Required'; if (!form.agree) er.agree = 'Please accept to continue'; setErrors(er); return Object.keys(er).length === 0; }; const submit = async () => { if (!validateStep1()) return; setStatus('sending'); try { const res = await fetch('https://api.web3forms.com/submit', { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, body: JSON.stringify({ access_key: WEB3FORMS_KEY, subject: `New funding application — ${form.business || 'Unknown business'}`, from_name: 'FastFund Website', replyto: form.email, ccemail: 'r.weber@capfrontfunding.com', 'Business name': form.business, 'Contact name': form.name, Email: form.email, Phone: form.phone, 'Time in business': form.timeInBusiness, Industry: form.industry, 'Requested amount': form.amount ? `$${form.amount}` : '', 'Monthly revenue': form.revenue, 'Use of funds': form.useOfFunds, }), }); const data = await res.json(); if (data.success) { setStatus('idle'); setStep(2); } else setStatus('error'); } catch (e) { setStatus('error'); } }; const Progress = () => (
Applying won't affect your credit score. A funding manager will follow up personally.
We'll match you with the right products from our marketplace.
Thanks{form.name ? `, ${form.name.split(' ')[0]}` : ''}. A FastFund funding manager will review your request and reach out within one business day to walk you through your options.