gempir

React

Mar 3rd, 2018
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from 'react';
  2. import { Chip, CircularProgress } from 'material-ui';
  3.  
  4. export default class LogView extends Component {
  5.     style = {
  6.         position: "relative";
  7.     }
  8.    
  9.     chipStyle = {
  10.         fontWeight: "600",
  11.         fontSize: "12px",
  12.         display: "inline-block",
  13.     }
  14.  
  15.     render() {
  16.         let loadingStyle = {
  17.             margin: "auto",
  18.             textAlign: "center"
  19.         };
  20.  
  21.         if (!this.props.isLoading) {
  22.             loadingStyle.display = "none";
  23.         }
  24.  
  25.         return (
  26.             <div style={this.style}>
  27.                 {this.props.logs.map((value, key) =>
  28.                     <div key={key} className="line">
  29.                         <Chip style={this.ChipStyle}>{value.timestamp}</Chip> {value.message}
  30.                     </div>
  31.                 )}
  32.                 <CircularProgress size={80} thickness={5} style={loadingStyle} />
  33.             </div>
  34.         );
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment