Skip to content

Commit

Permalink
Merge pull request #5269 from nebulab/waiting-for-dev/admin/use_globa…
Browse files Browse the repository at this point in the history
…l_icon_helper

[Admin] Use the global icon helper for the toast component
  • Loading branch information
waiting-for-dev authored Jul 21, 2023
2 parents 336aa8c + 61dbd3d commit b19fd5d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
data-<%= stimulus_id %>-closing-class="transform opacity-0 transition duration-500"
data-<%= stimulus_id %>-transition-value="500"
>
<%= icon_tag(@icon, class_names: 'inline-block mr-3') if @icon %>
<%= icon_tag(@icon, class: 'inline-block w-[1.125rem] h-[1.125rem] mr-3 fill-current') if @icon %>

<p class="inline-block body-tiny-bold"><%= @text %></p>

Expand All @@ -16,6 +16,6 @@
title="<%= t('.close_text') %>"
data-action="<%= stimulus_id %>#close"
>
<%= icon_tag('close-line') %>
<%= icon_tag('close-line', class: "w-[1.125rem] h-[1.125rem] fill-current") %>
</button>
</div>
11 changes: 0 additions & 11 deletions admin/app/components/solidus_admin/ui/toast/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,4 @@ def initialize(text:, icon: nil, scheme: :default)
@icon = icon
@scheme = scheme.to_sym
end

def icon_tag(icon, class_names: nil)
href = image_path("solidus_admin/remixicon.symbol.svg") + "#ri-#{icon}"
tag.svg(
class: "w-[1.125rem] h-[1.125rem] fill-current #{class_names}",
) do
tag.use(
"xlink:href": href
)
end
end
end

0 comments on commit b19fd5d

Please sign in to comment.