Skip to content

Commit

Permalink
Merge pull request #1638 from cozy/opened-open
Browse files Browse the repository at this point in the history
feat: Use open prop like MUI Dialog
  • Loading branch information
ptbrowne authored Nov 4, 2020
2 parents 717e002 + 2e374f2 commit c7444ab
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
5 changes: 3 additions & 2 deletions react/CozyDialogs/ConfirmDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import DialogCloseButton from './DialogCloseButton'
import DialogTransition from './DialogTransition'

const ConfirmDialog = ({
opened,
open,
opened, // Deprecated
onClose,
title,
content,
Expand All @@ -26,7 +27,7 @@ const ConfirmDialog = ({

return (
<Dialog
open={opened}
open={open || opened}
onClose={onClose}
TransitionComponent={DialogTransition}
TransitionProps={{ isFullscreen }}
Expand Down
5 changes: 3 additions & 2 deletions react/CozyDialogs/Dialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import DialogCloseButton from './DialogCloseButton'
import DialogTransition from './DialogTransition'

const Dialog = ({
opened,
open,
opened, // Deprecated
onClose,
title,
content,
Expand All @@ -27,7 +28,7 @@ const Dialog = ({

return (
<MUIDialog
open={opened}
open={open || opened}
onClose={onClose}
TransitionComponent={DialogTransition}
TransitionProps={{ isFullscreen }}
Expand Down
5 changes: 3 additions & 2 deletions react/CozyDialogs/FixedActionsDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import DialogBackButton from './DialogBackButton'
import DialogCloseButton from './DialogCloseButton'

const FixedActionsDialog = ({
opened,
open,
opened, // Deprecated
onClose,
title,
content,
Expand All @@ -27,7 +28,7 @@ const FixedActionsDialog = ({

return (
<Dialog
open={opened}
open={open || opened}
onClose={onClose}
TransitionComponent={DialogTransition}
TransitionProps={{ isFullscreen }}
Expand Down
5 changes: 3 additions & 2 deletions react/CozyDialogs/FixedDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import DialogBackButton from './DialogBackButton'
import DialogCloseButton from './DialogCloseButton'

const FixedDialog = ({
opened,
open,
opened, // Deprecated
onClose,
title,
content,
Expand All @@ -27,7 +28,7 @@ const FixedDialog = ({

return (
<Dialog
open={opened}
open={open || opened}
onClose={onClose}
TransitionComponent={DialogTransition}
TransitionProps={{ isFullscreen }}
Expand Down
5 changes: 3 additions & 2 deletions react/CozyDialogs/IllustrationDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import DialogCloseButton from './DialogCloseButton'
import DialogTransition from './DialogTransition'

const IllustrationDialog = ({
opened,
open,
opened, // Deprecated
onClose,
title,
content,
Expand All @@ -26,7 +27,7 @@ const IllustrationDialog = ({

return (
<Dialog
open={opened}
open={open || opened}
onClose={onClose}
TransitionComponent={DialogTransition}
TransitionProps={{ isFullscreen }}
Expand Down
2 changes: 1 addition & 1 deletion react/CozyDialogs/dialogPropTypes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import PropTypes from 'prop-types'

export default {
opened: PropTypes.bool.isRequired,
open: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
title: PropTypes.node,
content: PropTypes.node,
Expand Down

0 comments on commit c7444ab

Please sign in to comment.