Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #357 from SimeonC/master
Browse files Browse the repository at this point in the history
Version 2.6.0 PR
  • Loading branch information
SimeonC committed Mar 23, 2019
2 parents 9db518c + 8de4f91 commit ba79459
Show file tree
Hide file tree
Showing 18 changed files with 5,647 additions and 4,496 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,6 +1,6 @@
{
"name": "react-ga",
"version": "2.5.7",
"version": "2.6.0",
"homepage": "https://github.com/react-ga/react-ga",
"authors": [
"Tay Yang Shun <tay.yang.shun@gmail.com>"
Expand Down
2 changes: 2 additions & 0 deletions core.d.ts
@@ -0,0 +1,2 @@
export { default as default } from "./types/index";
export * from "./types/index";
3 changes: 3 additions & 0 deletions core.js
@@ -0,0 +1,3 @@
const index = require('./dist/react-ga-core');

module.exports = index.default;
19 changes: 11 additions & 8 deletions dist/esm/components/OutboundLink.js
Expand Up @@ -16,12 +16,12 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===

function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }

function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }

function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }

import React, { Component } from 'react';
Expand All @@ -48,12 +48,13 @@ function (_Component) {

_this = _possibleConstructorReturn(this, (_getPrototypeOf2 = _getPrototypeOf(OutboundLink)).call.apply(_getPrototypeOf2, [this].concat(args)));

_defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "handleClick", function (event) {
_defineProperty(_assertThisInitialized(_this), "handleClick", function (event) {
var _this$props = _this.props,
target = _this$props.target,
eventLabel = _this$props.eventLabel,
to = _this$props.to,
onClick = _this$props.onClick;
onClick = _this$props.onClick,
trackerNames = _this$props.trackerNames;
var eventMeta = {
label: eventLabel
};
Expand All @@ -64,9 +65,9 @@ function (_Component) {
event.preventDefault();
OutboundLink.trackLink(eventMeta, function () {
window.location.href = to;
});
}, trackerNames);
} else {
OutboundLink.trackLink(eventMeta, function () {});
OutboundLink.trackLink(eventMeta, function () {}, trackerNames);
}

if (onClick) {
Expand Down Expand Up @@ -109,13 +110,15 @@ _defineProperty(OutboundLink, "propTypes", {
eventLabel: PropTypes.string.isRequired,
target: PropTypes.string,
to: PropTypes.string,
onClick: PropTypes.func
onClick: PropTypes.func,
trackerNames: PropTypes.arrayOf(PropTypes.string)
});

_defineProperty(OutboundLink, "defaultProps", {
target: null,
to: null,
onClick: null
onClick: null,
trackerNames: null
});

export { OutboundLink as default };

0 comments on commit ba79459

Please sign in to comment.