Skip to content

Instantly share code, notes, and snippets.

@francisrstokes
Created July 12, 2019 08:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save francisrstokes/38256e992e48091c0f9dab5e77a40816 to your computer and use it in GitHub Desktop.
Save francisrstokes/38256e992e48091c0f9dab5e77a40816 to your computer and use it in GitHub Desktop.
PipeDrive Web Forms React Component
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