\r\n \r\n {preHeader}\r\n
{header}
\r\n \r\n \r\n \r\n );\r\n }\r\n}\r\n\r\nconst bigHeader: CSS = {\r\n margin: '0px',\r\n pr: 8,\r\n pl: 8,\r\n fontSize: '24px',\r\n '@mediaMaxLarge': {\r\n pl: 4,\r\n pr: 4,\r\n },\r\n};\r\n\r\nconst smallHeader: CSS = {\r\n margin: '0px',\r\n pr: 8,\r\n pl: 8,\r\n fontSize: '24px',\r\n pb: 8,\r\n '@mediaMaxLarge': {\r\n pl: 4,\r\n pr: 4,\r\n pb: 4,\r\n },\r\n};\r\n\r\nconst container = {\r\n background: '$primary4',\r\n placeSelf: 'stretch stretch',\r\n display: 'grid',\r\n gridTemplateRows: 'min-content auto',\r\n gridAutoFlow: 'column',\r\n color: '$secondary1',\r\n};\r\n\r\nconst SmallContainer = styled('a', {\r\n ...container,\r\n transition: 'all 0.2s ease-in-out',\r\n '&:hover': {\r\n cursor: 'pointer',\r\n backgroundColor: '$primary3',\r\n '& img': {\r\n opacity: '0.9',\r\n },\r\n },\r\n '&:focus': {\r\n outlineOffset: 8,\r\n },\r\n});\r\n\r\nconst BigContainer = styled('div', {\r\n ...container,\r\n gridRow: '1 / 3',\r\n display: 'grid',\r\n gridTemplateRows: 'min-content min-content 1fr min-content',\r\n gridAutoFlow: 'column',\r\n '@mediaMaxLarge': {\r\n gridTemplateColumns: '100%',\r\n gridAutoFlow: 'row',\r\n gridTemplateRows: '140px min-content 1fr min-content',\r\n },\r\n});\r\n\r\nconst StyledImage = styled('img', {\r\n flexGrow: 0,\r\n placeSelf: 'stretch stretch',\r\n gridRow: '1 / 5',\r\n objectFit: 'cover',\r\n '@mediaMaxLarge': {\r\n gridRow: '1',\r\n placeSelf: 'stretch',\r\n },\r\n});\r\n\r\nconst StyledImageSmall = styled('img', {\r\n transition: 'all 0.2s ease-in-out',\r\n flexGrow: 0,\r\n placeSelf: 'stretch end',\r\n gridRow: '1 / 3',\r\n objectFit: 'cover',\r\n});\r\n\r\nconst StyledParagraph = styled('p', {\r\n textOverflow: 'ellipsis',\r\n pt: 2,\r\n lh: '$lh155',\r\n pr: 8,\r\n pl: 8,\r\n '@mediaMaxLarge': {\r\n pt: 2,\r\n px: 4,\r\n },\r\n});\r\n\r\nconst ButtonContainer = styled('div', {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n justifySelf: 'end',\r\n justifyContent: 'flex-start',\r\n width: '100%',\r\n py: 8,\r\n px: 4,\r\n '@mediaMinLarge': {\r\n flexDirection: 'row',\r\n px: 8,\r\n },\r\n});\r\n\r\nconst SmallTag = styled('p', {\r\n fs: 6,\r\n color: '$primaryLight3',\r\n pb: 2,\r\n pt: 8,\r\n pr: 8,\r\n pl: 8,\r\n textTransform: 'uppercase',\r\n '@mediaMaxLarge': {\r\n pt: 4,\r\n px: 4,\r\n },\r\n});\r\n\r\nconst BigTag = styled('p', {\r\n fs: 6,\r\n color: '$primaryLight3',\r\n pb: 2,\r\n pt: 8,\r\n px: 8,\r\n textTransform: 'uppercase',\r\n '@mediaMaxLarge': {\r\n px: 4,\r\n pt: 4,\r\n },\r\n});\r\n","import GridItem from 'Atoms/Grids/GridItem';\r\nimport FeatureBlockModel from '../../Models/Blocks/FeatureBlock/FeatureBlockModel.interface';\r\nimport { styled } from '../../stitches.config';\r\nimport { FeatureBlockComponent } from './FeatureBlock';\r\n\r\ntype FeatureBlock = {\r\n blockType: 'FeatureBlock';\r\n content: FeatureBlockModel;\r\n};\r\n\r\ntype LayoutKey = '2+1' | '1+2';\r\n\r\ntype Model = {\r\n inEditMode: boolean;\r\n layout: string;\r\n blocks: FeatureBlock[];\r\n};\r\n\r\ntype PropType = {\r\n content: Model;\r\n};\r\n\r\nconst checkNever = (_: never) => {};\r\n\r\nconst toLayoutKey = (key: string): LayoutKey => {\r\n const typedKey = key as LayoutKey;\r\n\r\n if (typedKey === '2+1') return '2+1';\r\n if (typedKey === '1+2') return '1+2';\r\n\r\n // if we add an option to LayoutKey, this line will complain\r\n checkNever(typedKey);\r\n\r\n console.error(`Unknown layout key ${typedKey}, defaulting to 1+2`);\r\n return '1+2';\r\n};\r\n\r\nfunction FeatureArrangementBlock({ content: { layout, blocks } }: PropType) {\r\n if (blocks.length !== 3) {\r\n throw Error('Feature arrangement currently supports only 3 block');\r\n }\r\n\r\n const layoutKey = toLayoutKey(layout);\r\n\r\n const [first, second, third] = blocks;\r\n\r\n return (\r\n