Skip to content

Commit

Permalink
[Docs] Update EuiConfirmModal examples (#6519)
Browse files Browse the repository at this point in the history
* [Docs] Update `EuiConfirmModal` examples

* Adding a width

* Update src-docs/src/views/modal/confirm_modal.tsx

Co-authored-by: florent-leborgne <[email protected]>

Co-authored-by: florent-leborgne <[email protected]>
  • Loading branch information
elizabetdev and florent-leborgne authored Jan 12, 2023
1 parent 4975921 commit e0ac6a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
8 changes: 0 additions & 8 deletions src-docs/src/views/button/guidelines.js
Original file line number Diff line number Diff line change
Expand Up @@ -541,14 +541,6 @@ export default () => (
<EuiTableHeaderCell>Use this instead</EuiTableHeaderCell>
</EuiTableHeader>
<EuiTableBody>
<EuiTableRow>
<EuiTableRowCell>
<EuiButton color="danger">Discard</EuiButton>
</EuiTableRowCell>

<EuiTableRowCell>Remove or Delete</EuiTableRowCell>
</EuiTableRow>

<EuiTableRow>
<EuiTableRowCell>
<EuiButton>New</EuiButton>
Expand Down
23 changes: 13 additions & 10 deletions src-docs/src/views/modal/confirm_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ export default () => {
if (isModalVisible) {
modal = (
<EuiConfirmModal
title="Do this thing"
style={{ width: 600 }}
title="Update subscription to Platinum?"
onCancel={closeModal}
onConfirm={closeModal}
cancelButtonText="No, don't do it"
confirmButtonText="Yes, do it"
cancelButtonText="Cancel"
confirmButtonText="Update subscription"
defaultFocusedButton="confirm"
>
<p>You&rsquo;re about to do something.</p>
<p>Are you sure you want to do this?</p>
<p>
Your subscription and benefits increase immediately. If you change to
a lower subscription later, it will not take affect until the next
billing cycle.
</p>
</EuiConfirmModal>
);
}
Expand All @@ -40,16 +44,15 @@ export default () => {
if (isDestroyModalVisible) {
destroyModal = (
<EuiConfirmModal
title="Do this destructive thing"
title="Discard dashboard changes?"
onCancel={closeDestroyModal}
onConfirm={closeDestroyModal}
cancelButtonText="No, don't do it"
confirmButtonText="Yes, do it"
cancelButtonText="Keep editing"
confirmButtonText="Discard changes"
buttonColor="danger"
defaultFocusedButton="confirm"
>
<p>You&rsquo;re about to destroy something.</p>
<p>Are you sure you want to do this?</p>
<p>You will lose all unsaved changes made to this dashboard.</p>
</EuiConfirmModal>
);
}
Expand Down

0 comments on commit e0ac6a2

Please sign in to comment.