diff options
author | 2019-10-16 15:16:26 +0200 | |
---|---|---|
committer | 2019-10-16 15:16:26 +0200 | |
commit | 0b08e1e7e6a07acd21af71fd27f4c4acfa34dbba (patch) | |
tree | 9ee5b287f3c0451012153cf281659159597d63e7 /src/features/trialStatusBar/components/ProgressBar.js | |
parent | polishing (diff) | |
download | ferdium-app-0b08e1e7e6a07acd21af71fd27f4c4acfa34dbba.tar.gz ferdium-app-0b08e1e7e6a07acd21af71fd27f4c4acfa34dbba.tar.zst ferdium-app-0b08e1e7e6a07acd21af71fd27f4c4acfa34dbba.zip |
Add trialStatusBar & polishing
Diffstat (limited to 'src/features/trialStatusBar/components/ProgressBar.js')
-rw-r--r-- | src/features/trialStatusBar/components/ProgressBar.js | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/features/trialStatusBar/components/ProgressBar.js b/src/features/trialStatusBar/components/ProgressBar.js new file mode 100644 index 000000000..80d478d8c --- /dev/null +++ b/src/features/trialStatusBar/components/ProgressBar.js | |||
@@ -0,0 +1,46 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { observer } from 'mobx-react'; | ||
4 | import injectSheet from 'react-jss'; | ||
5 | |||
6 | const styles = theme => ({ | ||
7 | root: { | ||
8 | background: theme.trialStatusBar.progressBar.background, | ||
9 | width: '25%', | ||
10 | maxWidth: 200, | ||
11 | height: 8, | ||
12 | display: 'flex', | ||
13 | alignItems: 'center', | ||
14 | borderRadius: theme.borderRadius, | ||
15 | overflow: 'hidden', | ||
16 | }, | ||
17 | progress: { | ||
18 | background: theme.trialStatusBar.progressBar.progressIndicator, | ||
19 | width: ({ percent }) => `${percent}%`, | ||
20 | height: '100%', | ||
21 | }, | ||
22 | }); | ||
23 | |||
24 | @injectSheet(styles) @observer | ||
25 | class ProgressBar extends Component { | ||
26 | static propTypes = { | ||
27 | classes: PropTypes.object.isRequired, | ||
28 | percent: PropTypes.number.isRequired, | ||
29 | }; | ||
30 | |||
31 | render() { | ||
32 | const { | ||
33 | classes, | ||
34 | } = this.props; | ||
35 | |||
36 | return ( | ||
37 | <div | ||
38 | className={classes.root} | ||
39 | > | ||
40 | <div className={classes.progress} /> | ||
41 | </div> | ||
42 | ); | ||
43 | } | ||
44 | } | ||
45 | |||
46 | export default ProgressBar; | ||