@pga/react-intercom
Advanced tools
Comparing version 0.1.0-alpha.1 to 0.1.0-alpha.2
@@ -19,3 +19,3 @@ (function (global, factory) { | ||
}); | ||
exports.IntercomAPI = undefined; | ||
exports.Intercom = exports.IntercomAPI = undefined; | ||
@@ -52,3 +52,3 @@ var _extends3 = _interopRequireDefault(_extends2); | ||
var Intercom = function (_React$Component) { | ||
var Intercom = exports.Intercom = function (_React$Component) { | ||
(0, _inherits3.default)(Intercom, _React$Component); | ||
@@ -66,5 +66,7 @@ | ||
appId = _props.appId, | ||
data = _props.data; | ||
data = _props.data, | ||
_props$intercom = _props.intercom, | ||
intercom = _props$intercom === undefined ? IntercomAPI : _props$intercom; | ||
IntercomAPI('boot', (0, _extends3.default)({ app_id: appId }, data)); | ||
intercom('boot', (0, _extends3.default)({ app_id: appId }, data)); | ||
} | ||
@@ -82,4 +84,8 @@ }, { | ||
var _props$intercom2 = this.props.intercom, | ||
intercom = _props$intercom2 === undefined ? IntercomAPI : _props$intercom2; | ||
if (currentURL && previousURL && currentURL !== previousURL) { | ||
IntercomAPI('update'); | ||
intercom('update'); | ||
} | ||
@@ -86,0 +92,0 @@ } |
{ | ||
"name": "@pga/react-intercom", | ||
"version": "0.1.0-alpha.1", | ||
"version": "0.1.0-alpha.2", | ||
"description": "React Intercom Component", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"build": "./node_modules/.bin/babel ./src -d dist --ignore test.js,setupTests.js,mock.js" | ||
"build": "./node_modules/.bin/babel ./src -d dist --ignore test.js,setupTests.js,mock.js", | ||
"lint": "npx standard", | ||
"test": "jest --env=jsdom" | ||
}, | ||
@@ -30,4 +32,11 @@ "devDependencies": { | ||
}, | ||
"jest": { | ||
"setupFiles": [ | ||
"<rootDir>/src/setupTests.js" | ||
], | ||
"testEnvironment": "jsdom", | ||
"testURL": "https://pga.org" | ||
}, | ||
"author": "", | ||
"license": "ISC" | ||
} |
@@ -12,6 +12,6 @@ import React from 'react' | ||
class Intercom extends React.Component { | ||
export class Intercom extends React.Component { | ||
componentDidMount () { | ||
const { appId, data } = this.props | ||
IntercomAPI('boot', { app_id: appId, ...data }) | ||
const { appId, data, intercom = IntercomAPI } = this.props | ||
intercom('boot', { app_id: appId, ...data }) | ||
} | ||
@@ -22,5 +22,6 @@ | ||
const { pathname: currentURL } = this.props.location || {} | ||
const { intercom = IntercomAPI } = this.props | ||
if (currentURL && previousURL && currentURL !== previousURL) { | ||
IntercomAPI('update') | ||
intercom('update') | ||
} | ||
@@ -27,0 +28,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7178
6
135