all files / src/components/ RefreshChartOverlay.jsx

90% Statements 9/10
100% Branches 0/0
0% Functions 0/1
90% Lines 9/10
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                                                                    
import React from 'react';
import PropTypes from 'prop-types';
import Button from '../components/Button';
import { t } from '../locales';
 
const propTypes = {
  height: PropTypes.number.isRequired,
  width: PropTypes.number.isRequired,
  onQuery: PropTypes.func,
  onDismiss: PropTypes.func,
};
 
class RefreshChartOverlay extends React.PureComponent {
  render() {
    return (
      <div
        style={{ height: this.props.height, width: this.props.width }}
        className="explore-chart-overlay"
      >
        <div>
          <Button
            className="refresh-overlay-btn"
            onClick={this.props.onQuery}
            bsStyle="primary"
          >
            {t('Run Query')}
          </Button>
          <Button
            className="dismiss-overlay-btn"
            onClick={this.props.onDismiss}
          >
            {t('Dismiss')}
          </Button>
        </div>
      </div>
    );
  }
}
 
RefreshChartOverlay.propTypes = propTypes;
 
export default RefreshChartOverlay;