Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions app/components/posts/card_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ module Posts
class CardComponent < ViewComponent::Base
delegate :inline_svg_tag, to: :helpers

attr_reader :post, :current_user, :theme, :compact, :show_likes, :show_comments, :show_reposts, :show_actions, :source, :position, :page, :feed_request_id, :track_engagement, :current_user_reposted_post_ids, :show_views
attr_reader :post, :current_user, :theme, :compact, :show_likes, :show_comments, :show_reposts, :show_actions, :source, :position, :page, :feed_request_id, :track_engagement, :current_user_reposted_post_ids, :show_views, :clickable

def initialize(post:, current_user: nil, theme: :feed, compact: false, show_likes: true, show_comments: true, show_reposts: true, show_actions: true, source: nil, position: nil, page: nil, feed_request_id: nil, track_engagement: true, current_user_reposted_post_ids: nil, show_views: nil)
def initialize(post:, current_user: nil, theme: :feed, compact: false, show_likes: true, show_comments: true, show_reposts: true, show_actions: true, source: nil, position: nil, page: nil, feed_request_id: nil, track_engagement: true, current_user_reposted_post_ids: nil, show_views: nil, clickable: true)
@post = post
@current_user = current_user
@theme = theme
Expand All @@ -22,6 +22,7 @@ def initialize(post:, current_user: nil, theme: :feed, compact: false, show_like
@track_engagement = track_engagement
@current_user_reposted_post_ids = current_user_reposted_post_ids
@show_views = show_views
@clickable = clickable
end

def render?
Expand All @@ -47,7 +48,7 @@ def quote_repost?
def card_classes
class_names(
"feed-post-card",
"feed-post-card--linked": card_link_url.present?,
"feed-post-card--linked": card_link_url.present? && clickable,
"feed-post-card--compact": compact,
"feed-post-card--quote-repost": quote_repost?,
"feed-post-card--#{theme}": theme.present?
Expand All @@ -60,7 +61,9 @@ def card_data
return data if url.blank?

controllers = [ data[:controller], "card-link" ].compact.join(" ")
actions = [ data[:action], "click->card-link#navigate auxclick->card-link#navigate" ].compact.join(" ")
if clickable
actions = [ data[:action], "click->card-link#navigate auxclick->card-link#navigate" ].compact.join(" ")
end

data.merge(

@EnterpriseGoose EnterpriseGoose Jun 25, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of just commenting out the actions, can you make it not have any clickable data if the card is not clickable so it makes a fully clean, static card?

controller: controllers,
Expand Down
3 changes: 2 additions & 1 deletion app/views/projects/devlogs/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
post: @post,
current_user: current_user,
show_comments: false,
show_actions: current_user.present?
show_actions: current_user.present?,
clickable: false
) %>
</article>

Expand Down