Hero from the CMS: markers HERO-HTML and HERO-PRELOAD, hero key in the data block, picture per ratio, baked fallback
The prerendered hero is plain HTML between the markers (first photo, h1, buttons), the slider takes over after hydration with the hero of the host block, the API or the build. The head preload is added to the finished HTML. Hero texts move into nl.json. The stand-in host and the e2e tests cover the hero. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { chakra, useRecipe } from '@chakra-ui/react';
|
||||
import LinkButton from '../LinkButton';
|
||||
|
||||
// A button of the hero: a path of the site goes through the router, an anchor
|
||||
// or an https address is a plain link in the same style.
|
||||
export default function HeroButton({
|
||||
label,
|
||||
target,
|
||||
}: {
|
||||
label: string;
|
||||
target: string;
|
||||
}) {
|
||||
const recipe = useRecipe({ key: 'linkButton' });
|
||||
if (target.startsWith('/')) {
|
||||
return (
|
||||
<LinkButton to={target} variant="light">
|
||||
{label}
|
||||
</LinkButton>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<chakra.a href={target} css={recipe({ variant: 'light' })}>
|
||||
{label}
|
||||
</chakra.a>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user