Skip to content

Commit

Permalink
docs(CozyDialogs): Add inner dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
JF-Cozy committed Oct 9, 2024
1 parent 2451143 commit c8bfb36
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions react/CozyDialogs/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ const hideBottomSheet = () => setState({ bottomSheetOpened: false })
const showBottomSheet = () => setState({ bottomSheetOpened: true })
const hideSecondConfirmDialog = () => setState({ secondConfirmDialogOpened: false })
const showSecondConfirmDialog = () => setState({ secondConfirmDialogOpened: true })
const hideSecondDialog = () => setState({ secondDialogOpened: false })
const showSecondDialog = () => setState({ secondDialogOpened: true })
const hideBSConfirmDialog = () => setState({ BSConfirmDialogOpened: false })
const showBSConfirmDialog = () => setState({ BSConfirmDialogOpened: true })

Expand Down Expand Up @@ -188,6 +190,7 @@ initialState = {
modalOpened: isTesting(),
bottomSheetOpened: false,
secondConfirmDialogOpened: false,
secondDialogOpened: false,
BSConfirmDialogOpened: false,
modal: Dialog,
size: 'medium',
Expand Down Expand Up @@ -323,6 +326,9 @@ const initialVariants = [{
<div>
<Button label="Show inner confirm dialog" onClick={showSecondConfirmDialog}/>
</div>
<div>
<Button label="Show inner dialog" onClick={showSecondDialog}/>
</div>
</Stack>
</Typography>

Expand All @@ -333,6 +339,13 @@ const initialVariants = [{
/>
)}

{state.secondDialogOpened && (
<Dialog open onClose={hideSecondDialog}
title="This is a simple title"
content="This is a simple content"
/>
)}

{state.bottomSheetOpened && (
<BottomSheet backdrop onClose={hideBottomSheet}>
<BottomSheetItem>
Expand Down

0 comments on commit c8bfb36

Please sign in to comment.