Skip to content

Commit

Permalink
feat(heroimageonlylayout): add dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
seaerchin authored and seaerchin committed Sep 20, 2023
1 parent 4ec6618 commit c362658
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 3 deletions.
33 changes: 31 additions & 2 deletions src/templates/homepage/HeroSection/HeroImageOnlyLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ import editorStyles from "styles/isomer-cms/pages/Editor.module.scss"

import { getClassNames } from "templates/utils/stylingUtils"

export const HeroImageOnlyLayout = () => {
import { EditorHeroDropdownSection } from "types/homepage"

import { HeroDropdown } from "./HeroDropdown"

interface HeroImageOnlyLayoutProps {
dropdown?: EditorHeroDropdownSection["dropdown"]
dropdownIsActive: boolean
toggleDropdown: () => void
}
export const HeroImageOnlyLayout = ({
dropdown,
dropdownIsActive,
toggleDropdown,
}: HeroImageOnlyLayoutProps) => {
return (
<div
className={getClassNames(editorStyles, ["bp-hero-body, with-padding"])}
Expand All @@ -21,7 +34,23 @@ export const HeroImageOnlyLayout = () => {
"ma",
])}
>
<div className={getClassNames(editorStyles, ["min-height-mobile"])} />
<div
className={getClassNames(editorStyles, [
"min-height-mobile",
"is-flex",
"row",
"is-vcentered",
])}
>
{dropdown && (
<HeroDropdown
title={dropdown.title}
options={dropdown.options}
isActive={dropdownIsActive}
toggleDropdown={toggleDropdown}
/>
)}
</div>
</div>
</div>
</div>
Expand Down
8 changes: 7 additions & 1 deletion src/templates/homepage/HeroSection/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ export const TemplateHeroSection = forwardRef<
toggleDropdown={toggleDropdown}
/>
)}
{variant === "image" && <HeroImageOnlyLayout />}
{variant === "image" && (
<HeroImageOnlyLayout
dropdown={hero.dropdown}
dropdownIsActive={dropdownIsActive}
toggleDropdown={toggleDropdown}
/>
)}
{variant === "side" && (
<HeroSideLayout
{...hero}
Expand Down

0 comments on commit c362658

Please sign in to comment.