feat(xo-web/ActionButton): ability to set the icon's color (#3258)

See PR: #3255
This commit is contained in:
badrAZ 2018-08-06 11:11:58 +02:00 committed by Pierre Donias
parent 9d2f15cf33
commit a58a9a9e6a

View File

@ -35,6 +35,9 @@ import { error as _error } from './notification'
// XO icon to use for this button // XO icon to use for this button
icon: propTypes.string.isRequired, icon: propTypes.string.isRequired,
// the color of the xo icon
iconColor: propTypes.string,
// whether the action of this action is already underway // whether the action of this action is already underway
pending: propTypes.bool, pending: propTypes.bool,
@ -144,7 +147,7 @@ export default class ActionButton extends Component {
render () { render () {
const { const {
props: { children, icon, pending, tooltip, ...props }, props: { children, icon, iconColor, pending, tooltip, ...props },
state: { error, working }, state: { error, working },
} = this } = this
@ -163,7 +166,11 @@ export default class ActionButton extends Component {
const button = ( const button = (
<Button {...props}> <Button {...props}>
<Icon icon={pending || working ? 'loading' : icon} fixedWidth /> <Icon
color={iconColor}
fixedWidth
icon={pending || working ? 'loading' : icon}
/>
{children && ' '} {children && ' '}
{children} {children}
</Button> </Button>