Adds the fallbacks for visitors without JavaScript
The mobile menu works through CSS, and controls that need JavaScript are hidden without it. The contact photo gets its own preload, and the tests cover the new Reveal behaviour, the first row and the noscript markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { useEffect } from 'react';
|
||||
import { Box, Grid, Heading, VisuallyHidden } from '@chakra-ui/react';
|
||||
import { createFileRoute, useNavigate } from '@tanstack/react-router';
|
||||
import ContactAside from '../components/contact/ContactAside/ContactAside';
|
||||
import ContactAside, {
|
||||
ASIDE_MEDIA,
|
||||
} from '../components/contact/ContactAside/ContactAside';
|
||||
import ContactDetails from '../components/ContactDetails/ContactDetails';
|
||||
import ContactPanel from '../components/ContactPanel/ContactPanel';
|
||||
import PageIntro from '../components/PageIntro/PageIntro';
|
||||
@@ -12,7 +14,12 @@ import packages from '../content/packages';
|
||||
import siteContent from '../content/siteContent';
|
||||
import { withReplyTime } from '../lib/withReplyTime';
|
||||
import useHydrated from '../hooks/useHydrated';
|
||||
import { contactPage, pageHead, structuredDataScript } from '../seo';
|
||||
import {
|
||||
contactPage,
|
||||
pageHead,
|
||||
preloadImage,
|
||||
structuredDataScript,
|
||||
} from '../seo';
|
||||
|
||||
// ?pakket= from a link elsewhere on the site. Only text is kept; the panel
|
||||
// checks it against the shown packages (BR-CP-10).
|
||||
@@ -23,10 +30,18 @@ const FORM_TITLE_ID = 'contact-form-title';
|
||||
export const Route = createFileRoute('/contact')({
|
||||
validateSearch: (search: Record<string, unknown>): ContactSearch =>
|
||||
typeof search.pakket === 'string' ? { pakket: search.pakket } : {},
|
||||
head: () => ({
|
||||
...pageHead('/contact'),
|
||||
scripts: [structuredDataScript(contactPage('/contact'))],
|
||||
}),
|
||||
head: () => {
|
||||
const base = pageHead('/contact');
|
||||
return {
|
||||
...base,
|
||||
// The aside photo sits in a <picture>, which React does not hoist
|
||||
links: [
|
||||
...base.links,
|
||||
preloadImage(contactContent.image, { media: ASIDE_MEDIA }),
|
||||
],
|
||||
scripts: [structuredDataScript(contactPage('/contact'))],
|
||||
};
|
||||
},
|
||||
component: Contact,
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user