Leaves the theme twigs out of the site and the repo
The two decorative PNGs came from the paid WordPress theme and fall under its licence, not the GPL. They are removed from the Pricing section, the banner under the cards, web/src/assets and the design copy. Own SVG twigs are kept in design/own-assets for later; the assets overview records why. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { Box, Heading, Text, useRecipe } from '@chakra-ui/react';
|
||||
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||
import type { ContentImage, PricingBanner } from '@/content/types';
|
||||
import type { PricingBanner } from '@/content/types';
|
||||
|
||||
// white: the white of the price cards; green: a very light heidegroen tint
|
||||
export type BannerTone = 'white' | 'green';
|
||||
@@ -14,23 +13,19 @@ const TONES: Record<BannerTone, { bg: string }> = {
|
||||
|
||||
type PriceBannerProps = {
|
||||
banner: PricingBanner;
|
||||
// The eucalyptus sprig of the section, as a quiet corner decoration
|
||||
decoration?: ContentImage;
|
||||
tone?: BannerTone;
|
||||
};
|
||||
|
||||
// The optional band under the price cards: an announcement from the CMS (an
|
||||
// offer, a notice), in the ASF look: light, a thin heidegroen rule on top,
|
||||
// the section-heading type (Marcellus in spaced capitals), a small ornament
|
||||
// between title and text, the botanical sprig in a corner and, when there is
|
||||
// a link, the deep-green button of the cards. It is not a bookable package
|
||||
// between title and text and, when there is a link, the deep-green button of the cards. It is not a bookable package
|
||||
// and cannot be dismissed. Only the title is required; the text and the
|
||||
// button are left out when empty. The link is a https address or a path on
|
||||
// this site (the CMS guarantees that, mapBanner checks it again), so a plain
|
||||
// anchor is enough.
|
||||
export default function PriceBanner({
|
||||
banner,
|
||||
decoration,
|
||||
tone = 'white',
|
||||
}: PriceBannerProps) {
|
||||
const linkButton = useRecipe({ key: 'linkButton' });
|
||||
@@ -54,20 +49,6 @@ export default function PriceBanner({
|
||||
borderTopColor="accent"
|
||||
textAlign="center"
|
||||
>
|
||||
{decoration && (
|
||||
<DeferredImage
|
||||
image={decoration}
|
||||
aria-hidden="true"
|
||||
position="absolute"
|
||||
top="0"
|
||||
left="0"
|
||||
zIndex={-1}
|
||||
w="clamp(70px, 9vw, 130px)"
|
||||
h="auto"
|
||||
opacity={0.7}
|
||||
pointerEvents="none"
|
||||
/>
|
||||
)}
|
||||
<Heading
|
||||
as="h3"
|
||||
id="price-banner-title"
|
||||
|
||||
@@ -180,18 +180,11 @@ describe('Pricing', () => {
|
||||
);
|
||||
});
|
||||
|
||||
it('keeps the decorations away from assistive technology', async () => {
|
||||
it('shows no images: the section has no decoration', async () => {
|
||||
const { container } = await renderWithProviders(
|
||||
<Pricing content={content} packages={packages} />,
|
||||
);
|
||||
// The only images here are the decorations: empty alt and aria-hidden
|
||||
expect(screen.queryAllByRole('img')).toHaveLength(0);
|
||||
const images = container.querySelectorAll('img');
|
||||
expect(images).toHaveLength(content.decorations.length);
|
||||
images.forEach((image) => {
|
||||
expect(image).toHaveAttribute('alt', '');
|
||||
expect(image).toHaveAttribute('aria-hidden', 'true');
|
||||
});
|
||||
expect(container.querySelectorAll('img')).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('skips invalid packages', async () => {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Box, Flex } from '@chakra-ui/react';
|
||||
import CmsRegion from '@/components/CmsRegion/CmsRegion';
|
||||
import DeferredImage from '@/components/DeferredImage/DeferredImage';
|
||||
import PageSection from '@/components/PageSection/PageSection';
|
||||
import Reveal from '@/components/Reveal/Reveal';
|
||||
import SectionHeading from '@/components/SectionHeading/SectionHeading';
|
||||
@@ -19,15 +18,6 @@ import PriceTopBar from './PriceTopBar';
|
||||
const TITLE_ID = 'pricing-title';
|
||||
const STAGGER = 0.08;
|
||||
|
||||
// Where the two decorations sit (design .pricing__deco--1 and --2). The
|
||||
// design measures from the whole section; here they sit in the content box,
|
||||
// so the second one moves down into the section's bottom padding, or the
|
||||
// last card would cover it.
|
||||
const decorationPositions = [
|
||||
{ top: '8%', left: '2%' },
|
||||
{ bottom: 'calc(-0.6 * {spacing.sectionY})', right: '2%' },
|
||||
];
|
||||
|
||||
type PricingProps = {
|
||||
content: HomeContent['pricing'];
|
||||
packages: PricingPackage[];
|
||||
@@ -58,20 +48,6 @@ export default function Pricing({
|
||||
data-testid="pricing"
|
||||
>
|
||||
<Box position="relative" isolation="isolate">
|
||||
{content.decorations.map((decoration, index) => (
|
||||
<DeferredImage
|
||||
key={decoration.src}
|
||||
image={decoration}
|
||||
aria-hidden="true"
|
||||
position="absolute"
|
||||
zIndex={-1}
|
||||
w="clamp(90px, 10vw, 160px)"
|
||||
h="auto"
|
||||
opacity={0.55}
|
||||
pointerEvents="none"
|
||||
{...decorationPositions[index % 2]}
|
||||
/>
|
||||
))}
|
||||
<Reveal>
|
||||
<SectionHeading
|
||||
id={TITLE_ID}
|
||||
@@ -125,10 +101,7 @@ export default function Pricing({
|
||||
>
|
||||
{banner && (
|
||||
<Reveal>
|
||||
<PriceBanner
|
||||
banner={banner}
|
||||
decoration={content.decorations[0]}
|
||||
/>
|
||||
<PriceBanner banner={banner} />
|
||||
</Reveal>
|
||||
)}
|
||||
</CmsRegion>
|
||||
|
||||
Reference in New Issue
Block a user