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>
27 lines
695 B
TypeScript
27 lines
695 B
TypeScript
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>
|
|
);
|
|
}
|