-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add destructive primary action to modal (#431)
feat: add destructive primary action to modal
- Loading branch information
Showing
4 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
demo/app/previews/modal_component_preview/with_destructive_primary_action.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<%= polaris_button(data: { | ||
controller: "polaris", | ||
target: "#demo-modal", | ||
action: "polaris#openModal", | ||
}) { "Open" } %> | ||
<%= polaris_modal( | ||
id: "demo-modal", | ||
title: "Reach more shoppers with Instagram product tags", | ||
open: true, | ||
) do |modal| %> | ||
<%= polaris_text_container do %> | ||
<p> | ||
Use Instagram posts to share your products with millions of | ||
people. Let shoppers buy from your store without leaving | ||
Instagram. | ||
</p> | ||
<% end %> | ||
<% modal.with_primary_action(destructive: true) { "Discard changes" } %> | ||
<% modal.with_secondary_action(data: { action: "polaris-modal#close" }) { "Continue editing" } %> | ||
<% end %> |