Skip to content

Commit

Permalink
Load ActionNetwork contact form script later to try to avoid occasion…
Browse files Browse the repository at this point in the history
…al issues where it doesn't render
  • Loading branch information
asibs committed Jul 13, 2023
1 parent 803ae6e commit 7d2122e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/ActionNetworkContactForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function ActionNetworkContactForm() {
<div className="row">
<div className="col-12 col-sm-8 col-xl-6 col-xxl-5">
<link href='https://actionnetwork.org/css/style-embed-whitelabel-v3.css' rel='stylesheet' type='text/css' />
<Script src='https://actionnetwork.org/widgets/v5/form/stop-the-tories?format=js&source=widget' />

<div id='can-form-area-stop-the-tories' style={{ width: "100%" }}>
{/* this div is the target for our HTML insertion */}
</div>
Expand Down Expand Up @@ -150,6 +150,9 @@ export default function ActionNetworkContactForm() {
/*********EMBEDS*********/
/************************/
`}</style>

{/* this script will populate the #can-form-area-stop-the-tories div, but needs to be loaded after other content */}
<Script src='https://actionnetwork.org/widgets/v5/form/stop-the-tories?format=js&source=widget' strategy="lazyOnload" />
</div>
</div>
</div>
Expand Down

1 comment on commit 7d2122e

@vercel
Copy link

@vercel vercel bot commented on 7d2122e Jul 13, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.