Skip to content

Commit

Permalink
Merge pull request #46 from z-vr/feature/webpack-pr
Browse files Browse the repository at this point in the history
Feature/webpack pr
  • Loading branch information
tbleckert authored Feb 13, 2018
2 parents 7086177 + f0abab6 commit aa185fc
Show file tree
Hide file tree
Showing 22 changed files with 5,295 additions and 2,204 deletions.
21 changes: 19 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,21 @@
{
"presets": ["es2015", "react"],
"plugins": ["transform-class-properties"]
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
],
"env": {
"production": {
"plugins": [
[
"transform-react-remove-prop-types",
{
"removeImport": true
}
]
]
}
}
}
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
node_modules
npm-debug.log
.DS_Store
yarn-error.log
.vscode
127 changes: 62 additions & 65 deletions dist/ActionButton.react.js
Original file line number Diff line number Diff line change
@@ -1,85 +1,82 @@
'use strict';
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
value: true
});
exports.default = void 0;

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _react = _interopRequireDefault(require("react"));

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _propTypes = require('prop-types');

var _propTypes2 = _interopRequireDefault(_propTypes);
var _propTypes = _interopRequireDefault(require("prop-types"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }

var defaultProps = {
onClick: function onClick() {},
className: 'btn',
url: null
};
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }

var propTypes = {
onClick: _propTypes2.default.func,
className: _propTypes2.default.string,
children: _propTypes2.default.node.isRequired,
url: _propTypes2.default.string
};
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, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var Component = function (_React$Component) {
_inherits(Component, _React$Component);
var Component =
/*#__PURE__*/
function (_React$Component) {
_inherits(Component, _React$Component);

function Component() {
_classCallCheck(this, Component);
function Component() {
_classCallCheck(this, Component);

return _possibleConstructorReturn(this, (Component.__proto__ || Object.getPrototypeOf(Component)).apply(this, arguments));
return _possibleConstructorReturn(this, (Component.__proto__ || Object.getPrototypeOf(Component)).apply(this, arguments));
}

_createClass(Component, [{
key: "handleClick",
value: function handleClick() {
return this.props.onClick();
}
}, {
key: "render",
value: function render() {
var _this = this;

var className = this.props.className;

if (this.props.url && this.props.url !== '#') {
return _react.default.createElement("a", {
href: this.props.url,
target: "_blank",
className: className
}, this.props.children);
}

return _react.default.createElement("button", {
onClick: function onClick() {
return _this.handleClick();
},
className: className
}, this.props.children);
}
}]);

_createClass(Component, [{
key: 'handleClick',
value: function handleClick() {
return this.props.onClick();
}
}, {
key: 'render',
value: function render() {
var _this2 = this;

var className = this.props.className;


if (this.props.url && this.props.url !== '#') {
return _react2.default.createElement(
'a',
{ href: this.props.url, target: '_blank', className: className },
this.props.children
);
}

return _react2.default.createElement(
'button',
{ onClick: function onClick() {
return _this2.handleClick();
}, className: className },
this.props.children
);
}
}]);

return Component;
}(_react2.default.Component);
return Component;
}(_react.default.Component);

Component.displayName = 'PopupAction';
Component.propTypes = propTypes;
Component.defaultProps = defaultProps;

exports.default = Component;
Component.propTypes = {
onClick: _propTypes.default.func,
className: _propTypes.default.string,
children: _propTypes.default.node.isRequired,
url: _propTypes.default.string
};
Component.defaultProps = {
onClick: function onClick() {},
className: 'btn',
url: null
};
var _default = Component;
exports.default = _default;
Loading

0 comments on commit aa185fc

Please sign in to comment.