Removing icons in favor of icon font

This commit is contained in:
James Barnsley
2018-05-13 16:03:51 +12:00
parent d5108822a6
commit 9d398e53c9
87 changed files with 985 additions and 9515 deletions

View File

@ -973,7 +973,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/***/ (function(module, exports, __webpack_require__) {
"use strict";
/* WEBPACK VAR INJECTION */(function($) {
Object.defineProperty(exports, "__esModule", {
value: true
@ -990,7 +990,6 @@ exports.dragStart = dragStart;
exports.dragActive = dragActive;
exports.dragEnd = dragEnd;
exports.set = set;
exports.getIcon = getIcon;
exports.openModal = openModal;
exports.closeModal = closeModal;
exports.createBrowserNotification = createBrowserNotification;
@ -1126,30 +1125,6 @@ function set(data) {
};
}
function getIcon(name) {
return function (dispatch, getState) {
var config = {
method: 'GET',
timeout: 15000,
url: 'assets/icons/' + name + '.svg'
};
$.ajax(config).then(function (response) {
dispatch({
type: 'ICON_LOADED',
key: name,
icon: new XMLSerializer().serializeToString(response)
});
}, function (xhr, status, error) {
dispatch(handleException('Could not load ' + name + ' icon', {
config: config,
xhr: xhr,
status: status,
error: error
}));
});
};
}
/**
* Modal
*
@ -1306,7 +1281,6 @@ function processFinished(key) {
key: key
};
}
/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(19)))
/***/ }),
/* 5 */
@ -4215,20 +4189,6 @@ var _react = __webpack_require__(0);
var _react2 = _interopRequireDefault(_react);
var _reactRedux = __webpack_require__(3);
var _redux = __webpack_require__(2);
var _helpers = __webpack_require__(1);
var helpers = _interopRequireWildcard(_helpers);
var _actions = __webpack_require__(4);
var uiActions = _interopRequireWildcard(_actions);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@ -4247,53 +4207,21 @@ var Icon = function (_React$Component) {
}
_createClass(Icon, [{
key: 'componentDidMount',
value: function componentDidMount() {
if (!this.props.icons[this.props.name]) {
this.props.uiActions.getIcon(this.props.name);
}
}
}, {
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(newProps) {
if (this.props.name !== newProps.name && !newProps.icons[newProps.name]) {
this.props.uiActions.getIcon(newProps.name);
}
}
}, {
key: 'render',
value: function render() {
var className = 'icon';
var className = 'icon icon-' + this.props.name;
if (this.props.className) {
className += ' ' + this.props.className;
}
var svg = '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve"></svg>';
if (this.props.icons[this.props.name]) {
svg = this.props.icons[this.props.name];
}
return _react2.default.createElement('span', { className: className, dangerouslySetInnerHTML: { __html: svg } });
return _react2.default.createElement('i', { className: className });
}
}]);
return Icon;
}(_react2.default.Component);
var mapStateToProps = function mapStateToProps(state, ownProps) {
return {
icons: state.ui.icons ? state.ui.icons : {}
};
};
var mapDispatchToProps = function mapDispatchToProps(dispatch) {
return {
uiActions: (0, _redux.bindActionCreators)(uiActions, dispatch)
};
};
exports.default = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps)(Icon);
exports.default = Icon;
/***/ }),
/* 14 */
@ -4406,12 +4334,12 @@ var Header = function (_React$Component) {
return _react2.default.createElement(
'header',
{ className: this.props.className ? this.props.className : null },
this.props.icon ? _react2.default.createElement(_Icon2.default, { className: 'header-icon', name: this.props.icon }) : null,
this.props.title ? _react2.default.createElement(
_react2.default.createElement(
'h1',
null,
this.props.title
) : null,
this.props.icon ? _react2.default.createElement('i', { className: "icon header-icon icon-" + this.props.icon }) : null,
this.props.title ? this.props.title : null
),
this.renderOptions()
);
}