Skip to content

Commit

Permalink
fix: make promo overlays clickable (#854)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBerry authored Aug 31, 2022
1 parent d0f5ba1 commit 0b2924b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-jeans-rule.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sajari/react-search-ui': patch
---

Make promo overlays clickable
35 changes: 21 additions & 14 deletions packages/search-ui/src/Results/components/BannerItem/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,29 @@ const BannerItem = ({ banner, numberOfCols = 1 }: BannerItemProps) => {
<Box data-testid="banner-image-container" css={styles.imageContainer}>
<Link href={targetUrl} css={styles.link} onClick={onClick}>
<img src={imageUrl} css={styles.image} alt="" loading="lazy" />
{(title || description) && (
<Box css={styles.textContainer}>
{title && (
<Heading
as="h2"
className={customClassNames.banners?.heading}
css={[{ color: textColor }, styles.heading]}
>
{title}
</Heading>
)}
{description && (
<Text
className={customClassNames.banners?.description}
css={[{ color: textColor }, styles.description]}
>
{description}
</Text>
)}
</Box>
)}
</Link>
</Box>
{title || description ? (
<Box css={styles.textContainer}>
{title ? (
<Heading as="h2" className={customClassNames.banners?.heading} css={[{ color: textColor }, styles.heading]}>
{title}
</Heading>
) : null}
{description ? (
<Text className={customClassNames.banners?.description} css={[{ color: textColor }, styles.description]}>
{description}
</Text>
) : null}
</Box>
) : null}
</Box>
);
};
Expand Down

0 comments on commit 0b2924b

Please sign in to comment.