Skip to content

Commit

Permalink
fix(cosmetic): Limiting modal height (#20147)
Browse files Browse the repository at this point in the history
* more changes that didn't make it into the last commit somehow.

* Allow modals to be short, but reach a max height and scroll

* now with template literals
  • Loading branch information
rusackas authored May 27, 2022
1 parent 0d2e422 commit c8fe518
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions superset-frontend/src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,20 @@ export const StyledModal = styled(BaseModal)<StyledModalProps>`
max-width: ${maxWidth ?? '900px'};
padding-left: ${theme.gridUnit * 3}px;
padding-right: ${theme.gridUnit * 3}px;
padding-bottom: 0;
top: 0;
`}
.ant-modal-content {
display: flex;
flex-direction: column;
max-height: ${({ theme }) => `calc(100vh - ${theme.gridUnit * 8}px)`};
margin-bottom: ${({ theme }) => theme.gridUnit * 4}px;
margin-top: ${({ theme }) => theme.gridUnit * 4}px;
}
.ant-modal-header {
flex: 0 0 auto;
background-color: ${({ theme }) => theme.colors.grayscale.light4};
border-radius: ${({ theme }) => theme.borderRadius}px
${({ theme }) => theme.borderRadius}px 0 0;
Expand Down Expand Up @@ -119,11 +130,13 @@ export const StyledModal = styled(BaseModal)<StyledModalProps>`
}
.ant-modal-body {
flex: 0 1 auto;
padding: ${({ theme }) => theme.gridUnit * 4}px;
overflow: auto;
${({ resizable, height }) => !resizable && height && `height: ${height};`}
}
.ant-modal-footer {
flex: 0 0 1;
border-top: ${({ theme }) => theme.gridUnit / 4}px solid
${({ theme }) => theme.colors.grayscale.light2};
padding: ${({ theme }) => theme.gridUnit * 4}px;
Expand Down

0 comments on commit c8fe518

Please sign in to comment.