Update homepage routes to include language and mode
Build & Deploy / Build & Push Docker Image (push) Successful in 2m51s
Test / Type Check (all packages) (push) Successful in 52s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 39s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 1m0s
Build & Deploy / Build & Push Docker Image (push) Successful in 2m51s
Test / Type Check (all packages) (push) Successful in 52s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 49s
Test / Homepage Unit Tests (push) Successful in 44s
Test / Storefront Unit Tests (push) Successful in 39s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 1m0s
This commit is contained in:
@@ -1,36 +1,50 @@
|
||||
import { StatusBadge } from '@/components/foundation/StatusBadge';
|
||||
import { accountCreateUrl } from '@/lib/account-urls';
|
||||
import { localizedPath, type Locale } from '@/lib/localization/config';
|
||||
import { localizedModePath, type Locale } from '@/lib/localization/config';
|
||||
import type { ShellMessages } from '@/lib/localization/messages';
|
||||
import type { ThemePreference } from '@/lib/theme/config';
|
||||
import Image from 'next/image';
|
||||
import styles from './SiteFooter.module.css';
|
||||
|
||||
function signInUrl(locale: Locale): string {
|
||||
return localizedPath('sign-in', locale);
|
||||
function signInUrl(locale: Locale, mode: ThemePreference): string {
|
||||
return localizedModePath('sign-in', locale, mode);
|
||||
}
|
||||
|
||||
interface SiteFooterProps {
|
||||
locale: Locale;
|
||||
mode: ThemePreference;
|
||||
messages: ShellMessages;
|
||||
}
|
||||
|
||||
function HashLink({ locale, hash, children }: { locale: Locale; hash: string; children: string }) {
|
||||
return <a href={`${localizedPath('home', locale)}#${hash}`}>{children}</a>;
|
||||
function HashLink({
|
||||
locale,
|
||||
mode,
|
||||
hash,
|
||||
children,
|
||||
}: {
|
||||
locale: Locale;
|
||||
mode: ThemePreference;
|
||||
hash: string;
|
||||
children: string;
|
||||
}) {
|
||||
return <a href={`${localizedModePath('home', locale, mode)}#${hash}`}>{children}</a>;
|
||||
}
|
||||
|
||||
function PendingRouteLink({
|
||||
locale,
|
||||
mode,
|
||||
routeId,
|
||||
label,
|
||||
pending,
|
||||
}: {
|
||||
locale: Locale;
|
||||
mode: ThemePreference;
|
||||
routeId: 'sign-in' | 'forgot-password' | 'privacy' | 'terms' | 'accessibility';
|
||||
label: string;
|
||||
pending: string;
|
||||
}) {
|
||||
return (
|
||||
<a className={styles.legalLink} href={localizedPath(routeId, locale)}>
|
||||
<a className={styles.legalLink} href={localizedModePath(routeId, locale, mode)}>
|
||||
<span>{label}</span>
|
||||
<StatusBadge>{pending}</StatusBadge>
|
||||
</a>
|
||||
@@ -46,7 +60,7 @@ function PendingItem({ label, pending }: { label: string; pending: string }) {
|
||||
);
|
||||
}
|
||||
|
||||
export function SiteFooter({ locale, messages }: SiteFooterProps) {
|
||||
export function SiteFooter({ locale, mode, messages }: SiteFooterProps) {
|
||||
const footer = messages.footer;
|
||||
const year = new Date().getUTCFullYear();
|
||||
|
||||
@@ -74,22 +88,22 @@ export function SiteFooter({ locale, messages }: SiteFooterProps) {
|
||||
<h2 id="footer-product">{footer.groups.product}</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<HashLink locale={locale} hash="workflow">
|
||||
<HashLink locale={locale} mode={mode} hash="workflow">
|
||||
{footer.links.workflow}
|
||||
</HashLink>
|
||||
</li>
|
||||
<li>
|
||||
<HashLink locale={locale} hash="modules">
|
||||
<HashLink locale={locale} mode={mode} hash="modules">
|
||||
{footer.links.modules}
|
||||
</HashLink>
|
||||
</li>
|
||||
<li>
|
||||
<HashLink locale={locale} hash="pricing">
|
||||
<HashLink locale={locale} mode={mode} hash="pricing">
|
||||
{footer.links.pricing}
|
||||
</HashLink>
|
||||
</li>
|
||||
<li>
|
||||
<HashLink locale={locale} hash="faq">
|
||||
<HashLink locale={locale} mode={mode} hash="faq">
|
||||
{footer.links.faq}
|
||||
</HashLink>
|
||||
</li>
|
||||
@@ -112,7 +126,7 @@ export function SiteFooter({ locale, messages }: SiteFooterProps) {
|
||||
<h2 id="footer-account">{footer.groups.account}</h2>
|
||||
<ul>
|
||||
<li>
|
||||
<a href={signInUrl(locale)}>
|
||||
<a href={signInUrl(locale, mode)}>
|
||||
{footer.links.login}
|
||||
</a>
|
||||
</li>
|
||||
@@ -125,6 +139,7 @@ export function SiteFooter({ locale, messages }: SiteFooterProps) {
|
||||
<li>
|
||||
<PendingRouteLink
|
||||
locale={locale}
|
||||
mode={mode}
|
||||
routeId="privacy"
|
||||
label={footer.links.privacy}
|
||||
pending={footer.pending}
|
||||
@@ -133,6 +148,7 @@ export function SiteFooter({ locale, messages }: SiteFooterProps) {
|
||||
<li>
|
||||
<PendingRouteLink
|
||||
locale={locale}
|
||||
mode={mode}
|
||||
routeId="terms"
|
||||
label={footer.links.terms}
|
||||
pending={footer.pending}
|
||||
@@ -141,6 +157,7 @@ export function SiteFooter({ locale, messages }: SiteFooterProps) {
|
||||
<li>
|
||||
<PendingRouteLink
|
||||
locale={locale}
|
||||
mode={mode}
|
||||
routeId="accessibility"
|
||||
label={footer.links.accessibility}
|
||||
pending={footer.pending}
|
||||
|
||||
Reference in New Issue
Block a user