consolidate all external links through external_link component
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:
jamey
2026-03-04 07:12:25 +00:00
parent 156a23da16
commit e139a75b69
5 changed files with 27 additions and 33 deletions

View File

@@ -16,7 +16,7 @@ defmodule BerrypodWeb.PageRenderer do
statics: BerrypodWeb.static_paths()
import BerrypodWeb.BlockEditorComponents
import BerrypodWeb.CoreComponents, only: [icon: 1]
import BerrypodWeb.CoreComponents, only: [icon: 1, external_link: 1]
alias Berrypod.Cart
@@ -883,15 +883,12 @@ defmodule BerrypodWeb.PageRenderer do
<% end %>
</div>
<%= if assigns[:order].tracking_url do %>
<a
<.external_link
href={assigns[:order].tracking_url}
target="_blank"
rel="noopener noreferrer"
class="order-detail-tracking-btn themed-button"
aria-label="Track parcel (opens in new tab)"
>
Track parcel
</a>
</.external_link>
<% end %>
</div>
</.shop_card>
@@ -1078,9 +1075,9 @@ defmodule BerrypodWeb.PageRenderer do
</iframe>
</div>
<p :if={@provider == :unknown && @raw_url != ""} class="video-embed-fallback">
<a href={@raw_url} target="_blank" rel="noopener noreferrer">
<.external_link href={@raw_url}>
{if @caption != "", do: @caption, else: "Watch video"}
</a>
</.external_link>
</p>
<p :if={@caption != "" && @provider != :unknown} class="video-embed-caption">{@caption}</p>
</div>