Skip to content

Commit

Permalink
Small refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed May 16, 2024
1 parent d26d3f0 commit 9c38fb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/components/tailwind/alert_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="flex <%= @alignment_class %> <%= @padding_class %> text-2xl font-bold text-white rounded-lg <%= @bg_class %>">
<div class="mr-5 <%= @icon_class %>">
<div class="flex gap-5 <%= @alignment_class %> <%= @padding_class %> text-2xl font-bold text-white rounded-lg <%= @bg_class %>">
<div class="<%= @icon_class %>">
<%= render Tailwind::Icon.new(name: @icon_name) %>
</div>
<div><%= content %></div>
Expand Down
10 changes: 5 additions & 5 deletions app/components/tailwind/alert_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ def initialize(type:)
@icon_name = T.let(:tick, Symbol)
@icon_class = T.let("text-light-lavender", String)
when :congratulations
@bg_class = T.let("bg-lavender", String)
@alignment_class = T.let("items-start", String)
@padding_class = T.let("px-8 py-8", String)
@bg_class = "bg-lavender"
@alignment_class = "items-start"
@padding_class = "px-8 py-8"
@icon_name = :clapping
@icon_class = "text-light-lavender"
when :warning
@bg_class = "bg-error-red"
@alignment_class = T.let("items-center", String)
@padding_class = T.let("px-4 py-3", String)
@alignment_class = "items-center"
@padding_class = "px-4 py-3"
@icon_name = :warning
@icon_class = "text-white"
else
Expand Down

0 comments on commit 9c38fb0

Please sign in to comment.