diff --git a/src/templates/homepage/HeroSection/HeroCenteredLayout.tsx b/src/templates/homepage/HeroSection/HeroCenteredLayout.tsx
index a132340a78..2d16c32598 100644
--- a/src/templates/homepage/HeroSection/HeroCenteredLayout.tsx
+++ b/src/templates/homepage/HeroSection/HeroCenteredLayout.tsx
@@ -1,16 +1,11 @@
-// NOTE: jsx-ally is disabled for this file as the output of this
-// should match jekyll output as closely as possible.
-// As jekyll outputs an tag like so, this behaviour is preserved here.
-/* eslint-disable jsx-a11y/anchor-is-valid */
-
-/* eslint
- react/no-array-index-key: 0
- */
-
import editorStyles from "styles/isomer-cms/pages/Editor.module.scss"
import { getClassNames } from "templates/utils/stylingUtils"
+import { EditorHeroDropdownSection } from "types/homepage"
+
+import { HeroDropdown } from "./HeroDropdown"
+
interface HeroButtonProps {
button?: string
}
@@ -32,105 +27,13 @@ const HeroButton = ({ button }: HeroButtonProps) => (
>
)
-interface HeroDropdownElemProps {
- title: string
-}
-const HeroDropdownElem = ({ title }: HeroDropdownElemProps) => (
-
-
{title}
-
-)
-
-interface HeroDropdownProps {
- title: string
- isActive?: boolean
- options: { title: string }[]
- toggleDropdown: () => void
-}
-const HeroDropdown = ({
- title,
- options,
- isActive,
- toggleDropdown,
-}: HeroDropdownProps) => (
-
-)
-
interface HeroCenteredLayoutProps {
hero: {
background?: string
title?: string
subtitle?: string
button?: string
- dropdown: {
- title: string
- options: { title: string }[]
- }
+ dropdown: EditorHeroDropdownSection["dropdown"]
}
dropdownIsActive: boolean
toggleDropdown: () => void
diff --git a/src/templates/homepage/HeroSection/HeroDropdown.tsx b/src/templates/homepage/HeroSection/HeroDropdown.tsx
new file mode 100644
index 0000000000..3ddb09360b
--- /dev/null
+++ b/src/templates/homepage/HeroSection/HeroDropdown.tsx
@@ -0,0 +1,100 @@
+// NOTE: jsx-ally is disabled for this file as the output of this
+// should match jekyll output as closely as possible.
+// As jekyll outputs an tag like so, this behaviour is preserved here.
+/* eslint-disable jsx-a11y/anchor-is-valid */
+
+/* eslint
+ react/no-array-index-key: 0
+ */
+import editorStyles from "styles/isomer-cms/pages/Editor.module.scss"
+
+import { getClassNames } from "templates/utils/stylingUtils"
+
+interface HeroDropdownElemProps {
+ title: string
+}
+const HeroDropdownElem = ({ title }: HeroDropdownElemProps) => (
+
+
{title}
+
+)
+
+interface HeroDropdownProps {
+ title: string
+ isActive?: boolean
+ options: { title: string }[]
+ toggleDropdown: () => void
+}
+export const HeroDropdown = ({
+ title,
+ options,
+ isActive,
+ toggleDropdown,
+}: HeroDropdownProps) => (
+
+)
diff --git a/src/templates/homepage/HeroSection/HeroSection.tsx b/src/templates/homepage/HeroSection/HeroSection.tsx
index 24e39311e6..f88d086673 100644
--- a/src/templates/homepage/HeroSection/HeroSection.tsx
+++ b/src/templates/homepage/HeroSection/HeroSection.tsx
@@ -16,7 +16,7 @@ import {
SectionBackgroundColor,
SectionSize,
} from "types/hero"
-import { HeroBannerLayouts } from "types/homepage"
+import { EditorHeroDropdownSection, HeroBannerLayouts } from "types/homepage"
import { HeroCenteredLayout } from "./HeroCenteredLayout"
import { HeroImageOnlyLayout } from "./HeroImageOnlyLayout"
@@ -103,10 +103,7 @@ interface TemplateHeroSectionProps {
title?: string
subtitle?: string
button?: string
- dropdown: {
- title: string
- options: { title: string }[]
- }
+ dropdown: EditorHeroDropdownSection["dropdown"]
// eslint-disable-next-line camelcase
key_highlights: {
title?: string
@@ -156,7 +153,12 @@ export const TemplateHeroSection = forwardRef<
)}
{variant === "image" && }
{variant === "side" && (
-
+
)}
{/* Key highlights */}
diff --git a/src/templates/homepage/HeroSection/HeroSideLayout.tsx b/src/templates/homepage/HeroSection/HeroSideLayout.tsx
index 9961d8ea0b..e0cf609113 100644
--- a/src/templates/homepage/HeroSection/HeroSideLayout.tsx
+++ b/src/templates/homepage/HeroSection/HeroSideLayout.tsx
@@ -3,70 +3,35 @@ import editorStyles from "styles/isomer-cms/pages/Editor.module.scss"
import { getClassNames } from "templates/utils/stylingUtils"
import { SectionBackgroundColor, SectionSize } from "types/hero"
+import { EditorHeroDropdownSection } from "types/homepage"
+
+import { HeroDropdown } from "./HeroDropdown"
const TRANSLUCENT_GRAY = "#00000080"
-interface HeroInfoboxProps {
+interface HeroInfoboxDesktopProps {
+ size: SectionSize
+ backgroundColor: SectionBackgroundColor
title: string
subtitle?: string
url?: string
button?: string
-}
-const HeroInfobox = ({ title, subtitle, url, button }: HeroInfoboxProps) => {
- return (
-
-
-
- {title && (
- <>
-
- {title}
-
-
- {title}
-
- >
- )}
-
-
- {subtitle && (
-
- {subtitle}
-
- )}
-
- {url && button && (
-
- {button}
-
- )}
-
-
- )
-}
-
-interface HeroInfoboxDesktopProps extends HeroInfoboxProps {
- size: SectionSize
- backgroundColor: SectionBackgroundColor
+ dropdown?: EditorHeroDropdownSection["dropdown"]
+ dropdownIsActive: boolean
+ toggleDropdown: () => void
}
const HeroInfoboxDesktop = ({
size,
backgroundColor,
- ...rest
+ title,
+ subtitle,
+ dropdown,
+ dropdownIsActive,
+ toggleDropdown,
+ url,
+ button,
}: HeroInfoboxDesktopProps) => {
+ console.log(dropdown)
return (
-
+
+
+
+ {title && (
+ <>
+
+ {title}
+
+
+ {title}
+
+ >
+ )}
+
+
+ {subtitle && (
+
+ {subtitle}
+
+ )}
+
+ {dropdown ? (
+
+ ) : (
+ // NOTE: This is to mirror the template structure
+ // as closely as possible.
+ url &&
+ button && (
+
+ {button}
+
+ )
+ )}
+
+
)
}
@@ -89,6 +108,9 @@ interface HeroSideLayoutProps {
subtitle?: string
title: string
backgroundColor: SectionBackgroundColor
+ dropdownIsActive: boolean
+ toggleDropdown: () => void
+ dropdown?: EditorHeroDropdownSection["dropdown"]
}
export const HeroSideLayout = ({
alignment = "left",
@@ -98,6 +120,9 @@ export const HeroSideLayout = ({
subtitle,
button,
backgroundColor,
+ dropdownIsActive,
+ toggleDropdown,
+ dropdown,
}: HeroSideLayoutProps) => {
return (
@@ -110,6 +135,9 @@ export const HeroSideLayout = ({
title={title}
subtitle={subtitle}
backgroundColor={backgroundColor}
+ dropdownIsActive={dropdownIsActive}
+ toggleDropdown={toggleDropdown}
+ dropdown={dropdown}
/>
) : (
@@ -120,6 +148,9 @@ export const HeroSideLayout = ({
title={title}
subtitle={subtitle}
backgroundColor={backgroundColor}
+ dropdownIsActive={dropdownIsActive}
+ toggleDropdown={toggleDropdown}
+ dropdown={dropdown}
/>
)}
@@ -160,18 +191,30 @@ export const HeroSideLayout = ({
- {url && button && (
-
- {button}
-
+ {dropdown ? (
+
+ ) : (
+ // NOTE: This is to mirror the template structure
+ // as closely as possible.
+ url &&
+ button && (
+
+ {button}
+
+ )
)}