Adds the shoot page layout and the shoot-type submenu
Shoot pages follow design E: breadcrumb, story blocks, process timeline with icons, photo mosaic, FAQ, package block and booking call to action, with per-shoot OG images. The navigation gets a "Soorten fotoshoots" submenu (desktop panel, mobile group) built from shootTypes, with exact current-page matching in menu, footer and breadcrumb. A 404 under /soorten-fotoshoots/ also offers a link back to the overview. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,113 @@
|
||||
import { Box, chakra, Flex } from '@chakra-ui/react';
|
||||
import { isSectionCurrent } from '@/lib/navCurrent';
|
||||
import type { NavMenuEvent } from '@/lib/navMenuState';
|
||||
import type { NavItem } from '@/navigation';
|
||||
import RouterLink from '../RouterLink';
|
||||
import ChevronIcon from './ChevronIcon';
|
||||
|
||||
type MobileNavGroupProps = {
|
||||
item: NavItem & { children: readonly NavItem[] };
|
||||
// Id of the sub-list, for aria-controls
|
||||
id: string;
|
||||
open: boolean;
|
||||
pathname: string;
|
||||
dispatch: (event: NavMenuEvent) => void;
|
||||
};
|
||||
|
||||
// Exact: only the page itself is current (BR-NAV-01), also with a query
|
||||
const exactActive = { exact: true, includeSearch: false } as const;
|
||||
|
||||
const duration = '0.3s';
|
||||
const easing = 'cubic-bezier(.22, .61, .36, 1)';
|
||||
|
||||
// The parent row of the mobile menu: the link to the overview, a chevron
|
||||
// button and an expandable list of sub-pages (BR-NAV-30..36)
|
||||
export default function MobileNavGroup({
|
||||
item,
|
||||
id,
|
||||
open,
|
||||
pathname,
|
||||
dispatch,
|
||||
}: MobileNavGroupProps) {
|
||||
return (
|
||||
<>
|
||||
<Flex alignItems="center" gap={1}>
|
||||
<RouterLink
|
||||
to={item.to}
|
||||
activeOptions={exactActive}
|
||||
onClick={() => dispatch({ type: 'linkChosen' })}
|
||||
display="block"
|
||||
fontFamily="heading"
|
||||
fontSize="1.9rem"
|
||||
color={isSectionCurrent(item, pathname) ? 'accent' : 'ink'}
|
||||
_currentPage={{ color: 'accent' }}
|
||||
>
|
||||
{item.label}
|
||||
</RouterLink>
|
||||
<chakra.button
|
||||
type="button"
|
||||
aria-expanded={open}
|
||||
aria-controls={id}
|
||||
aria-label={`Submenu ${item.label}`}
|
||||
data-open={open || undefined}
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
// 44px: minimaal klikdoel op touch (BR-NAV-40)
|
||||
w="44px"
|
||||
h="44px"
|
||||
flexShrink={0}
|
||||
cursor="pointer"
|
||||
color="ink"
|
||||
onClick={() => dispatch({ type: 'toggleGroup' })}
|
||||
>
|
||||
<ChevronIcon />
|
||||
</chakra.button>
|
||||
</Flex>
|
||||
{/* Grid rows 0fr to 1fr animate the height without measuring. On
|
||||
close the visibility switches only after the collapse, so the
|
||||
collapse is seen; collapsed links are neither focusable nor
|
||||
read (BR-NAV-36). */}
|
||||
<Box
|
||||
id={id}
|
||||
display="grid"
|
||||
gridTemplateRows={open ? '1fr' : '0fr'}
|
||||
visibility={open ? 'visible' : 'hidden'}
|
||||
transition={`grid-template-rows ${duration} ${easing}, visibility 0s linear ${open ? '0s' : duration}`}
|
||||
_motionReduce={{ transition: 'none' }}
|
||||
>
|
||||
<Box overflow="hidden" minH={0}>
|
||||
<chakra.ul
|
||||
listStyleType="none"
|
||||
pl="1.25rem"
|
||||
pt={2}
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
>
|
||||
{item.children.map((child) => (
|
||||
<li key={child.to}>
|
||||
<RouterLink
|
||||
to={child.to}
|
||||
activeOptions={exactActive}
|
||||
onClick={() =>
|
||||
dispatch({ type: 'linkChosen' })
|
||||
}
|
||||
display="flex"
|
||||
alignItems="center"
|
||||
minH="44px"
|
||||
fontFamily="heading"
|
||||
fontSize="1.4rem"
|
||||
color="ink"
|
||||
// accent.deep: 1.4rem is not large text
|
||||
_currentPage={{ color: 'accent.deep' }}
|
||||
>
|
||||
{child.label}
|
||||
</RouterLink>
|
||||
</li>
|
||||
))}
|
||||
</chakra.ul>
|
||||
</Box>
|
||||
</Box>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user