fix: removing unsupported modal sizes (#10625)

* fix: removing unsupported modal sizes

* linting!

* NOT specifying bsSize seems to have the same effect as (unsupported) "medium"

* supporting 'large' and 'small' over 'lg' and 'sm'
This commit is contained in:
Evan Rusackas 2020-08-18 14:33:39 -07:00 committed by GitHub
parent ca5dc4256f
commit 844b471509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 6 additions and 10 deletions

View File

@ -95,7 +95,6 @@ class EstimateQueryCostButton extends React.PureComponent {
<i className="fa fa-clock-o" /> {btnText} <i className="fa fa-clock-o" /> {btnText}
</Button> </Button>
} }
bsSize="medium"
/> />
</span> </span>
); );

View File

@ -201,7 +201,6 @@ class ScheduleQueryButton extends React.PureComponent {
<i className="fa fa-calendar" /> {t('Schedule')} <i className="fa fa-calendar" /> {t('Schedule')}
</Button> </Button>
} }
bsSize="medium"
/> />
</span> </span>
); );

View File

@ -63,7 +63,6 @@ export default function DeleteModal({
primaryButtonType="danger" primaryButtonType="danger"
show={open} show={open}
title={title} title={title}
bsSize="medium"
> >
<DescriptionContainer>{description}</DescriptionContainer> <DescriptionContainer>{description}</DescriptionContainer>
<StyleFormGroup> <StyleFormGroup>

View File

@ -31,7 +31,7 @@ interface ModalProps {
primaryButtonType?: 'primary' | 'danger'; primaryButtonType?: 'primary' | 'danger';
show: boolean; show: boolean;
title: React.ReactNode; title: React.ReactNode;
bsSize?: 'xs' | 'xsmall' | 'sm' | 'small' | 'medium' | 'lg' | 'large'; bsSize?: 'small' | 'large'; // react-bootstrap also supports 'sm', 'lg' but we're keeping it simple.
} }
const StyledModal = styled(BaseModal)` const StyledModal = styled(BaseModal)`
@ -75,10 +75,9 @@ export default function Modal({
primaryButtonType = 'primary', primaryButtonType = 'primary',
show, show,
title, title,
bsSize = 'lg',
}: ModalProps) { }: ModalProps) {
return ( return (
<StyledModal show={show} onHide={onHide} bsSize={bsSize}> <StyledModal show={show} onHide={onHide}>
<BaseModal.Header closeButton> <BaseModal.Header closeButton>
<BaseModal.Title> <BaseModal.Title>
<Title>{title}</Title> <Title>{title}</Title>

View File

@ -34,7 +34,7 @@ const propTypes = {
onExit: PropTypes.func, onExit: PropTypes.func,
isButton: PropTypes.bool, isButton: PropTypes.bool,
isMenuItem: PropTypes.bool, isMenuItem: PropTypes.bool,
bsSize: PropTypes.string, bsSize: PropTypes.oneOf(['large', 'small']), // react-bootstrap also supports 'sm', 'lg' but we're keeping it simple.
className: PropTypes.string, className: PropTypes.string,
tooltip: PropTypes.string, tooltip: PropTypes.string,
backdrop: PropTypes.oneOf(['static', true, false]), backdrop: PropTypes.oneOf(['static', true, false]),

View File

@ -120,7 +120,7 @@ const ChangeDatasourceModal: FunctionComponent<ChangeDatasourceModalProps> = ({
}; };
return ( return (
<Modal show={show} onHide={onHide} onEnter={onEnterModal} bsSize="lg"> <Modal show={show} onHide={onHide} onEnter={onEnterModal} bsSize="large">
<Modal.Header closeButton> <Modal.Header closeButton>
<Modal.Title>{t('Select a datasource')}</Modal.Title> <Modal.Title>{t('Select a datasource')}</Modal.Title>
</Modal.Header> </Modal.Header>

View File

@ -110,7 +110,7 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
}; };
return ( return (
<Modal show={show} onHide={onHide} bsSize="lg"> <Modal show={show} onHide={onHide} bsSize="large">
<Modal.Header closeButton> <Modal.Header closeButton>
<Modal.Title> <Modal.Title>
<div> <div>

View File

@ -213,7 +213,7 @@ export default class VizTypeControl extends React.PureComponent {
onHide={this.toggleModal} onHide={this.toggleModal}
onEnter={this.focusSearch} onEnter={this.focusSearch}
onExit={this.setSearchRef} onExit={this.setSearchRef}
bsSize="lg" bsSize="large"
> >
<Modal.Header closeButton> <Modal.Header closeButton>
<Modal.Title>{t('Select a visualization type')}</Modal.Title> <Modal.Title>{t('Select a visualization type')}</Modal.Title>