From 9c38fb024eca254b888c790c5796a16aeb075823 Mon Sep 17 00:00:00 2001 From: Matthew Landauer Date: Thu, 16 May 2024 01:07:35 +0000 Subject: [PATCH] Small refactor --- app/components/tailwind/alert_component.html.erb | 4 ++-- app/components/tailwind/alert_component.rb | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/components/tailwind/alert_component.html.erb b/app/components/tailwind/alert_component.html.erb index 979b35aca..30bdeb308 100644 --- a/app/components/tailwind/alert_component.html.erb +++ b/app/components/tailwind/alert_component.html.erb @@ -1,5 +1,5 @@ -
-
+
+
<%= render Tailwind::Icon.new(name: @icon_name) %>
<%= content %>
diff --git a/app/components/tailwind/alert_component.rb b/app/components/tailwind/alert_component.rb index 7cf744227..d1036ed07 100644 --- a/app/components/tailwind/alert_component.rb +++ b/app/components/tailwind/alert_component.rb @@ -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