Don't render table options modal content when it's closed

This commit is contained in:
Mark McDowall 2019-04-06 23:22:35 -07:00
parent 82b35f095e
commit 439870a546
1 changed files with 94 additions and 88 deletions

View File

@ -131,6 +131,8 @@ class TableOptionsModal extends Component {
isOpen={isOpen}
onModalClose={onModalClose}
>
{
isOpen ?
<ModalContent onModalClose={onModalClose}>
<ModalHeader>
Table Options
@ -139,7 +141,7 @@ class TableOptionsModal extends Component {
<ModalBody>
<Form>
{
hasPageSize &&
hasPageSize ?
<FormGroup>
<FormLabel>Page Size</FormLabel>
@ -151,18 +153,19 @@ class TableOptionsModal extends Component {
errors={pageSizeError ? [{ message: pageSizeError }] : undefined}
onChange={this.onPageSizeChange}
/>
</FormGroup>
</FormGroup> :
null
}
{
!!OptionsComponent &&
OptionsComponent ?
<OptionsComponent
onTableOptionChange={onTableOptionChange}
/>
/> : null
}
{
canModifyColumns &&
canModifyColumns ?
<FormGroup>
<FormLabel>Columns</FormLabel>
@ -218,7 +221,8 @@ class TableOptionsModal extends Component {
<TableOptionsColumnDragPreview />
</div>
</div>
</FormGroup>
</FormGroup> :
null
}
</Form>
</ModalBody>
@ -229,7 +233,9 @@ class TableOptionsModal extends Component {
Close
</Button>
</ModalFooter>
</ModalContent>
</ModalContent> :
null
}
</Modal>
);
}