[openstreetmap/openstreetmap-website] Add social sharing functionality (PR #4985)

Anton Khorev notifications at github.com
Thu Aug 15 13:37:33 UTC 2024


@AntonKhorev commented on this pull request.



> +  def render_social_share_buttons(opts = {})
+    sites = opts.fetch(:allow_sites, [])
+    valid_sites, invalid_sites = SocialShareButtonHelper.filter_allowed_sites(sites)
+
+    # Log invalid sites
+    invalid_sites.each do |invalid_site|
+      Rails.logger.error("Invalid site or icon not configured: #{invalid_site}")
+    end
+
+    tag.div(
+      :class => "social-share-button d-flex gap-1 align-items-end flex-wrap"
+    ) do
+      valid_sites.map do |site|
+        link_to SocialShareButtonHelper.generate_share_url(site, opts), {
+          :rel => ["nofollow", opts[:rel]].compact,
+          :class => "ssb-icon",

If all icons are going to be circular, you can add the `rounded-circle` class to get circular focus outlines:
![image](https://github.com/user-attachments/assets/1579367a-7572-40af-a5bc-98fe40c71d1f)


-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4985#pullrequestreview-2240412597
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4985/review/2240412597 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240815/752936de/attachment-0001.htm>


More information about the rails-dev mailing list