diff options
author | 2018-12-11 11:58:42 +0100 | |
---|---|---|
committer | 2018-12-11 11:58:42 +0100 | |
commit | a73e183108104192ae17c75a5a60eb3075464476 (patch) | |
tree | bcedf65522520405ab38f2baeac009f563aa5158 /src/components/ui/WebviewLoader | |
parent | fix countdown state (diff) | |
download | ferdium-app-a73e183108104192ae17c75a5a60eb3075464476.tar.gz ferdium-app-a73e183108104192ae17c75a5a60eb3075464476.tar.zst ferdium-app-a73e183108104192ae17c75a5a60eb3075464476.zip |
Improve webview loader
Diffstat (limited to 'src/components/ui/WebviewLoader')
-rw-r--r-- | src/components/ui/WebviewLoader/index.js | 28 | ||||
-rw-r--r-- | src/components/ui/WebviewLoader/styles.js | 9 |
2 files changed, 27 insertions, 10 deletions
diff --git a/src/components/ui/WebviewLoader/index.js b/src/components/ui/WebviewLoader/index.js index 950312bbb..ab17199e5 100644 --- a/src/components/ui/WebviewLoader/index.js +++ b/src/components/ui/WebviewLoader/index.js | |||
@@ -1,16 +1,24 @@ | |||
1 | import React from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import injectSheet from 'react-jss'; | ||
3 | 4 | ||
4 | import FullscreenLoader from '../FullscreenLoader'; | 5 | import FullscreenLoader from '../FullscreenLoader'; |
5 | 6 | ||
6 | const WebviewLoader = ({ name }) => ( | 7 | import styles from './styles'; |
7 | <FullscreenLoader | ||
8 | title={`Loading ${name}`} | ||
9 | /> | ||
10 | ); | ||
11 | 8 | ||
12 | WebviewLoader.propTypes = { | 9 | export default @injectSheet(styles) class WebviewLoader extends Component { |
13 | name: PropTypes.string.isRequired, | 10 | static propTypes = { |
14 | }; | 11 | name: PropTypes.string.isRequired, |
12 | classes: PropTypes.object.isRequired, | ||
13 | } | ||
15 | 14 | ||
16 | export default WebviewLoader; | 15 | render() { |
16 | const { classes, name } = this.props; | ||
17 | return ( | ||
18 | <FullscreenLoader | ||
19 | className={classes.component} | ||
20 | title={`Loading ${name}`} | ||
21 | /> | ||
22 | ); | ||
23 | } | ||
24 | } | ||
diff --git a/src/components/ui/WebviewLoader/styles.js b/src/components/ui/WebviewLoader/styles.js new file mode 100644 index 000000000..dbd75db8a --- /dev/null +++ b/src/components/ui/WebviewLoader/styles.js | |||
@@ -0,0 +1,9 @@ | |||
1 | export default theme => ({ | ||
2 | component: { | ||
3 | background: theme.colorWebviewLoaderBackground, | ||
4 | padding: 20, | ||
5 | width: 'auto', | ||
6 | margin: [0, 'auto'], | ||
7 | borderRadius: 6, | ||
8 | }, | ||
9 | }); | ||