-
-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: frontend changes based on feedback
- Loading branch information
1 parent
646dea4
commit 886328e
Showing
8 changed files
with
146 additions
and
43 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<div class="dropdown"> | ||
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false"> | ||
<span class="sr-only"><%= @menu_title %></span> | ||
<svg width="5" height="20" viewBox="0 0 5 20" fill="none" xmlns="http://www.w3.org/2000/svg"> | ||
<title><%= @menu_title %></title> | ||
<path d="M2.5 0.9375C1.82292 0.9375 1.23698 1.17188 0.742187 1.64063C0.247396 2.10938 -7.68364e-08 2.69531 -1.07571e-07 3.39844C-1.38306e-07 4.10156 0.247396 4.70052 0.742187 5.19531C1.23698 5.6901 1.82292 5.9375 2.5 5.9375C3.17708 5.9375 3.76302 5.6901 4.25781 5.19531C4.7526 4.70052 5 4.10156 5 3.39844C5 2.69531 4.7526 2.10938 4.25781 1.64063C3.76302 1.17188 3.17708 0.9375 2.5 0.9375ZM2.5 7.5C1.82292 7.5 1.23698 7.7474 0.742187 8.24219C0.247395 8.73698 -3.66538e-07 9.32292 -3.96134e-07 10C-4.25731e-07 10.6771 0.247395 11.263 0.742187 11.7578C1.23698 12.2526 1.82292 12.5 2.5 12.5C3.17708 12.5 3.76302 12.2526 4.25781 11.7578C4.7526 11.263 5 10.6771 5 10C5 9.32292 4.7526 8.73698 4.25781 8.24219C3.76302 7.7474 3.17708 7.5 2.5 7.5ZM2.5 14.0625C1.82292 14.0625 1.23698 14.3099 0.742187 14.8047C0.247395 15.2995 -6.53963e-07 15.8984 -6.84698e-07 16.6016C-7.15432e-07 17.3047 0.247395 17.8906 0.742187 18.3594C1.23698 18.8281 1.82292 19.0625 2.5 19.0625C3.17708 19.0625 3.76302 18.8281 4.25781 18.3594C4.7526 17.8906 5 17.3047 5 16.6016C5 15.8984 4.7526 15.2995 4.25781 14.8047C3.76302 14.3099 3.17708 14.0625 2.5 14.0625Z" fill="#5D657B"/> | ||
</svg> | ||
</button> | ||
<ul class="dropdown-menu"> | ||
<%= content %> | ||
</ul> | ||
</div> |
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,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class KebabMenuComponent < ViewComponent::Base | ||
renders_one :menu_content | ||
|
||
def initialize(menu_title: "Menu") | ||
@menu_title = menu_title | ||
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,43 @@ | ||
<% if @has_button %> | ||
<button type="button" class="btn" data-bs-toggle="modal" data-bs-target="<%= "##{@id}" %>" style="width: 100%; text-align: left;"> | ||
<% if open_button %> | ||
<%= open_button %> | ||
<% elsif @button_value %> | ||
<%= @button_value %> | ||
<% else %> | ||
Open Modal | ||
<% end %> | ||
</button> | ||
<% end %> | ||
|
||
<% if @has_modal %> | ||
<div class="modal fade" id="<%= @id %>" tabindex="-1" aria-labelledby="<%= @id %>Label" aria-hidden="true"> | ||
<div class="modal-dialog modal-dialog-centered"> | ||
<div class="modal-content"> | ||
<div class="modal-header"> | ||
<h1 class="modal-title fs-5" id="<%= @id %>Label"> | ||
<% if @header_text %> | ||
<%= @header_text %> | ||
<% end %> | ||
<% if modal_header %> | ||
<%= modal_header %> | ||
<% end %> | ||
</h1> | ||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
</div> | ||
<div class="modal-body"> | ||
<% if @body_text %> | ||
<p><%= @body_text %></p> | ||
<% end %> | ||
<% if modal_content %> | ||
<%= modal_content %> | ||
<% end %> | ||
</div> | ||
<div class="modal-footer"> | ||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
<% if modal_footer? %><%= modal_footer %><% end %> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<% 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,17 @@ | ||
# frozen_string_literal: true | ||
|
||
class ModalComponent < ViewComponent::Base | ||
renders_one :open_button | ||
renders_one :modal_header | ||
renders_one :modal_content | ||
renders_one :modal_footer | ||
|
||
def initialize(button: true, modal: true, button_value: nil, header_text: nil, body_text: nil, id: Digest::UUID.uuid_v4) | ||
@has_button = button | ||
@has_modal = modal | ||
@button_value = button_value | ||
@header_text = header_text | ||
@body_text = body_text | ||
@id = id | ||
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,4 @@ | ||
module ViewHelper | ||
def kebab_menu(&block) | ||
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
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