Created
July 12, 2019 08:47
-
-
Save francisrstokes/38256e992e48091c0f9dab5e77a40816 to your computer and use it in GitHub Desktop.
PipeDrive Web Forms React Component
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
import React from 'react'; | |
class PipeDriveForm extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
randomId: 'id' + Math.random().toString(36).substring(7) | |
}; | |
} | |
render() { | |
return ( | |
<div | |
className="pipedriveWebForms" | |
data-pd-webforms={`https://pipedrivewebforms.com/form/${this.props.formId}`} | |
id={this.state.randomId} | |
style={{ | |
width: '100%', | |
height: '100%', | |
overflow: 'hidden', | |
minWidth: '320px', | |
position: 'relative', | |
}} | |
> | |
<iframe | |
src={`https://pipedrivewebforms.com/form/${this.props.formId}?embeded=1&uuid=${this.state.randomId}`} | |
name={`${window.document.URL}-${this.state.randomId}`} | |
scrolling="no" | |
seamless="seamless" | |
style={{ | |
border: 'none', | |
overflow: 'hidden', | |
width: '100%', | |
maxWidth: '768px', | |
minWidth: '320px', | |
height: '100%', | |
position: 'relative', | |
}} | |
/> | |
</div> | |
); | |
} | |
} | |
export default PipeDriveForm; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment