diff options
Diffstat (limited to 'src/components/ui/Button.js')
-rw-r--r-- | src/components/ui/Button.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/components/ui/Button.js b/src/components/ui/Button.js index ffc7f7051..5066b9c06 100644 --- a/src/components/ui/Button.js +++ b/src/components/ui/Button.js | |||
@@ -1,10 +1,10 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { observer } from 'mobx-react'; | 3 | import { observer, inject } from 'mobx-react'; |
4 | import Loader from 'react-loader'; | 4 | import Loader from 'react-loader'; |
5 | import classnames from 'classnames'; | 5 | import classnames from 'classnames'; |
6 | 6 | ||
7 | export default @observer class Button extends Component { | 7 | export default @inject('stores') @observer class Button extends Component { |
8 | static propTypes = { | 8 | static propTypes = { |
9 | className: PropTypes.string, | 9 | className: PropTypes.string, |
10 | label: PropTypes.string.isRequired, | 10 | label: PropTypes.string.isRequired, |
@@ -14,12 +14,19 @@ export default @observer class Button extends Component { | |||
14 | buttonType: PropTypes.string, | 14 | buttonType: PropTypes.string, |
15 | loaded: PropTypes.bool, | 15 | loaded: PropTypes.bool, |
16 | htmlForm: PropTypes.string, | 16 | htmlForm: PropTypes.string, |
17 | stores: PropTypes.shape({ | ||
18 | settings: PropTypes.shape({ | ||
19 | app: PropTypes.shape({ | ||
20 | accentColor: PropTypes.string.isRequired, | ||
21 | }).isRequired, | ||
22 | }).isRequired, | ||
23 | }).isRequired, | ||
17 | }; | 24 | }; |
18 | 25 | ||
19 | static defaultProps = { | 26 | static defaultProps = { |
20 | className: null, | 27 | className: null, |
21 | disabled: false, | 28 | disabled: false, |
22 | onClick: () => {}, | 29 | onClick: () => { }, |
23 | type: 'button', | 30 | type: 'button', |
24 | buttonType: '', | 31 | buttonType: '', |
25 | loaded: true, | 32 | loaded: true, |
@@ -69,7 +76,7 @@ export default @observer class Button extends Component { | |||
69 | loaded={loaded} | 76 | loaded={loaded} |
70 | lines={10} | 77 | lines={10} |
71 | scale={0.4} | 78 | scale={0.4} |
72 | color={buttonType !== 'secondary' ? '#FFF' : '#373a3c'} | 79 | color={buttonType !== 'secondary' ? '#FFF' : this.props.stores.settings.app.accentColor} |
73 | component="span" | 80 | component="span" |
74 | /> | 81 | /> |
75 | {label} | 82 | {label} |