feat: propagate subpage subtitle into deep AlbumDetailView headers
This commit is contained in:
@@ -12,6 +12,7 @@ interface AlbumDetailViewProps {
|
|||||||
gridStyle: React.CSSProperties;
|
gridStyle: React.CSSProperties;
|
||||||
backLinkHref: string;
|
backLinkHref: string;
|
||||||
backLinkLabel: string;
|
backLinkLabel: string;
|
||||||
|
subtitle?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function AlbumDetailView({
|
export function AlbumDetailView({
|
||||||
@@ -21,12 +22,14 @@ export function AlbumDetailView({
|
|||||||
gridStyle,
|
gridStyle,
|
||||||
backLinkHref,
|
backLinkHref,
|
||||||
backLinkLabel,
|
backLinkLabel,
|
||||||
|
subtitle,
|
||||||
}: AlbumDetailViewProps) {
|
}: AlbumDetailViewProps) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="album-header">
|
<div className="album-header">
|
||||||
<BackLink href={backLinkHref} label={backLinkLabel} />
|
<BackLink href={backLinkHref} label={backLinkLabel} />
|
||||||
<h1 className="album-header__title">{album.albumName}</h1>
|
<h1 className="album-header__title">{album.albumName}</h1>
|
||||||
|
{subtitle && <p className="subpage-subtitle" style={{ textAlign: "left", marginLeft: 0 }}>{subtitle}</p>}
|
||||||
<p className="album-header__meta">
|
<p className="album-header__meta">
|
||||||
{images.length} {images.length === 1 ? 'photo' : 'photos'}
|
{images.length} {images.length === 1 ? 'photo' : 'photos'}
|
||||||
{album.description && ` · ${album.description}`}
|
{album.description && ` · ${album.description}`}
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ export default async function PathPage({ params }: PathPageProps) {
|
|||||||
images={images}
|
images={images}
|
||||||
layout={resolveLayout(result.subpage.grid)}
|
layout={resolveLayout(result.subpage.grid)}
|
||||||
gridStyle={buildGridStyle(result.subpage.grid)}
|
gridStyle={buildGridStyle(result.subpage.grid)}
|
||||||
|
subtitle={result.subpage.subtitle}
|
||||||
backLinkHref="/"
|
backLinkHref="/"
|
||||||
backLinkLabel="Back to Gallery"
|
backLinkLabel="Back to Gallery"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in New Issue
Block a user