import * as React from 'react'; import { Modal, Button } from 'react-bootstrap'; import { observer } from 'mobx-react'; import LoadingIndicator from 'shared/components/loadingIndicator/LoadingIndicator'; import autobind from 'autobind-decorator'; interface IGeneModalProps { panelName: string; show: boolean; onHide: () => void; isLoading?: boolean; className?: string; } @observer export default class GenePanelModal extends React.Component< IGeneModalProps, {} > { @autobind handleClose() { // `handleClose` receives an event object on each call, // so calling the `onHide` prop here to prevent unneccessary // passing of the event object to the parent component this.props.onHide(); } render() { return ( {this.props.panelName} {this.props.show && this.props.isLoading && ( )} {this.props.show && !this.props.isLoading && (
{this.props.children}
)}
); } }