aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/trialStatusBar/components/ProgressBar.js
blob: 41b74d396f5ac26ae95156bb1a48b481575eb11c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { observer } from 'mobx-react';
import injectSheet from 'react-jss';

const styles = theme => ({
  root: {
    background: theme.trialStatusBar.progressBar.background,
    width: '25%',
    maxWidth: 200,
    height: 8,
    display: 'flex',
    alignItems: 'center',
    borderRadius: theme.borderRadius,
    overflow: 'hidden',
  },
  progress: {
    background: theme.trialStatusBar.progressBar.progressIndicator,
    width: ({ percent }) => `${percent}%`,
    height: '100%',
  },
});

@injectSheet(styles) @observer
class ProgressBar extends Component {
  static propTypes = {
    classes: PropTypes.object.isRequired,
  };

  render() {
    const {
      classes,
    } = this.props;

    return (
      <div
        className={classes.root}
      >
        <div className={classes.progress} />
      </div>
    );
  }
}

export default ProgressBar;