Manual Reference Source

basic/maintenance/MaintenanceModeActivationButton.js

  1. /**
  2. * Created by jakubniezgoda on 24/05/2018.
  3. */
  4.  
  5. import PropTypes from 'prop-types';
  6.  
  7. import { Component } from 'react';
  8. import { Button } from '../index';
  9.  
  10. export default class extends Component {
  11. static props = {
  12. activate: PropTypes.bool.isRequired,
  13. onClick: PropTypes.func.isRequired
  14. };
  15.  
  16. render() {
  17. const content = this.props.activate ? 'Activate Maintenance Mode' : 'Dectivate Maintenance Mode';
  18.  
  19. return (
  20. <Button
  21. color="orange"
  22. icon="doctor"
  23. content={content}
  24. className="widgetButton"
  25. labelPosition="left"
  26. onClick={this.props.onClick}
  27. />
  28. );
  29. }
  30. }