Skip to content

Commit

Permalink
Merge branch 'bose/2254' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
BorghildSelle committed May 15, 2024
2 parents 58f6801 + d2d3e31 commit fd054f2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 0 additions & 1 deletion web/core/Typography/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export const Heading = ({
...props
}: HeadingProps) => {
let div: PortableTextBlock[] = []

return (
<>
{value?.length > 1 ? (
Expand Down
1 change: 1 addition & 0 deletions web/pageComponents/shared/Teaser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ const Teaser = ({ data, anchor }: TeaserProps) => {
}

const isSvg = image?.extension === 'svg'

return (
<BackgroundContainer {...restOptions} id={anchor} renderFragmentWhenPossible>
<StyledEnvisTeaser imagePosition={imagePosition}>
Expand Down
11 changes: 9 additions & 2 deletions web/pageComponents/topicPages/Accordion/AccordionBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FAQPageJsonLd } from 'next-seo'

import type { AccordionData, AccordionListData } from '../../../types/types'
import { toPlainText } from '@portabletext/react'
import { Heading } from '../../../core/Typography'
import { Heading, Typography } from '../../../core/Typography'
import { twMerge } from 'tailwind-merge'

export const StyledTextBlockWrapper = styled(BackgroundContainer)<{ id: string | undefined }>`
Expand Down Expand Up @@ -38,6 +38,7 @@ const buildJsonLdElements = (data: AccordionListData[]) => {

const AccordionBlock = ({ data, anchor, className }: AccordionBlockProps) => {
const { title, ingress, designOptions, accordion, id, image, enableStructuredMarkup } = data

return (
<>
<StyledTextBlockWrapper {...designOptions} id={anchor || data.anchor} renderFragmentWhenPossible>
Expand All @@ -52,7 +53,13 @@ const AccordionBlock = ({ data, anchor, className }: AccordionBlockProps) => {
<Img image={image} maxWidth={200} aspectRatio={Ratios.ONE_TO_ONE} />
</div>
)}
{title && <Heading value={title} as="h2" variant="xl" className="mb-2" />}
{Array.isArray(title) ? (
<Heading value={title} as="h2" variant="xl" className="mb-2" />
) : (
<Typography as="h2" variant="xl" className="mb-2">
{title}
</Typography>
)}
{ingress && <IngressText value={ingress} />}
{accordion && accordion.length > 0 && (
<Accordion data={accordion} id={id} hasTitle={!!title} queryParamName={id} />
Expand Down

0 comments on commit fd054f2

Please sign in to comment.