Skip to content

Commit

Permalink
🔍️ Add check for empty title #2358 (#2366)
Browse files Browse the repository at this point in the history
  • Loading branch information
millianapia authored Jun 18, 2024
1 parent a378ca4 commit e0fbc4a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions web/pageComponents/topicPages/Accordion/AccordionBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,14 @@ const AccordionBlock = ({ data, anchor, className }: AccordionBlockProps) => {
<Img image={image} maxWidth={200} aspectRatio={Ratios.ONE_TO_ONE} />
</div>
)}
{Array.isArray(title) ? (
<Heading value={title} as="h2" variant="xl" className="mb-2" />
) : (
<Typography as="h2" variant="xl" className="mb-2">
{title}
</Typography>
)}
{title &&
(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 e0fbc4a

Please sign in to comment.