Skip to content

Commit

Permalink
Add conditional message to save tooltip
Browse files Browse the repository at this point in the history
  • Loading branch information
aliciapaz committed Dec 19, 2024
1 parent 6b1debc commit a78dc23
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/components/save_button/component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
svg_options: { class: "w-4 h-auto", aria_hidden: true }
) %>
<span role="tooltip" id="<%= tooltip_id %>" class="<%= "hidden absolute z-10 px-2 py-1 w-44 text-xs text-white bg-opacity-90 rounded-lg transform bg-gray-2 #{@tooltip_position}" %>" >
Save this nonprofit to you account!
<% if @removable_fav_location %>
Remove this nonprofit from your account
<% else %>
Save this nonprofit to you account!
<% end %>
</span>
<span class="<%= copy_styles %>">Save</span>
<% end %>
1 change: 1 addition & 0 deletions app/components/save_button/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def initialize(user:, location:, simplified: false, tooltip_position: "")
@location = location
@simplified = simplified
@tooltip_position = tooltip_position
@removable_fav_location = removable_fav_location?
end

def link_args
Expand Down

0 comments on commit a78dc23

Please sign in to comment.