forked from ontoportal/ontoportal_web_ui
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #236 from ontoportal-lirmm/feature/lookbook
Feature: Add Lookbook to preview components
- Loading branch information
1 parent
95535c4
commit 15302b0
Showing
8 changed files
with
44 additions
and
5 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
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,12 @@ | ||
<html> | ||
<head> | ||
<title>Component Preview</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<%= stylesheet_link_tag "application" %> | ||
</head> | ||
<body style="margin: 20px"> | ||
|
||
<%= yield %> <!-- rendered preview will be injected here --> | ||
|
||
</body> | ||
</html> |
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
12 changes: 12 additions & 0 deletions
12
test/components/previews/card_message_component_preview.rb
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,12 @@ | ||
class CardMessageComponentPreview < ViewComponent::Preview | ||
|
||
# @param message text | ||
# @param button_text text | ||
# @param type select [success, failure] | ||
# @param button_link text | ||
|
||
def default(message: "Here we can type a success or failure message to the user", button_text: "Do action", type: "success", button_link: "/" ) | ||
render(CardMessageComponent.new(message: message, button_text: button_text, type: type, button_link: button_link)) | ||
end | ||
|
||
end |
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,10 @@ | ||
class ChipsComponentPreview < ViewComponent::Preview | ||
|
||
# @param name text | ||
# @param value text | ||
|
||
def default(name: "name", value: "value") | ||
render(ChipsComponent.new(name: name, value: value)) | ||
end | ||
|
||
end |