feat(xo-web/ActionButton): ability to set the icon's color (#3258)
See PR: #3255
This commit is contained in:
parent
9d2f15cf33
commit
a58a9a9e6a
@ -35,6 +35,9 @@ import { error as _error } from './notification'
|
||||
// XO icon to use for this button
|
||||
icon: propTypes.string.isRequired,
|
||||
|
||||
// the color of the xo icon
|
||||
iconColor: propTypes.string,
|
||||
|
||||
// whether the action of this action is already underway
|
||||
pending: propTypes.bool,
|
||||
|
||||
@ -144,7 +147,7 @@ export default class ActionButton extends Component {
|
||||
|
||||
render () {
|
||||
const {
|
||||
props: { children, icon, pending, tooltip, ...props },
|
||||
props: { children, icon, iconColor, pending, tooltip, ...props },
|
||||
state: { error, working },
|
||||
} = this
|
||||
|
||||
@ -163,7 +166,11 @@ export default class ActionButton extends Component {
|
||||
|
||||
const button = (
|
||||
<Button {...props}>
|
||||
<Icon icon={pending || working ? 'loading' : icon} fixedWidth />
|
||||
<Icon
|
||||
color={iconColor}
|
||||
fixedWidth
|
||||
icon={pending || working ? 'loading' : icon}
|
||||
/>
|
||||
{children && ' '}
|
||||
{children}
|
||||
</Button>
|
||||
|
Loading…
Reference in New Issue
Block a user