diff --git a/app/components/post_preview_component.rb b/app/components/post_preview_component.rb index 914d5d138..dbd9f51e9 100644 --- a/app/components/post_preview_component.rb +++ b/app/components/post_preview_component.rb @@ -4,7 +4,7 @@ class PostPreviewComponent < ApplicationComponent with_collection_parameter :post attr_reader :post, :tags, :show_deleted, :show_cropped, :link_target, :pool, :pool_id, :favgroup_id, :similarity, :recommended, :compact, :size, :current_user, :options - delegate :external_link_to, :time_ago_in_words_tagged, :favorite_icon, to: :helpers + delegate :external_link_to, :time_ago_in_words_tagged, :empty_heart_icon, to: :helpers def initialize(post:, tags: "", show_deleted: false, show_cropped: true, link_target: post, pool: nil, pool_id: nil, favgroup_id: nil, similarity: nil, recommended: nil, compact: nil, size: nil, current_user: CurrentUser.user, **options) @post = post diff --git a/app/components/post_preview_component/post_preview_component.html.erb b/app/components/post_preview_component/post_preview_component.html.erb index 40b0f5366..136c6ad03 100644 --- a/app/components/post_preview_component/post_preview_component.html.erb +++ b/app/components/post_preview_component/post_preview_component.html.erb @@ -38,7 +38,7 @@ <%= link_to recommended_posts_path(search: { post_id: post.id }), class: "more-recommended-posts", "data-post-id": post.id do %> <%= post.fav_count %> - <%= favorite_icon(class: "fa-xs") %> + <%= empty_heart_icon(class: "fa-xs") %>
more ยป <% end %> diff --git a/app/helpers/icon_helper.rb b/app/helpers/icon_helper.rb index d3dde8531..356c73fe9 100644 --- a/app/helpers/icon_helper.rb +++ b/app/helpers/icon_helper.rb @@ -57,10 +57,14 @@ module IconHelper icon_tag("fas fa-bookmark", **options) end - def favorite_icon(**options) + def empty_heart_icon(**options) icon_tag("far fa-heart", **options) end + def solid_heart_icon(**options) + icon_tag("fas fa-heart", **options) + end + def comments_icon(**options) icon_tag("far fa-comments", **options) end diff --git a/app/views/posts/show.html+tooltip.erb b/app/views/posts/show.html+tooltip.erb index 1a43a20ee..4063090ca 100644 --- a/app/views/posts/show.html+tooltip.erb +++ b/app/views/posts/show.html+tooltip.erb @@ -3,7 +3,7 @@ <%= @post.fav_count %> - <%= favorite_icon(class: "fa-xs") %> + <%= empty_heart_icon(class: "fa-xs") %> diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index 420d6ac86..183b4f33d 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -52,11 +52,11 @@ <% if policy(Favorite).create? %> <%= content_tag(:div, class: "fav-buttons fav-buttons-#{@post.favorited_by?(CurrentUser.user)}") do %> <%= form_tag(favorites_path(post_id: @post.id), method: "post", id: "add-fav-button", "data-remote": true) do %> - <%= button_tag favorite_icon, class: "ui-button ui-widget ui-corner-all", "data-disable-with": spinner_icon %> + <%= button_tag empty_heart_icon, class: "ui-button ui-widget ui-corner-all", "data-disable-with": spinner_icon %> <% end %> <%= form_tag(favorite_path(@post.id), method: "delete", id: "remove-fav-button", "data-remote": true) do %> - <%= button_tag favorite_icon, class: "ui-button ui-widget ui-corner-all", "data-disable-with": spinner_icon %> + <%= button_tag solid_heart_icon, class: "ui-button ui-widget ui-corner-all", "data-disable-with": spinner_icon %> <% end %> <% end %> <% end %>