Skip to content
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

creating a contact page and hubspot form #9666

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

creating a contact page and hubspot form #9666

wants to merge 5 commits into from

Conversation

thib-martin
Copy link
Contributor

@thib-martin thib-martin commented Dec 31, 2024

Description

Adding a contact form that feeds directly into hubspot & changing to 'trusted by 1000+ organizations'.

For now, this is just a silent release (only accessible via dust.tt/home/contact url). I'd like to release it now to test it. We'll then finalize the form directly in hubspot, and add/change hyperlinks everywhere as we land.

image

@thib-martin
Copy link
Contributor Author

@ameliedrhub FYI
@JulesBelveze I have a few react hydration issues I may need your help with when you're back ;)

thib-martin and others added 3 commits December 31, 2024 10:48
 - Implement React state for mounting the HubSpot form component
 - Introduce TypeScript declaration to extend the global window object for hbspt forms
 - Modify script loading and unloading for the HubSpot form to improve performance and cleanup
 - Ensure the form only renders on the client side to align with its JavaScript requirements

[front/pages/home] - refactor: adjust contact page layout and remove unused imports

 - Simplify the contact page layout by removing nested divs around the HubSpotForm
 - Remove an unused useState import and adjust import ordering for consistency
 - Fix the layout for the subtitle section in the HeaderContentBlock component
 - Add proper paragraph formatting for the subtitle text for better readability
Comment on lines +23 to +37
useEffect(() => {
setIsMounted(true);
const script = document.createElement("script");
script.src = "//js-eu1.hsforms.net/forms/embed/v2.js";
script.async = true;
script.onload = () => {
if (window.hbspt) {
window.hbspt.forms.create({
region: "eu1",
portalId: "144442587",
formId: "7cc5ca02-5547-42ca-98b5-80e5e3c422eb",
target: "#hubspotForm",
});
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lib react-hubspot-form with a component for it no?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like last release was 6 years ago though..


useEffect(() => {
setIsMounted(true);
const script = document.createElement("script");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is very likely to cause a hydratation error indeed

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defs

@aubin-tchoi
Copy link
Contributor

Will try it out and come up with a suggestion tomorrow 👍

@thib-martin
Copy link
Contributor Author

@aubin-tchoi @JulesBelveze any solution here? or is it painful? :)

@aubin-tchoi
Copy link
Contributor

damn I can't seem to get it to work...

@aubin-tchoi
Copy link
Contributor

@JulesBelveze will let you give it a try 😇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants