Skip to content

Commit

Permalink
Merge pull request #1867 from Kajabi/hero-custom-classes
Browse files Browse the repository at this point in the history
[DSS-537] Hero - Missing Classname Prop
  • Loading branch information
anechol authored Mar 5, 2024
2 parents bfab68f + 207ba5e commit ef2f0d6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/sage-react/lib/Hero/Hero.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const Hero = ({
borderless,
children,
ctaAttributes,
className,
customBackgroundColor,
description,
contained,
Expand All @@ -20,8 +21,9 @@ export const Hero = ({
titleTag,
...rest
}) => {
const className = classnames(
const classNames = classnames(
'sage-hero',
className,
{
[`sage-hero--${heroSize}`]: heroSize,
'sage-hero--borderless': borderless,
Expand All @@ -41,7 +43,7 @@ export const Hero = ({

return (
<article
className={className}
className={classNames}
style={{ '--custom-background-color': customBackgroundColor || '' }}
{...rest}
>
Expand Down Expand Up @@ -85,6 +87,7 @@ Hero.defaultProps = {
ctaAttributes: null,
children: null,
contained: false,
className: null,
customBackgroundColor: null,
description: null,
footerActions: null,
Expand Down Expand Up @@ -117,6 +120,10 @@ Hero.propTypes = {
* If true, the image will not fill the space.
*/
contained: PropTypes.bool,
/**
* Allows a custom class name to apply to the component.
*/
className: PropTypes.string,
/**
* The background color to be applied to the Hero.
*/
Expand Down

0 comments on commit ef2f0d6

Please sign in to comment.