Skip to content

Commit

Permalink
fix: [Hero] Allow React elements to be passed to the heading and `s…
Browse files Browse the repository at this point in the history
…ubheading` props (#310)

Closes #309 

As we use Hero in more scenarios we find the need for expanded support
of what types of content can be passed to these props.
  • Loading branch information
meissadia authored Feb 15, 2024
1 parent ceae693 commit f91be24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/Hero/Hero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import { useBackgroundImage } from './useBackgroundImage';

interface HeroProperties extends React.HTMLAttributes<HTMLDivElement> {
backgroundColor?: string;
heading?: string;
heading?: React.ReactNode;
headingLevel?: HeadingLevel;
image?: string;
imageAltText?: string;
imageIsPhoto?: boolean;
is5050?: boolean;
isJumbo?: boolean;
isKnockout?: boolean;
subheading?: string;
subheading?: React.ReactNode;
subheadingLevel?: HeadingLevel;
textColor?: string;
}
Expand All @@ -38,7 +38,7 @@ export default function Hero({
className,
...properties
}: HeroProperties): JSX.Element {
const addWrapperImage = imageIsPhoto || isJumbo || is5050;
const addWrapperImage = imageIsPhoto ?? isJumbo ?? is5050;
const wrapperReference = useBackgroundImage(image, addWrapperImage);

const heroStyles = { backgroundColor };
Expand Down

0 comments on commit f91be24

Please sign in to comment.