Add explicit contact opt-in before Resend list signup

This commit is contained in:
nmemmert
2026-04-09 16:11:49 -04:00
parent afb80aaf2a
commit d5f15486d8
3 changed files with 59 additions and 20 deletions
+27
View File
@@ -566,6 +566,33 @@
resize: vertical;
}
.contact-consent {
display: flex;
flex-direction: row;
align-items: flex-start;
gap: 0.75rem;
font-family: 'Barlow Condensed', sans-serif;
font-size: 1rem;
font-weight: 400;
letter-spacing: normal;
line-height: 1.5;
text-transform: none;
color: #d8c79e;
}
.contact-consent input {
width: 1rem;
height: 1rem;
margin-top: 0.2rem;
padding: 0;
flex: 0 0 auto;
accent-color: #c8860a;
}
.contact-consent span {
display: block;
}
.contact-form .btn-primary {
justify-content: center;
width: 100%;
+10 -1
View File
@@ -105,6 +105,7 @@ function AmazonMusicIcon() {
function ContactForm() {
const navigate = useNavigate()
const [fields, setFields] = useState({ name: '', email: '', message: '' })
const [subscribe, setSubscribe] = useState(false)
const [honey, setHoney] = useState('')
const [status, setStatus] = useState<'idle' | 'submitting' | 'error'>('idle')
const [errorMsg, setErrorMsg] = useState('')
@@ -121,7 +122,7 @@ function ContactForm() {
const res = await fetch('/api/contact', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ ...fields, _honey: honey }),
body: JSON.stringify({ ...fields, subscribe, _honey: honey }),
})
if (!res.ok) {
const data = await res.json().catch(() => ({}))
@@ -159,6 +160,14 @@ function ContactForm() {
Message
<textarea name="message" rows={6} required value={fields.message} onChange={handleChange} />
</label>
<label className="contact-consent">
<input
type="checkbox"
checked={subscribe}
onChange={e => setSubscribe(e.target.checked)}
/>
<span>Send me updates from Verse by Verse with Nate. I can unsubscribe anytime.</span>
</label>
{status === 'error' && <p className="contact-error">{errorMsg}</p>}
<button type="submit" className="btn-primary" disabled={status === 'submitting'}>
{status === 'submitting' ? 'Sending…' : 'Send Message'}