Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pinwheel/react-modal

Package Overview
Dependencies
Maintainers
17
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pinwheel/react-modal - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

27

dist/index.js

@@ -18,2 +18,13 @@ var React = require('react');

var addScriptTag = function addScriptTag(loadCb, url) {
var tag = document.createElement('script');
tag.async = true;
tag.type = 'application/javascript';
tag.src = url || 'https://cdn.getpinwheel.com/pinwheel-v1.js';
document.body.appendChild(tag);
tag.addEventListener('load', function () {
return loadCb();
});
};
var PinwheelModal = function PinwheelModal(_ref) {

@@ -33,12 +44,14 @@ var open = _ref.open,

React.useEffect(function () {
var tag = document.createElement('script');
tag.async = true;
tag.type = 'application/javascript';
tag.src = _srcUrl || 'https://cdn.getpinwheel.com/pinwheel-v1.js';
document.body.appendChild(tag);
tag.addEventListener('load', function () {
addScriptTag(function () {
return setLoaded(true);
});
}, _srcUrl);
}, [setLoaded]);
React.useEffect(function () {
delete window['Pinwheel'];
setLoaded(false);
addScriptTag(function () {
return setLoaded(true);
}, _srcUrl);
}, [_srcUrl, setLoaded]);
React.useEffect(function () {
if (!loaded) return;

@@ -45,0 +58,0 @@

@@ -18,2 +18,13 @@ import { useState, useEffect, createElement } from 'react';

var addScriptTag = function addScriptTag(loadCb, url) {
var tag = document.createElement('script');
tag.async = true;
tag.type = 'application/javascript';
tag.src = url || 'https://cdn.getpinwheel.com/pinwheel-v1.js';
document.body.appendChild(tag);
tag.addEventListener('load', function () {
return loadCb();
});
};
var PinwheelModal = function PinwheelModal(_ref) {

@@ -33,12 +44,14 @@ var open = _ref.open,

useEffect(function () {
var tag = document.createElement('script');
tag.async = true;
tag.type = 'application/javascript';
tag.src = _srcUrl || 'https://cdn.getpinwheel.com/pinwheel-v1.js';
document.body.appendChild(tag);
tag.addEventListener('load', function () {
addScriptTag(function () {
return setLoaded(true);
});
}, _srcUrl);
}, [setLoaded]);
useEffect(function () {
delete window['Pinwheel'];
setLoaded(false);
addScriptTag(function () {
return setLoaded(true);
}, _srcUrl);
}, [_srcUrl, setLoaded]);
useEffect(function () {
if (!loaded) return;

@@ -45,0 +58,0 @@

{
"name": "@pinwheel/react-modal",
"version": "1.0.2",
"version": "1.0.3",
"description": "React package for Pinwheel modal",

@@ -5,0 +5,0 @@ "author": "roscioli",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc