diff --git a/src/core/plugins/auth/components/lock-auth-icon.jsx b/src/core/plugins/auth/components/lock-auth-icon.jsx new file mode 100644 index 00000000000..13c59472919 --- /dev/null +++ b/src/core/plugins/auth/components/lock-auth-icon.jsx @@ -0,0 +1,27 @@ +/** + * @prettier + */ +import React from "react" +import PropTypes from "prop-types" +import omit from "lodash/omit" + +class LockAuthIcon extends React.Component { + mapStateToProps(state, props) { + const ownProps = omit(props, Object.keys(props.getSystem())) + return { state, ownProps } + } + + render() { + const { getComponent, ownProps } = this.props + const LockIcon = getComponent("LockIcon") + + return + } +} + +LockAuthIcon.propTypes = { + getComponent: PropTypes.func.isRequired, + ownProps: PropTypes.shape({}).isRequired, +} + +export default LockAuthIcon diff --git a/src/core/plugins/auth/components/lock-auth-operation.jsx b/src/core/plugins/auth/components/lock-auth-operation.jsx deleted file mode 100644 index 85fe02a335f..00000000000 --- a/src/core/plugins/auth/components/lock-auth-operation.jsx +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @prettier - */ -import React from "react" -import PropTypes from "prop-types" - -const LockAuthOperation = ({ getComponent, ...props }) => { - const LockIcon = getComponent("LockIcon") - - return -} - -LockAuthOperation.propTypes = { - getComponent: PropTypes.func.isRequired -} - -export default LockAuthOperation \ No newline at end of file diff --git a/src/core/plugins/auth/components/lock-auth.jsx b/src/core/plugins/auth/components/lock-auth.jsx deleted file mode 100644 index 6cda9d08914..00000000000 --- a/src/core/plugins/auth/components/lock-auth.jsx +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @prettier - */ -import React from "react" -import PropTypes from "prop-types" - -const LockAuth = ({ getComponent, ...props }) => { - const LockIcon = getComponent("LockIcon") - - return -} - -LockAuth.propTypes = { - getComponent: PropTypes.func.isRequired -} - -export default LockAuth \ No newline at end of file diff --git a/src/core/plugins/auth/components/unlock-auth-icon.jsx b/src/core/plugins/auth/components/unlock-auth-icon.jsx new file mode 100644 index 00000000000..7611a6bc0e4 --- /dev/null +++ b/src/core/plugins/auth/components/unlock-auth-icon.jsx @@ -0,0 +1,27 @@ +/** + * @prettier + */ +import React from "react" +import PropTypes from "prop-types" +import omit from "lodash/omit" + +class UnlockAuthIcon extends React.Component { + mapStateToProps(state, props) { + const ownProps = omit(props, Object.keys(props.getSystem())) + return { state, ownProps } + } + + render() { + const { getComponent, ownProps } = this.props + const UnlockIcon = getComponent("UnlockIcon") + + return + } +} + +UnlockAuthIcon.propTypes = { + getComponent: PropTypes.func.isRequired, + ownProps: PropTypes.shape({}).isRequired, +} + +export default UnlockAuthIcon diff --git a/src/core/plugins/auth/components/unlock-auth-operation.jsx b/src/core/plugins/auth/components/unlock-auth-operation.jsx deleted file mode 100644 index b94695d6a88..00000000000 --- a/src/core/plugins/auth/components/unlock-auth-operation.jsx +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @prettier - */ -import React from "react" -import PropTypes from "prop-types" - -const UnlockAuthOperation = ({ getComponent, ...props }) => { - const UnlockIcon = getComponent("UnlockIcon") - - return -} - -UnlockAuthOperation.propTypes = { - getComponent: PropTypes.func.isRequired -} - -export default UnlockAuthOperation \ No newline at end of file diff --git a/src/core/plugins/auth/components/unlock-auth.jsx b/src/core/plugins/auth/components/unlock-auth.jsx deleted file mode 100644 index 91047e8f3b6..00000000000 --- a/src/core/plugins/auth/components/unlock-auth.jsx +++ /dev/null @@ -1,17 +0,0 @@ -/** - * @prettier - */ -import React from "react" -import PropTypes from "prop-types" - -const UnlockAuth = ({ getComponent, ...props }) => { - const UnlockIcon = getComponent("UnlockIcon") - - return -} - -UnlockAuth.propTypes = { - getComponent: PropTypes.func.isRequired -} - -export default UnlockAuth \ No newline at end of file diff --git a/src/core/plugins/auth/index.js b/src/core/plugins/auth/index.js index cdc2f249866..72e0529e495 100644 --- a/src/core/plugins/auth/index.js +++ b/src/core/plugins/auth/index.js @@ -5,10 +5,8 @@ import { execute as wrappedExecuteAction } from "./spec-extensions/wrap-actions" import { loaded as wrappedLoadedAction } from "./configs-extensions/wrap-actions" import { authorize as wrappedAuthorizeAction, logout as wrappedLogoutAction } from "./wrap-actions" -import LockAuthIcon from "./components/lock-auth" -import UnlockAuthIcon from "./components/unlock-auth" -import LockAuthOperationIcon from "./components/lock-auth-operation" -import UnlockAuthOperationIcon from "./components/unlock-auth-operation" +import LockAuthIcon from "./components/lock-auth-icon" +import UnlockAuthIcon from "./components/unlock-auth-icon" export default function() { return { @@ -21,8 +19,8 @@ export default function() { components: { LockAuthIcon: LockAuthIcon, UnlockAuthIcon: UnlockAuthIcon, - LockAuthOperationIcon: LockAuthOperationIcon, - UnlockAuthOperationIcon: UnlockAuthOperationIcon, + LockAuthOperationIcon: LockAuthIcon, + UnlockAuthOperationIcon: UnlockAuthIcon, }, statePlugins: { auth: { diff --git a/src/core/plugins/icons/components/arrow-down.jsx b/src/core/plugins/icons/components/arrow-down.jsx index 8c8fc94b2bf..8dff9423d3b 100644 --- a/src/core/plugins/icons/components/arrow-down.jsx +++ b/src/core/plugins/icons/components/arrow-down.jsx @@ -4,7 +4,7 @@ import React from "react" import PropTypes from "prop-types" -const ArrowDown = ({ className, width, height }) => ( +const ArrowDown = ({ className, width, height, ...rest }) => ( ( height={height} aria-hidden="true" focusable="false" + {...rest} > - + ) @@ -30,4 +31,4 @@ ArrowDown.defaultProps = { height: 20, } -export default ArrowDown \ No newline at end of file +export default ArrowDown diff --git a/src/core/plugins/icons/components/arrow-up.jsx b/src/core/plugins/icons/components/arrow-up.jsx index 42ca07e395c..ff6336fb434 100644 --- a/src/core/plugins/icons/components/arrow-up.jsx +++ b/src/core/plugins/icons/components/arrow-up.jsx @@ -4,7 +4,7 @@ import React from "react" import PropTypes from "prop-types" -const ArrowUp = ({ className, width, height }) => ( +const ArrowUp = ({ className, width, height, ...rest }) => ( ( height={height} aria-hidden="true" focusable="false" + {...rest} > - + ) @@ -30,4 +31,4 @@ ArrowUp.defaultProps = { height: 20, } -export default ArrowUp \ No newline at end of file +export default ArrowUp diff --git a/src/core/plugins/icons/components/arrow.jsx b/src/core/plugins/icons/components/arrow.jsx index 0209f65848d..144d20bb56e 100644 --- a/src/core/plugins/icons/components/arrow.jsx +++ b/src/core/plugins/icons/components/arrow.jsx @@ -4,7 +4,7 @@ import React from "react" import PropTypes from "prop-types" -const Arrow = ({ className, width, height }) => ( +const Arrow = ({ className, width, height, ...rest }) => ( ( height={height} aria-hidden="true" focusable="false" + {...rest} > - + ) @@ -30,4 +31,4 @@ Arrow.defaultProps = { height: 20, } -export default Arrow \ No newline at end of file +export default Arrow diff --git a/src/core/plugins/icons/components/close.jsx b/src/core/plugins/icons/components/close.jsx index 7e446b7500c..f86a309a5ba 100644 --- a/src/core/plugins/icons/components/close.jsx +++ b/src/core/plugins/icons/components/close.jsx @@ -4,30 +4,31 @@ import React from "react" import PropTypes from "prop-types" -const Close = ({ className, width, height }) => ( - +const Close = ({ className, width, height, ...rest }) => ( + ) Close.propTypes = { - className: PropTypes.string, - width: PropTypes.string, - height: PropTypes.string, + className: PropTypes.string, + width: PropTypes.string, + height: PropTypes.string, } Close.defaultProps = { - className: null, - width: 20, - height: 20, + className: null, + width: 20, + height: 20, } -export default Close \ No newline at end of file +export default Close diff --git a/src/core/plugins/icons/components/copy.jsx b/src/core/plugins/icons/components/copy.jsx index c947f429e9f..7c650f14f61 100644 --- a/src/core/plugins/icons/components/copy.jsx +++ b/src/core/plugins/icons/components/copy.jsx @@ -4,35 +4,37 @@ import React from "react" import PropTypes from "prop-types" -const Copy = ({ className, width, height }) => ( - +const Copy = ({ className, width, height, ...rest }) => ( + ) Copy.propTypes = { - className: PropTypes.string, - width: PropTypes.string, - height: PropTypes.string, + className: PropTypes.string, + width: PropTypes.string, + height: PropTypes.string, } Copy.defaultProps = { - className: null, - width: 15, - height: 16, + className: null, + width: 15, + height: 16, } -export default Copy \ No newline at end of file +export default Copy diff --git a/src/core/plugins/icons/components/lock.jsx b/src/core/plugins/icons/components/lock.jsx index bc040c259d4..84a424544fe 100644 --- a/src/core/plugins/icons/components/lock.jsx +++ b/src/core/plugins/icons/components/lock.jsx @@ -4,30 +4,31 @@ import React from "react" import PropTypes from "prop-types" -const Lock = ({ className, width, height }) => ( - +const Lock = ({ className, width, height, ...rest }) => ( + ) Lock.propTypes = { - className: PropTypes.string, - width: PropTypes.string, - height: PropTypes.string, + className: PropTypes.string, + width: PropTypes.string, + height: PropTypes.string, } Lock.defaultProps = { - className: null, - width: 20, - height: 20, + className: null, + width: 20, + height: 20, } -export default Lock \ No newline at end of file +export default Lock diff --git a/src/core/plugins/icons/components/unlock.jsx b/src/core/plugins/icons/components/unlock.jsx index b2321bb6c4f..e3c76c5ec39 100644 --- a/src/core/plugins/icons/components/unlock.jsx +++ b/src/core/plugins/icons/components/unlock.jsx @@ -4,30 +4,31 @@ import React from "react" import PropTypes from "prop-types" -const Unlock = ({ className, width, height }) => ( - +const Unlock = ({ className, width, height, ...rest }) => ( + ) Unlock.propTypes = { - className: PropTypes.string, - width: PropTypes.string, - height: PropTypes.string, + className: PropTypes.string, + width: PropTypes.string, + height: PropTypes.string, } Unlock.defaultProps = { - className: null, - width: 20, - height: 20, + className: null, + width: 20, + height: 20, } -export default Unlock \ No newline at end of file +export default Unlock