consolidate all external links through external_link component
All checks were successful
deploy / deploy (push) Successful in 1m32s
All checks were successful
deploy / deploy (push) Successful in 1m32s
Add icon={false} option to external_link for links with their own
visual indicator. Migrate remaining manual target="_blank" links:
email settings adapter links, product show provider edit, card radio
links, social link cards/icons, page renderer tracking and video
fallback. Every external link in the codebase now goes through the
single component — one place to change rel, target, or sr-only text.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ defmodule BerrypodWeb.ShopComponents.Content do
|
||||
|
||||
use Phoenix.Component
|
||||
|
||||
import BerrypodWeb.CoreComponents, only: [external_link: 1]
|
||||
import BerrypodWeb.ShopComponents.Base
|
||||
|
||||
@default_social_links [
|
||||
@@ -421,18 +422,16 @@ defmodule BerrypodWeb.ShopComponents.Content do
|
||||
<h3 class="card-heading">{@title}</h3>
|
||||
<div class="social-link-card-list">
|
||||
<%= for link <- @links do %>
|
||||
<a
|
||||
<.external_link
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
icon={false}
|
||||
class="social-link-card-item themed-button-outline"
|
||||
>
|
||||
<span class="social-link-card-icon">
|
||||
<.social_icon platform={link.platform} />
|
||||
</span>
|
||||
<span>{link.label}</span>
|
||||
<span class="sr-only">(opens in new tab)</span>
|
||||
</a>
|
||||
</.external_link>
|
||||
<% end %>
|
||||
</div>
|
||||
</.shop_card>
|
||||
@@ -458,15 +457,14 @@ defmodule BerrypodWeb.ShopComponents.Content do
|
||||
~H"""
|
||||
<div class="social-links">
|
||||
<%= for link <- @links do %>
|
||||
<a
|
||||
<.external_link
|
||||
href={link.url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
icon={false}
|
||||
class="social-link"
|
||||
aria-label={link.label}
|
||||
>
|
||||
<.social_icon platform={link.platform} />
|
||||
</a>
|
||||
</.external_link>
|
||||
<% end %>
|
||||
</div>
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user