-
-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add code_platoon subpage and fix code review issues
- Loading branch information
Showing
2 changed files
with
56 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import Head from 'components/head'; | ||
import Container from 'components/Container/Container'; | ||
import HeroBanner from 'components/HeroBanner/HeroBanner'; | ||
import { useEffect } from 'react'; | ||
|
||
const pageTitle = 'Code Platoon X Operation Code Bootcamp Scholarship'; | ||
|
||
export default function CodePlatoonScholarshipPage() { | ||
useEffect(() => { | ||
const script = document.createElement('script'); | ||
script.src = 'https://js.hsforms.net/forms/embed/v2.js'; | ||
document.body.appendChild(script); | ||
|
||
const tryRunInit = () => { | ||
// @ts-expect-error - Undefined window property | ||
if (window.hbspt) { | ||
// @ts-expect-error - Undefined window property | ||
window.hbspt.forms.create({ | ||
region: 'na1', | ||
portalId: '42378306', | ||
formId: '661176d6-1794-47a1-b627-46c853c747f5', | ||
target: '#oc-hubspot-form', | ||
}) as () => void; | ||
return; | ||
} | ||
|
||
// Recursive call to tryRunInit until window.hbspt is defined | ||
setTimeout(tryRunInit, 500); | ||
}; | ||
|
||
tryRunInit(); | ||
}, []); | ||
|
||
return ( | ||
<> | ||
<Head title={pageTitle} /> | ||
<HeroBanner title={pageTitle} className="min-h-[40vh]" /> | ||
<Container theme="white" className="pb-8"> | ||
<div id="oc-hubspot-form" className="w-full" /> | ||
</Container> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters