-
Notifications
You must be signed in to change notification settings - Fork 466
Add email subscription field with popup in footer #2797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add email subscription field with popup in footer #2797
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
✅ Deploy Preview for hyprnote-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyprnote ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for howto-fix-macos-audio-selection ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| onSuccess: () => { | ||
| setPopoverOpen(false); | ||
| setEmail(""); | ||
| setSubscriptions({ | ||
| releaseNotesStable: false, | ||
| releaseNotesBeta: false, | ||
| newsletter: false, | ||
| }); | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The form field is not being reset after successful subscription. When setEmail("") is called, it only clears the email state variable, but the form's internal state (field.state.value) is not reset. After a successful subscription, the email input will still display the previously entered email address.
To fix this, reset the form state:
onSuccess: () => {
setPopoverOpen(false);
form.reset();
setEmail("");
setSubscriptions({
releaseNotesStable: false,
releaseNotesBeta: false,
newsletter: false,
});
},| onSuccess: () => { | |
| setPopoverOpen(false); | |
| setEmail(""); | |
| setSubscriptions({ | |
| releaseNotesStable: false, | |
| releaseNotesBeta: false, | |
| newsletter: false, | |
| }); | |
| }, | |
| onSuccess: () => { | |
| setPopoverOpen(false); | |
| form.reset(); | |
| setEmail(""); | |
| setSubscriptions({ | |
| releaseNotesStable: false, | |
| releaseNotesBeta: false, | |
| newsletter: false, | |
| }); | |
| }, |
Spotted by Graphite Agent
Is this helpful? React 👍 or 👎 to let us know.
4c175db to
3f8ffa3
Compare
05ad1b9 to
15e1de4
Compare
15e1de4 to
06cef85
Compare
Add email subscription field with popup in footer
Summary
Adds an email subscription input to the website footer's brand section. When a user enters their email and submits, a popover expands showing checkboxes for subscription preferences:
The subscription data is sent to Loops with the new preference fields (
releaseNotesStable,releaseNotesBeta,newsletter).Updates since last revision
Review & Testing Checklist for Human
releaseNotesStable,releaseNotesBeta, andnewsletterfields exist in your Loops contact schema. If not configured, these values may be silently ignored.max-w-[220px]which may need adjustment on smaller screensRecommended test plan:
Notes
addContactfunction from@/functions/loopswith extended schemaCheckbox,Popover) from@hypr/uiLink to Devin run: https://app.devin.ai/sessions/f88d8a8bafa04089ae20a4897504f1e2
Requested by: [email protected] (@ComputelessComputer)