Skip to content

Commit

Permalink
Add UTM tags to other share link
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Nov 21, 2024
1 parent 47315d2 commit 9d3c520
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions app/helpers/comments_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def comment_path(comment)
application_path(comment.application, anchor: "comment#{comment.id}")
end

sig { params(comment: Comment).returns(String) }
def comment_url(comment)
application_url(comment.application, anchor: "comment#{comment.id}")
sig { params(comment: Comment, params: T::Hash[Symbol, String]).returns(String) }
def comment_url(comment, params = {})
application_url(comment.application, { anchor: "comment#{comment.id}" }.merge(params))
end
end
10 changes: 7 additions & 3 deletions app/views/applications/_thanks_for_commenting.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,13 @@
<p class="mb-8">
Thanks, your comment has been sent to <%= comment.comment_recipient_full_name %> and posted below!
</p>
<%= render ShareButtonComponent.new(url: comment_url(comment), title: "My comment on #{page_title(comment.application)}", color: :lavender) do %>
Share your comment
<% end %>
<%# TODO: Make the share button component add the utm tags automatically %>
<%= c = "Share your comment"
render ShareButtonComponent.new(
url: comment_url(comment, utm_source: "share", utm_content: c),
title: "My comment on #{page_title(comment.application)}",
color: :lavender
).with_content(c) %>
</div>
<% end %>
<%# Make the canvas (which is used to show the confetti) the same size as the alert %>
Expand Down

0 comments on commit 9d3c520

Please sign in to comment.