Adds the portfolio page
The ten live photos in a filterable masonry grid with an accessible lightbox, filters per shoot type kept in the URL (?shoot=), the shared Instagram block, and an indexed page with image gallery structured data and its own preview image. Soorten fotoshoots now only links to the portfolio for shoot types that have photos there. The filter bar stays on one row, so the web font loading no longer shifts the photos below it, and no photo loads before the page has: the grid fades in, so loading its photos early only delayed the fonts and the intro text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,17 +1,80 @@
|
||||
import { createFileRoute } from '@tanstack/react-router';
|
||||
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
||||
import InstagramGrid from '../components/InstagramGrid/InstagramGrid';
|
||||
import PageIntro from '../components/PageIntro/PageIntro';
|
||||
import { pageHead } from '../seo';
|
||||
import PortfolioGallery from '../components/portfolio/PortfolioGallery/PortfolioGallery';
|
||||
import instagramContent from '../content/instagramContent';
|
||||
import portfolioContent from '../content/portfolioContent';
|
||||
import shootTypes from '../content/shootTypes';
|
||||
import siteContent from '../content/siteContent';
|
||||
import type { ShootTypeId } from '../content/types';
|
||||
import { isShootTypeId } from '../lib/portfolioFilters';
|
||||
import { visibleSocials } from '../lib/visibleSocials';
|
||||
import { galleryImages, pageHead, structuredDataScript, webPage } from '../seo';
|
||||
|
||||
// ?shoot= from a filter or a "Bekijk meer …foto's" link: only a known shoot
|
||||
// type is kept, so links to it are type-checked (BR-SP-01). Whether that
|
||||
// type has photos is checked on the page.
|
||||
type PortfolioSearch = { shoot?: ShootTypeId };
|
||||
|
||||
const shootTypeIds = shootTypes.map((type) => type.id);
|
||||
|
||||
export const Route = createFileRoute('/portfolio')({
|
||||
head: () => pageHead('/portfolio'),
|
||||
validateSearch: (search: Record<string, unknown>): PortfolioSearch => {
|
||||
const value =
|
||||
typeof search.shoot === 'string'
|
||||
? search.shoot.trim().toLowerCase()
|
||||
: undefined;
|
||||
return isShootTypeId(value, shootTypeIds) ? { shoot: value } : {};
|
||||
},
|
||||
head: () => ({
|
||||
...pageHead('/portfolio'),
|
||||
scripts: [
|
||||
structuredDataScript(
|
||||
webPage('ImageGallery', '/portfolio', {
|
||||
associatedMedia: galleryImages(portfolioContent.photos),
|
||||
}),
|
||||
),
|
||||
],
|
||||
}),
|
||||
component: Portfolio,
|
||||
});
|
||||
|
||||
// Placeholder tot de echte pagina er is (noindex via sitePages)
|
||||
// The portfolio (LAYOUT.md: Intro → Portfolio → Instagram): the photos with
|
||||
// filters and lightbox, then the same Instagram block as on the homepage
|
||||
function Portfolio() {
|
||||
const { shoot } = Route.useSearch();
|
||||
const navigate = useNavigate({ from: Route.fullPath });
|
||||
const { intro, photos } = portfolioContent;
|
||||
// Without a valid https link the tiles would lead nowhere: no section
|
||||
const instagram = visibleSocials(siteContent.socials).find(
|
||||
(social) => social.platform === 'instagram',
|
||||
);
|
||||
|
||||
return (
|
||||
<PageIntro eyebrow="Werk" title="Portfolio">
|
||||
Deze pagina is nog in de maak. Kom snel terug!
|
||||
</PageIntro>
|
||||
<>
|
||||
<PageIntro eyebrow={intro.eyebrow} title={intro.title}>
|
||||
{intro.text}
|
||||
</PageIntro>
|
||||
<PortfolioGallery
|
||||
photos={photos}
|
||||
shootTypes={shootTypes}
|
||||
shoot={shoot}
|
||||
// The filter is a view, not a step: no history entry per
|
||||
// change and no jump to the top (application design Q4)
|
||||
onShootChange={(next) =>
|
||||
navigate({
|
||||
search: next ? { shoot: next } : {},
|
||||
replace: true,
|
||||
resetScroll: false,
|
||||
})
|
||||
}
|
||||
/>
|
||||
{instagram && (
|
||||
<InstagramGrid
|
||||
content={instagramContent}
|
||||
profileUrl={instagram.href}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,11 @@ import PageIntro from '../components/PageIntro/PageIntro';
|
||||
import RichParagraph from '../components/RichParagraph/RichParagraph';
|
||||
import ShootList from '../components/shoots/ShootList/ShootList';
|
||||
import packages from '../content/packages';
|
||||
import portfolioContent from '../content/portfolioContent';
|
||||
import shootTypes from '../content/shootTypes';
|
||||
import shootTypesPageContent from '../content/shootTypesPageContent';
|
||||
import siteContent from '../content/siteContent';
|
||||
import { shootTypesWithPhotos } from '../lib/portfolioFilters';
|
||||
import { isPortfolioLive } from '../lib/shootLinks';
|
||||
import { jsonLdScript, pageHead, shootServices, webPage } from '../seo';
|
||||
import sitePages from '../sitePages';
|
||||
@@ -43,7 +45,14 @@ function PhotoshootTypes() {
|
||||
<ShootList
|
||||
shoots={shootTypes}
|
||||
packages={packages}
|
||||
portfolioLive={isPortfolioLive(sitePages)}
|
||||
portfolioShoots={
|
||||
isPortfolioLive(sitePages)
|
||||
? shootTypesWithPhotos(
|
||||
shootTypes,
|
||||
portfolioContent.photos,
|
||||
).map((type) => type.id)
|
||||
: []
|
||||
}
|
||||
/>
|
||||
<CallToAction
|
||||
title={closing.title}
|
||||
|
||||
Reference in New Issue
Block a user