Skip to content

Commit

Permalink
Add clapping icon to congratulations message after writing a comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Jan 30, 2024
1 parent 3573660 commit 371df4f
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
26 changes: 26 additions & 0 deletions app/assets/images/tailwind/clapping.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/components/tailwind/alert_component.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="flex items-center px-4 py-3 text-2xl font-bold text-white rounded-lg <%= @bg_class %>">
<div class="flex <%= @alignment_class %> <%= @padding_class %> text-2xl font-bold text-white rounded-lg <%= @bg_class %>">
<%= image_tag @image_src, class: "mr-5", alt: @image_alt %>
<div><%= content %></div>
</div>
10 changes: 10 additions & 0 deletions app/components/tailwind/alert_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,20 @@ def initialize(type:)
case type
when :success
@bg_class = T.let("bg-lavender", String)
@alignment_class = T.let("items-center", String)
@padding_class = T.let("px-4 py-3", String)
@image_src = T.let("tailwind/tick.svg", String)
@image_alt = T.let("Success", 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)
@image_src = T.let("tailwind/clapping.svg", String)
@image_alt = T.let("Congratulations", String)
when :warning
@bg_class = "bg-error-red"
@alignment_class = T.let("items-center", String)
@padding_class = T.let("px-4 py-3", String)
@image_src = "tailwind/warning.svg"
@image_alt = "Warning"
else
Expand Down
6 changes: 3 additions & 3 deletions app/views/_tailwind/applications/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@
<div class="pt-12" id="comment<%= comment.id %>">
<% if comment.id == flash[:published_comment_id] %>
<div class="mb-8">
<%= render Tailwind::AlertComponent.new(type: :success) do %>
<div class="m-4 mb-6 text-3xl">
<p class="mb-6">
<%= render Tailwind::AlertComponent.new(type: :congratulations) do %>
<div class="mb-4 ml-4 text-3xl">
<p class="mb-8">
Thanks, your comment has been sent to <%= comment.comment_recipient_full_name %> and posted below!
</p>
<%= render Tailwind::ButtonComponent.new(tag: :a, size: "2xl", icon: :share, type: :inverse_lavender, href: "https://www.facebook.com/sharer/sharer.php?u=#{comment_url(Comment.first)}&t=") do %>
Expand Down

0 comments on commit 371df4f

Please sign in to comment.