Add icons to social links
This commit is contained in:
parent
5a4f314aab
commit
d04ff35533
@ -9,3 +9,7 @@
|
|||||||
a .profile
|
a .profile
|
||||||
span, p
|
span, p
|
||||||
color: black
|
color: black
|
||||||
|
|
||||||
|
.social-links
|
||||||
|
.x-logo
|
||||||
|
width: 1.4rem
|
||||||
|
|||||||
@ -7,12 +7,18 @@
|
|||||||
%p
|
%p
|
||||||
= @profile.summary
|
= @profile.summary
|
||||||
|
|
||||||
-# Social Links
|
.social-links
|
||||||
%p
|
-# = "<svg class='x-logo' viewBox='0 0 24 24' aria-hidden='true'><g><path d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'></path></g></svg>".html_safe
|
||||||
- @profile.social_links.each do |social_link|
|
%p
|
||||||
= link_to "#{social_link.url}", "https://#{social_link.url}"
|
- @profile.social_links.each do |social_link|
|
||||||
- if policy(@profile).edit?
|
- case social_link.url
|
||||||
%br= link_to '+ Add Social Link', new_social_link_path(profile_id: @profile.id)
|
- when /twitter\.com/, /x\.com/
|
||||||
|
- social_icon = "<svg class='x-logo' viewBox='0 0 24 24' aria-hidden='true'><g><path d='M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z'></path></g></svg>"
|
||||||
|
-# = link_to "#{social_icon} #{social_link.url}".html_safe, "https://#{social_link.url}"
|
||||||
|
= link_to "https://#{social_link.url}" do
|
||||||
|
#{social_icon.try("html_safe") || "🌐"}
|
||||||
|
- if policy(@profile).edit?
|
||||||
|
%br= link_to '+ Add Social Link', new_social_link_path(profile_id: @profile.id)
|
||||||
|
|
||||||
%h2 About #{@profile.name}
|
%h2 About #{@profile.name}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user