Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@eventespresso/react-exit-modal-typeform
Advanced tools
React component that allows the triggering of an typeform form via modal
This is a react component that provides an embedded typeform for use a exit modal survey. Use-cases are:
The modal that opens has an initial "options" view where the user is presented with two buttons. One to fill out a survey, and another to skip the survey. Skipping the survey will continue on with the original action triggered. If they choose to fill out a survey, then the next view in the modal will present them with an embedded typeform to fill out.
Install the module
npm install @eventespresso/react-exit-modal-typeform
A very basic usage example (triggering outside react):
import React from 'react';
import ReactDOM from 'react-dom';
import $ from 'jquery';
import ReactModal from 'react-modal';
import ExitModal, { CLOSE_MODAL_EVENT } from '@eventespresso/react-exit-modal-typeform';
const modalProps = {
typeFormUrl: 'https://yourtypeformdomain.typeform.com/to/XXXXX'
}
/**
* Element that the modal is anchored to
*/
const modalAnchor = document.getElementById('react-cancel-modal');
let modalComponent = {};
const closeModalCallback = (e) => {
//do stuff that happens after the modal closes, eg continue with a subscription cancel action etc.
processSubscriptionCancel();
//make sure you remove the event listener.
modalComponent.el.removeEventListener(CLOSE_MODAL_EVENT, closeModalCallback);
};
$('.some-dom-element-trigger-container').on('click', '.element-clicked', function(e) {
e.preventDefault();
ReactModal.setAppElement(modalAnchor);
modalComponent = ReactDOM.render(
<ExitModal {...modalProps} />,
modalAnchor
);
//set listener
formContainer.el.addEventListener(
CLOSE_MODAL_EVENT,
closeModalCallback,
false
);
});
There are a number of properties you can use to control the ExitModal. The only required property is the typeFormUrl
property.
Property | Type | Description |
---|---|---|
showModal | bool | Whether to initialize with the modal open or not. |
showTypeForm | bool | Whether to display the typeForm right away or not. |
styles | object | You set inline styles for the modal via this property. |
styles.overlay | object | Inline styles for the overlay when the modal is open. Use javascript DOM style notation for the keys. Note: It's recommended you use modalClassName and style via css class instead. However inline styles are provided for cases where style attributes may be dynamically calculated. |
styles.content | object | Inline styles for the modal content container. |
modalClassName | object | Provide css class to use with styling. |
modalClassName.content | string | CSS classname to use for the modal content container. |
modalClassName.overlay | string | CSS classname to use for the modal overlay. |
typeFormUrl | string | required The url to your TypeForm that will be embedded in the modal content. |
introText | string | Text displayed in the initial view. Defaults to We're sorry to see you go! Will you share feedback through a short survey to help us improve our product? |
skipButtonText | string | Skip button text. Defaults to Skip |
doSurveyButtonText | string | Start survey button text. Defaults to Sure I'll help! |
FAQs
React component that allows the triggering of an typeform form via modal
We found that @eventespresso/react-exit-modal-typeform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.