refactor: extract skip_link to shared ShopComponents module
Move the accessibility skip link from ThemeLive.PreviewPages to the shared ShopComponents module for reuse on public storefront pages. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5f3efebdfc
commit
0e998fdac9
@ -38,4 +38,18 @@ defmodule SimpleshopThemeWeb.ShopComponents do
|
||||
</div>
|
||||
"""
|
||||
end
|
||||
|
||||
@doc """
|
||||
Renders the skip link for keyboard navigation accessibility.
|
||||
|
||||
This is a standard accessibility pattern that allows keyboard users
|
||||
to skip directly to the main content.
|
||||
"""
|
||||
def skip_link(assigns) do
|
||||
~H"""
|
||||
<a href="#main-content" class="skip-link">
|
||||
Skip to main content
|
||||
</a>
|
||||
"""
|
||||
end
|
||||
end
|
||||
|
||||
@ -4,16 +4,6 @@ defmodule SimpleshopThemeWeb.ThemeLive.PreviewPages do
|
||||
|
||||
embed_templates "preview_pages/*"
|
||||
|
||||
@doc """
|
||||
Renders the skip link for keyboard navigation accessibility.
|
||||
"""
|
||||
def skip_link(assigns) do
|
||||
~H"""
|
||||
<a href="#main-content" class="skip-link">
|
||||
Skip to main content
|
||||
</a>
|
||||
"""
|
||||
end
|
||||
|
||||
@doc """
|
||||
Renders the shop header with logo based on logo_mode setting.
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="shop-container min-h-screen" style="position: relative; background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);">
|
||||
<!-- Skip Link for Accessibility -->
|
||||
<SimpleshopThemeWeb.ThemeLive.PreviewPages.skip_link />
|
||||
<.skip_link />
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="shop-container min-h-screen" style="position: relative; background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);">
|
||||
<!-- Skip Link for Accessibility -->
|
||||
<SimpleshopThemeWeb.ThemeLive.PreviewPages.skip_link />
|
||||
<.skip_link />
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="shop-container min-h-screen" style="position: relative; background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);">
|
||||
<!-- Skip Link for Accessibility -->
|
||||
<SimpleshopThemeWeb.ThemeLive.PreviewPages.skip_link />
|
||||
<.skip_link />
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="shop-container min-h-screen" style="position: relative; background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);">
|
||||
<!-- Skip Link for Accessibility -->
|
||||
<SimpleshopThemeWeb.ThemeLive.PreviewPages.skip_link />
|
||||
<.skip_link />
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="shop-container min-h-screen" style="position: relative; background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);">
|
||||
<!-- Skip Link for Accessibility -->
|
||||
<SimpleshopThemeWeb.ThemeLive.PreviewPages.skip_link />
|
||||
<.skip_link />
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="shop-container min-h-screen" style="background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);">
|
||||
<!-- Skip Link for Accessibility -->
|
||||
<SimpleshopThemeWeb.ThemeLive.PreviewPages.skip_link />
|
||||
<.skip_link />
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
%>
|
||||
<div class="shop-container min-h-screen" style="position: relative; background-color: var(--t-surface-base); font-family: var(--t-font-body); color: var(--t-text-primary);">
|
||||
<!-- Skip Link for Accessibility -->
|
||||
<SimpleshopThemeWeb.ThemeLive.PreviewPages.skip_link />
|
||||
<.skip_link />
|
||||
|
||||
<!-- Announcement Bar -->
|
||||
<%= if @theme_settings.announcement_bar do %>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user