diff options
author | Stefan Malzner <stefan@adlk.io> | 2018-12-13 14:01:33 +0100 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2018-12-13 14:01:33 +0100 |
commit | b5937bd427e02d64b675c9c4719ec8148c68c224 (patch) | |
tree | 3e67ca01935eb36ab6d40a1e197d7c2c0f38b587 /src/components/ui/FullscreenLoader/index.js | |
parent | Update CHANGELOG.md (diff) | |
parent | Ignore clicks on premium elements (diff) | |
download | ferdium-app-b5937bd427e02d64b675c9c4719ec8148c68c224.tar.gz ferdium-app-b5937bd427e02d64b675c9c4719ec8148c68c224.tar.zst ferdium-app-b5937bd427e02d64b675c9c4719ec8148c68c224.zip |
Merge branch 'develop'v5.0.0-beta.21
Diffstat (limited to 'src/components/ui/FullscreenLoader/index.js')
-rw-r--r-- | src/components/ui/FullscreenLoader/index.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/components/ui/FullscreenLoader/index.js b/src/components/ui/FullscreenLoader/index.js new file mode 100644 index 000000000..6ecf4d395 --- /dev/null +++ b/src/components/ui/FullscreenLoader/index.js | |||
@@ -0,0 +1,56 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import injectSheet, { withTheme } from 'react-jss'; | ||
5 | import classnames from 'classnames'; | ||
6 | |||
7 | import Loader from '../Loader'; | ||
8 | |||
9 | import styles from './styles'; | ||
10 | |||
11 | export default @observer @withTheme @injectSheet(styles) class FullscreenLoader extends Component { | ||
12 | static propTypes = { | ||
13 | className: PropTypes.string, | ||
14 | title: PropTypes.string.isRequired, | ||
15 | classes: PropTypes.object.isRequired, | ||
16 | theme: PropTypes.object.isRequired, | ||
17 | spinnerColor: PropTypes.string, | ||
18 | children: PropTypes.node, | ||
19 | } | ||
20 | |||
21 | static defaultProps = { | ||
22 | className: null, | ||
23 | spinnerColor: null, | ||
24 | children: null, | ||
25 | } | ||
26 | |||
27 | render() { | ||
28 | const { | ||
29 | classes, | ||
30 | title, | ||
31 | children, | ||
32 | spinnerColor, | ||
33 | className, | ||
34 | theme, | ||
35 | } = this.props; | ||
36 | |||
37 | return ( | ||
38 | <div className={classes.wrapper}> | ||
39 | <div | ||
40 | className={classnames({ | ||
41 | [`${classes.component}`]: true, | ||
42 | [`${className}`]: className, | ||
43 | })} | ||
44 | > | ||
45 | <h1 className={classes.title}>{title}</h1> | ||
46 | <Loader color={spinnerColor || theme.colorFullscreenLoaderSpinner} /> | ||
47 | {children && ( | ||
48 | <div className={classes.content}> | ||
49 | {children} | ||
50 | </div> | ||
51 | )} | ||
52 | </div> | ||
53 | </div> | ||
54 | ); | ||
55 | } | ||
56 | } | ||