-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add preview examples for the FeedbackDialog
- Loading branch information
Showing
5 changed files
with
83 additions
and
17 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Patterns | ||
# @hidden | ||
class FeedbackDialogPreview < ViewComponent::Preview | ||
# @display min_height 300px | ||
def default | ||
render_with_template | ||
end | ||
|
||
# @display min_height 300px | ||
def loading | ||
render_with_template | ||
end | ||
|
||
# @display min_height 300px | ||
def custom_icon | ||
render_with_template | ||
end | ||
end | ||
end |
8 changes: 8 additions & 0 deletions
8
lookbook/previews/patterns/feedback_dialog_preview/custom_icon.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,8 @@ | ||
<%= | ||
render(Primer::OpenProject::FeedbackDialog.new(open: true)) do |dialog| | ||
dialog.with_feedback_message(icon_arguments: { icon: :"x-circle", color: :danger }) do |message| | ||
message.with_heading(tag: :h2) { "Ups, something went wrong" } | ||
message.with_description { "Please try again or contact your administrator if the issue persists." } | ||
end | ||
end | ||
%> |
8 changes: 8 additions & 0 deletions
8
lookbook/previews/patterns/feedback_dialog_preview/default.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,8 @@ | ||
<%= | ||
render(Primer::OpenProject::FeedbackDialog.new(open: true)) do |dialog| | ||
dialog.with_feedback_message do |message| | ||
message.with_heading(tag: :h2) { "Success" } | ||
message.with_description { "Great! Everything worked well." } | ||
end | ||
end | ||
%> |
8 changes: 8 additions & 0 deletions
8
lookbook/previews/patterns/feedback_dialog_preview/loading.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,8 @@ | ||
<%= | ||
render(Primer::OpenProject::FeedbackDialog.new(open: true)) do |dialog| | ||
dialog.with_feedback_message(loading: true) do |message| | ||
message.with_heading(tag: :h2) { "Waiting" } | ||
message.with_description { "The job is currently running.." } | ||
end | ||
end | ||
%> |