Skip to content

Commit

Permalink
adds window fix react-typeform
Browse files Browse the repository at this point in the history
  • Loading branch information
oovg committed Jun 5, 2019
1 parent 49fba41 commit 8cbf5e8
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 2 deletions.
16 changes: 16 additions & 0 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,19 @@
*/

// You can delete this file if you're not using it


exports.onCreateWebpackConfig = ({ stage, loaders, actions }) => {
if (stage === "build-html") {
actions.setWebpackConfig({
module: {
rules: [
{
test: /@typeform/,
use: loaders.null(),
},
],
},
})
}
}
18 changes: 16 additions & 2 deletions src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ import React from 'react'
import { Link } from 'gatsby'

import Layout from '../components/layout/layout'

import '../styles/global.scss';
import { ReactTypeformEmbed } from 'react-typeform-embed'


import '../styles/global.scss';

class IndexPage extends React.Component {
state = {
open: false
}

openForm = () => {
this.typeformEmbed.typeform.open();
}

render () {
return (
Expand All @@ -25,6 +32,13 @@ class IndexPage extends React.Component {
<h2>Block #2</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<button className="button" onClick={this.openForm}>Join Us</button>
<ReactTypeformEmbed
url={'https://ven386248.typeform.com/to/rEhanV'}
popup={true}
autoOpen={false}
style={{height: '0%'}}
ref={(tf => this.typeformEmbed = tf) }
/>
</div>
</div>
<div className="Block">
Expand Down
1 change: 1 addition & 0 deletions src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ button, .button {
-webkit-appearance: none;
border: none;
background: none;
outline: none;
// style
color: white;
padding: 10px 30px;
Expand Down

0 comments on commit 8cbf5e8

Please sign in to comment.