Skip to content

Commit

Permalink
fix: Action buttons at the bottom of Dialog/IllustrationDialog on mobile
Browse files Browse the repository at this point in the history
fix #1868
  • Loading branch information
JF-Cozy committed May 20, 2022
1 parent 60da758 commit b924001
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 4 deletions.
8 changes: 7 additions & 1 deletion react/CozyDialogs/ConfirmDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ const ConfirmDialog = props => {
<DialogTitle {...dialogTitleProps}>{title}</DialogTitle>
</div>
)}
{content}
<div
className={cx('dialogContentWrapper', {
withActions: Boolean(actions)
})}
>
{content}
</div>
{actions && (
<DialogActions
{...dialogActionsProps}
Expand Down
8 changes: 7 additions & 1 deletion react/CozyDialogs/Dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,13 @@ const Dialog = props => {
)}
<DialogContent {...dialogContentProps}>
<div className="dialogContentInner withFluidActions">
{content}
<div
className={cx('dialogContentWrapper', {
withActions: Boolean(actions)
})}
>
{content}
</div>
{actions && (
<DialogActions
{...dialogActionsProps}
Expand Down
8 changes: 7 additions & 1 deletion react/CozyDialogs/IllustrationDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ const IllustrationDialog = props => {
<div className="u-flex u-flex-justify-center">{title}</div>
</DialogTitle>
)}
{content}
<div
className={cx('dialogContentWrapper', {
withActions: Boolean(actions)
})}
>
{content}
</div>
{actions && (
<DialogActions
{...dialogActionsProps}
Expand Down
14 changes: 13 additions & 1 deletion react/MuiCozyTheme/makeOverrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,19 @@ const makeOverrides = theme => ({
marginBottom: '24px',
'&.withFluidActions': {
[theme.breakpoints.down('sm')]: {
marginBottom: '16px'
marginBottom: 0,
display: 'flex',
flexDirection: 'column',
height: '100%',
'& .dialogContentWrapper': {
flexGrow: 1,
'&:not(.withActions)': {
paddingBottom: '16px'
}
},
'& .cozyDialogActions': {
paddingBottom: '16px'
}
}
},
'& .dialogTitleFluidContainer': {
Expand Down

0 comments on commit b924001

Please sign in to comment.