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

Add gophercon subscribe form #162

Merged
merged 1 commit into from
Jul 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions website/src/css/pages/_blog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,46 @@
cursor: auto;
}
}

.subscription-grid {
display: grid;
grid-template-columns: 30% 70%;
max-width: 990px;
}

.grid-item-1 {
grid-column-start: 2;
grid-column-end: 2;
grid-row-start: 1;
grid-row-end: 1;
}

.grid-item-2 {
grid-column-start: 1;
grid-column-end: 1;
grid-row-start: 1;
grid-row-end: 1;
}

.grid-image {
height: 100%;
width: 100%;
}
}

@media (max-width: 1200px) {
.blog {
.subscription-grid {
display: block;
}
.grid-item-2 {
display: none;
}
}
}

#gopherConForm {
justify-content: center;
}

table {
Expand Down
29 changes: 27 additions & 2 deletions website/src/pages/go.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ import BlogHeadLinks from '../components/BlogHeadLinks'
import BlogPosts from '../components/BlogPosts'
import Layout from '../components/Layout'
export default class GoList extends React.Component<any, any> {
constructor(props: any) {
super(props)
public componentDidMount(): void {
const script = document.createElement('script')
script.src = '//js.hsforms.net/forms/v2.js'
const hubspot = document.getElementById('gopherConForm')
hubspot.appendChild(script)
script.addEventListener('load', () => {
;(window as any).hbspt.forms.create({
portalId: '2762526',
formId: '9cfe9111-fe45-45f5-873a-9f4925affdfd',
target: '#gopherConForm',
})
})
}

public render(): JSX.Element | null {
Expand All @@ -32,7 +42,22 @@ export default class GoList extends React.Component<any, any> {
<div className="blog blog__head">
<h1>Plain Text</h1>
<BlogHeadLinks />
<div className="container subscription-grid">
<div className="grid-item-1 flex-0 rounded rounded-lg py-4 px-6 bg-white h-100">
<h4>Subscribe to the GopherCon 2019 Liveblog</h4>
<p>Get notified as each post goes live.</p>
<div className="form-area">
<div className="form">
<div id="gopherConForm" className="d-flex justify-center" />
</div>
</div>
</div>
<div className="grid-item-2">
<img className="grid-image" height="270" width="270" src="/gophercon2019.png"></img>
</div>
</div>
</div>

<BlogPosts blogType="go" posts={goPosts} />
</div>
</div>
Expand Down