release: v0.20.0

This commit is contained in:
Ralksta
2026-10-02 18:14:23 +02:00
committed by GitHub
parent 81ce886b01
commit 5f831f719a
209 changed files with 13807 additions and 803 deletions

View File

@@ -6,6 +6,7 @@
*/
import { useState } from 'react';
import Link from 'next/link';
import styles from './PasswordGate.module.css';
import { useDictionary } from './I18nProvider';
@@ -13,6 +14,11 @@ interface PasswordGateProps {
slug: string;
title: string;
type?: 'subpage' | 'album' | 'journal' | 'page' | 'site';
/**
* Links shown under the card. The site gate passes its legal pages here,
* which a locked site still serves (proxy.ts, UNGATED_PAGES).
*/
legalLinks?: { href: string; label: string }[];
}
/** Whole seconds from a `Retry-After` header, or null when there is none. */
@@ -21,7 +27,12 @@ function retryAfterSeconds(res: Response): number | null {
return Number.isFinite(seconds) && seconds > 0 ? seconds : null;
}
export default function PasswordGate({ slug, title, type = 'subpage' }: PasswordGateProps) {
export default function PasswordGate({
slug,
title,
type = 'subpage',
legalLinks = [],
}: PasswordGateProps) {
const t = useDictionary();
const [password, setPassword] = useState('');
const [error, setError] = useState('');
@@ -119,6 +130,15 @@ export default function PasswordGate({ slug, title, type = 'subpage' }: Password
</p>
)}
</div>
{legalLinks.length > 0 && (
<nav className={styles.legal} aria-label={t.password.legalNavAria}>
{legalLinks.map(({ href, label }) => (
<Link key={href} href={href} className="footer__legal-link">
{label}
</Link>
))}
</nav>
)}
</div>
);
}