diff options
author | 2019-10-17 16:22:11 +0200 | |
---|---|---|
committer | 2019-10-17 16:22:11 +0200 | |
commit | 942466eb686c480133e1b0b8b9a2b975098b5bc4 (patch) | |
tree | 297a71efa4051949a4f2c411262558954c8c7d3a /src/components/ui/Loader.js | |
parent | Merge pull request #121 from getferdi/l10n_develop (diff) | |
download | ferdium-app-942466eb686c480133e1b0b8b9a2b975098b5bc4.tar.gz ferdium-app-942466eb686c480133e1b0b8b9a2b975098b5bc4.tar.zst ferdium-app-942466eb686c480133e1b0b8b9a2b975098b5bc4.zip |
Implement #120v5.4.0-beta.1
Diffstat (limited to 'src/components/ui/Loader.js')
-rw-r--r-- | src/components/ui/Loader.js | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/components/ui/Loader.js b/src/components/ui/Loader.js index de8769b6c..627749273 100644 --- a/src/components/ui/Loader.js +++ b/src/components/ui/Loader.js | |||
@@ -1,22 +1,30 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import { observer, inject } from 'mobx-react'; | ||
2 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
3 | import Loader from 'react-loader'; | 4 | import Loader from 'react-loader'; |
4 | 5 | ||
5 | import { oneOrManyChildElements } from '../../prop-types'; | 6 | import { oneOrManyChildElements } from '../../prop-types'; |
6 | 7 | ||
7 | export default class LoaderComponent extends Component { | 8 | export default @observer @inject('stores') class LoaderComponent extends Component { |
8 | static propTypes = { | 9 | static propTypes = { |
9 | children: oneOrManyChildElements, | 10 | children: oneOrManyChildElements, |
10 | loaded: PropTypes.bool, | 11 | loaded: PropTypes.bool, |
11 | className: PropTypes.string, | 12 | className: PropTypes.string, |
12 | color: PropTypes.string, | 13 | color: PropTypes.string, |
14 | stores: PropTypes.shape({ | ||
15 | settings: PropTypes.shape({ | ||
16 | app: PropTypes.shape({ | ||
17 | accentColor: PropTypes.string.isRequired, | ||
18 | }).isRequired, | ||
19 | }).isRequired, | ||
20 | }).isRequired, | ||
13 | }; | 21 | }; |
14 | 22 | ||
15 | static defaultProps = { | 23 | static defaultProps = { |
16 | children: null, | 24 | children: null, |
17 | loaded: false, | 25 | loaded: false, |
18 | className: '', | 26 | className: '', |
19 | color: '#7367F0', | 27 | color: 'ACCENT', |
20 | }; | 28 | }; |
21 | 29 | ||
22 | render() { | 30 | render() { |
@@ -24,9 +32,10 @@ export default class LoaderComponent extends Component { | |||
24 | children, | 32 | children, |
25 | loaded, | 33 | loaded, |
26 | className, | 34 | className, |
27 | color, | ||
28 | } = this.props; | 35 | } = this.props; |
29 | 36 | ||
37 | const color = this.props.color !== 'ACCENT' ? this.props.color : this.props.stores.settings.app.accentColor; | ||
38 | |||
30 | return ( | 39 | return ( |
31 | <Loader | 40 | <Loader |
32 | loaded={loaded} | 41 | loaded={loaded} |