Advertisement
Guest User

Untitled

a guest
Mar 21st, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React from 'react';
  2. import PropTypes from 'prop-types';
  3. import { withStyles } from 'material-ui/styles';
  4. import { LinearProgress } from 'material-ui/Progress';
  5.  
  6. import { createStore, applyMiddleware, compose } from 'redux'
  7. import { connect } from 'react-redux'
  8.  
  9. const styles = {
  10.     root: {
  11.         flexGrow: 1,
  12.         width: "100%",
  13.         position: "fixed",
  14.         zIndex: "999",
  15.     },
  16. };
  17.  
  18. class LinearIndeterminate extends  React.Component{
  19.     constructor() {
  20.         super();
  21.     }
  22.  
  23.     render() {
  24.         this.state = {
  25.             showForm: this.props.progressStatus
  26.         }
  27.         console.log('work progress bar');
  28.         console.log(this.props.progressStatus);
  29.         const {classes} = this.props;
  30.         const showHide = {
  31.             'display': this.state.showForm ? 'block' : 'none'
  32.         };
  33.  
  34.         const showReplyForm = () => {
  35.             this.setState({showForm: true});
  36.         };
  37.         return (
  38.             <div className={classes.root} style={showHide}>
  39.                 <LinearProgress color="secondary"/>
  40.             </div>
  41.         );
  42.     }
  43. }
  44.  
  45. LinearIndeterminate.propTypes = {
  46.     classes: PropTypes.object.isRequired,
  47. };
  48. function mapStateToProps(state) {
  49.     return{
  50.         progressStatus: state.progressStatus
  51.     };
  52. }
  53. export default compose(
  54.     withStyles(styles),
  55.     connect(mapStateToProps),
  56. )
  57. (LinearIndeterminate);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement