Skip to content

Commit

Permalink
Merge pull request #220 from oaknational/feat-cms-image-for-hero
Browse files Browse the repository at this point in the history
feat: prop for passing cms image
  • Loading branch information
JBR90 authored Jul 4, 2024
2 parents 20201b5 + 5fcf1b0 commit e912e43
Showing 1 changed file with 23 additions and 13 deletions.
36 changes: 23 additions & 13 deletions src/components/organisms/OakHeaderHero/OakHeaderHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type OakHeaderHeroProps = {
heroImageAlt: string;
authorImageAlt: string;
breadcrumbs: ReactElement;
cmsImage?: ReactElement;
children?: ReactNode;
};

Expand All @@ -46,6 +47,7 @@ const UnstyledComponent = (props: OakHeaderHeroProps) => {
authorImageSrc,
heroImageAlt,
authorImageAlt,
cmsImage,
} = props;
return (
<OakBox
Expand Down Expand Up @@ -129,19 +131,27 @@ const UnstyledComponent = (props: OakHeaderHeroProps) => {
"space-between-none",
]}
>
<OakImage
$transform={"rotate(-2.025deg)"}
src={heroImageSrc}
width={100}
$minHeight={[
"all-spacing-19",
"all-spacing-20",
"all-spacing-20",
]}
$minWidth={["all-spacing-19", "all-spacing-22", "all-spacing-21"]}
alt={heroImageAlt}
$zIndex={"in-front"}
/>
{cmsImage ? (
cmsImage
) : (
<OakImage
$transform={"rotate(-2.025deg)"}
src={heroImageSrc}
width={100}
$minHeight={[
"all-spacing-19",
"all-spacing-20",
"all-spacing-20",
]}
$minWidth={[
"all-spacing-19",
"all-spacing-22",
"all-spacing-21",
]}
alt={heroImageAlt}
$zIndex={"in-front"}
/>
)}
<OakFlex
$position={"absolute"}
$top={"all-spacing-0"}
Expand Down

0 comments on commit e912e43

Please sign in to comment.