From 942466eb686c480133e1b0b8b9a2b975098b5bc4 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Thu, 17 Oct 2019 16:22:11 +0200 Subject: Implement #120 --- src/components/ui/Button.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/components/ui/Button.js') diff --git a/src/components/ui/Button.js b/src/components/ui/Button.js index e2d7cea83..f46fd34ea 100644 --- a/src/components/ui/Button.js +++ b/src/components/ui/Button.js @@ -1,10 +1,10 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { observer } from 'mobx-react'; +import { observer, inject } from 'mobx-react'; import Loader from 'react-loader'; import classnames from 'classnames'; -export default @observer class Button extends Component { +export default @observer @inject('stores') class Button extends Component { static propTypes = { className: PropTypes.string, label: PropTypes.string.isRequired, @@ -14,6 +14,13 @@ export default @observer class Button extends Component { buttonType: PropTypes.string, loaded: PropTypes.bool, htmlForm: PropTypes.string, + stores: PropTypes.shape({ + settings: PropTypes.shape({ + app: PropTypes.shape({ + accentColor: PropTypes.string.isRequired, + }).isRequired, + }).isRequired, + }).isRequired, }; static defaultProps = { @@ -69,7 +76,7 @@ export default @observer class Button extends Component { loaded={loaded} lines={10} scale={0.4} - color={buttonType !== 'secondary' ? '#FFF' : '#7367F0'} + color={buttonType !== 'secondary' ? '#FFF' : this.props.stores.settings.app.accentColor} component="span" /> {label} -- cgit v1.2.3-70-g09d2