-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(icons): allow SVG icons to receive arbitrary props (#9106)
These arbitrary props will allow to handle native React element events among other things. Refs #9094
- Loading branch information
Showing
14 changed files
with
156 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <LockIcon {...ownProps} /> | ||
} | ||
} | ||
|
||
LockAuthIcon.propTypes = { | ||
getComponent: PropTypes.func.isRequired, | ||
ownProps: PropTypes.shape({}).isRequired, | ||
} | ||
|
||
export default LockAuthIcon |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <UnlockIcon {...ownProps} /> | ||
} | ||
} | ||
|
||
UnlockAuthIcon.propTypes = { | ||
getComponent: PropTypes.func.isRequired, | ||
ownProps: PropTypes.shape({}).isRequired, | ||
} | ||
|
||
export default UnlockAuthIcon |
17 changes: 0 additions & 17 deletions
17
src/core/plugins/auth/components/unlock-auth-operation.jsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.