-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- #1187 While attempting to use the `IconButtonComponent` for the `Marketplace::Cart::DeliveryAddress#update` flow, we realized we didn't have the affordances we needed to adjust the component. So we introduced a constructor parameter for setting arbitrary classes on the component, which makes it possible for us to adjust the padding/text/background/etc. 🛠️🧹 `Component`: rename `IconButtonComponent` It seems like `ButtonComponent` is a more appropriate name, given that: - It doesn't have any `Icon` *specific* behavior and - It's shorter Co-authored-by: Naomi Quinones <[email protected]>
- Loading branch information
1 parent
de7596d
commit dc230dd
Showing
10 changed files
with
32 additions
and
24 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,10 @@ | ||
<%- if @disabled %> | ||
<span class="no-underline bg-transparent hover:bg-primary-100 text-gray-700 button #{classes}"><%= @label %></span> | ||
<%- else %> | ||
<%= link_to @label, | ||
@href, | ||
title: @title, | ||
method: @method, | ||
data: data, | ||
class: "no-underline bg-transparent hover:bg-primary-100 text-gray-700 button #{classes}" %> | ||
<%- end %> |
8 changes: 6 additions & 2 deletions
8
app/components/icon_button_component.rb → app/components/button_component.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
This file was deleted.
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
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,5 @@ | ||
class ButtonComponentPreview < ViewComponent::Preview | ||
def test | ||
render(ButtonComponent.new(label: "Awooo!", title: "gaaa!", href: "#")) | ||
end | ||
end |