Current Behavior
At least 3 distinct form components (src/components/CommonForm/events.js, src/components/CommonForm/index.js, and src/components/ContactForm/index.js) copy-paste the exact same hardcoded Make (Integromat) webhook URL (https://hook.us1.make.com/...) and the same unhandled axios.post logic inside a useEffect. This duplication violates DRY principles, makes the webhook URL painful to rotate, and copies identical bugs (like missing error handling and race conditions) across multiple pages.
Desired Behavior
Eliminate the redundant, error-prone webhook posting logic duplicated across the application's forms by abstracting it. We need a custom React hook (e.g., useWebhookSubmit) that encapsulates the axios request, manages isSubmitting and error states automatically, and handles the actual form payload submission. The hardcoded URL should also ideally be extracted into an environment variable.
Screenshots / Mockups
N/A — This is a code refactoring and technical debt issue.
Implementation
- Create a new hook at
src/utils/hooks/useWebhookSubmit.js to encapsulate the axios.post request.
- Rewrite src/components/CommonForm/events.js to remove the
useEffect and instead use the new hook inside the Formik onSubmit handler.
- Rewrite src/components/CommonForm/index.js to use the new hook.
- Rewrite src/components/ContactForm/index.js to use the new hook.
- In all three forms, ensure that the UI only advances to the "Thank You" step (e.g.,
setStepNumber(1)) if the hook returns a successful HTTP response.
Acceptance Tests

Contributor Resources and Handbook
The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.
Join the Layer5 Community by submitting your community member form.
Current Behavior
At least 3 distinct form components (src/components/CommonForm/events.js, src/components/CommonForm/index.js, and src/components/ContactForm/index.js) copy-paste the exact same hardcoded Make (Integromat) webhook URL (
https://hook.us1.make.com/...) and the same unhandledaxios.postlogic inside auseEffect. This duplication violates DRY principles, makes the webhook URL painful to rotate, and copies identical bugs (like missing error handling and race conditions) across multiple pages.Desired Behavior
Eliminate the redundant, error-prone webhook posting logic duplicated across the application's forms by abstracting it. We need a custom React hook (e.g.,
useWebhookSubmit) that encapsulates theaxiosrequest, managesisSubmittinganderrorstates automatically, and handles the actual form payload submission. The hardcoded URL should also ideally be extracted into an environment variable.Screenshots / Mockups
N/A — This is a code refactoring and technical debt issue.
Implementation
src/utils/hooks/useWebhookSubmit.jsto encapsulate theaxios.postrequest.useEffectand instead use the new hook inside the FormikonSubmithandler.setStepNumber(1)) if the hook returns a successful HTTP response.Acceptance Tests
useWebhookSubmithook instead of duplicateaxioscalls.isSubmittingstate to disable the submit button and prevent duplicate entries while the request is in flight.useWebhookSubmithook tracking success and failure states.Contributor Resources and Handbook
The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the
masterbranch.