diff --git a/dist/main.js b/dist/main.js index dae33b8..5e30708 100644 --- a/dist/main.js +++ b/dist/main.js @@ -18,6 +18,8 @@ var _propTypes2 = _interopRequireDefault(_propTypes); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; } + 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; } @@ -184,12 +186,23 @@ var Identicon = function (_Component) { value: function render() { var _this2 = this; - return _react2.default.createElement('canvas', { + var _props = this.props, + seed = _props.seed, + size = _props.size, + scale = _props.scale, + color = _props.color, + bgColor = _props.bgColor, + spotColor = _props.spotColor, + extraProps = _objectWithoutProperties(_props, ['seed', 'size', 'scale', 'color', 'bgColor', 'spotColor']); + + return _react2.default.createElement('canvas', _extends({ ref: function ref(identicon) { _this2.identicon = identicon; }, - className: 'identicon' - }); + className: 'identicon', + 'aria-label': 'Identicon', + role: 'img' + }, extraProps)); } }]); diff --git a/src/main.jsx b/src/main.jsx index ff91a67..cdeb077 100644 --- a/src/main.jsx +++ b/src/main.jsx @@ -148,10 +148,14 @@ export default class Identicon extends Component { } render() { + const { seed, size, scale, color, bgColor, spotColor, ...extraProps } = this.props return ( { this.identicon = identicon; }} className="identicon" + aria-label="Identicon" + role="img" + {...extraProps} /> ); }