+
+
+
+
+ {megaMenuSections.orchestration.title}
+
+
+ {megaMenuSections.orchestration.items.map((link) => (
+
+ ))}
+
-
-
Featured
-
-
-
-
+
+
+
+ {megaMenuSections.interoperability.title}
+
+
+ {megaMenuSections.interoperability.items.map((link) => (
+
+ ))}
+
+
+
+
+
+ {megaMenuSections.assetManagement.title}
+
+
+ {megaMenuSections.assetManagement.items.map((link) => (
+
+ ))}
+
+
+
-
Hardhat CLI for Data Streams
-
-
Try out Chainlink Automation
-
+
+
+
+
+ {megaMenuSections.data.title}
+
+
+ {megaMenuSections.data.items.map((link) => (
+
+ ))}
+
+
+
+
+
+ {megaMenuSections.compute.title}
+
+
+ {megaMenuSections.compute.items.map((link) => (
+
+ ))}
+
+
+
+
+
+ {megaMenuSections.other.title}
+
+
+ {megaMenuSections.other.items.map((link) => (
+
+ ))}
+
diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/MegaMenuContainer.tsx b/src/components/Header/Nav/ProductNavigation/Desktop/MegaMenuContainer.tsx
new file mode 100644
index 00000000000..17a6a2a25ce
--- /dev/null
+++ b/src/components/Header/Nav/ProductNavigation/Desktop/MegaMenuContainer.tsx
@@ -0,0 +1,27 @@
+import { useEffect } from "react"
+import styles from "./megaMenu.module.css"
+
+interface MegaMenuProps {
+ cancel: () => void
+ id?: string
+ children?: React.ReactNode
+}
+
+export default function MegaMenuContainer({ cancel, id, children }: MegaMenuProps) {
+ useEffect(() => {
+ const onESC = (ev: KeyboardEvent) => {
+ if (ev.key === "Escape") {
+ cancel()
+ }
+ }
+ window.addEventListener("keyup", onESC, false)
+ return () => {
+ window.removeEventListener("keyup", onESC, false)
+ }
+ }, [])
+ return (
+
+ {children}
+
+ )
+}
diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx b/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx
index c6e0768cb9f..9f9cfe6853c 100644
--- a/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx
+++ b/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx
@@ -6,6 +6,7 @@ import { extendRadixComponent } from "../extendRadixComponent.ts"
import styles from "./productNavigation.module.css"
import { CaretIcon } from "../CaretIcon.tsx"
import MegaMenu from "./MegaMenu.tsx"
+import MegaMenuContainer from "./MegaMenuContainer.tsx"
type Props = {
setNavMenuOpen: (navMenuOpen: boolean) => void
@@ -42,27 +43,20 @@ export const ProductNavigation = ({ setNavMenuOpen, showMegaMenu, isMegamenuOpen
<>
- -
+
-
- Resources
+ Docs
- -
-
- Docs
-
-
-
Demos
@@ -84,7 +78,11 @@ export const ProductNavigation = ({ setNavMenuOpen, showMegaMenu, isMegamenuOpen
- {isMegamenuOpen && }
+ {isMegamenuOpen && (
+
+ )}
>
)
diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/megaMenu.module.css b/src/components/Header/Nav/ProductNavigation/Desktop/megaMenu.module.css
index 83ba42a3509..6b3b9066541 100644
--- a/src/components/Header/Nav/ProductNavigation/Desktop/megaMenu.module.css
+++ b/src/components/Header/Nav/ProductNavigation/Desktop/megaMenu.module.css
@@ -9,15 +9,8 @@
justify-content: center;
}
-.wrapper {
- max-width: 1360px;
- width: 100%;
- background-color: white;
- height: fit-content;
- border-radius: 0.5rem;
- display: grid;
- grid-template-columns: 3fr 1fr;
- overflow: hidden;
+/* applies shadow to dropdown version of mega-menu */
+.megaMenuContainer > .wrapper {
box-shadow:
4.6px 9.3px 54px 1px rgba(152, 160, 185, 0.04),
2.1px 4.3px 32px -0.7px rgba(152, 160, 185, 0.31),
@@ -25,108 +18,128 @@
0.3px 0.5px 0.8px 0px rgba(152, 160, 185, 0.12);
}
-.wrapper h2 {
- padding-bottom: var(--space-4x);
- color: var(--gray-500);
- text-transform: uppercase;
- border-bottom: 1px solid var(--gray-200);
- margin-bottom: var(--space-8x);
-}
+.wrapper {
+ max-width: 1500px;
+ width: 100%;
+ background-color: white;
+ height: fit-content;
+ overflow: hidden;
+ display: flex;
+ flex-direction: column;
-.wrapper h3 {
- font-family: var(--font-family-text);
- color: var(--gray-900);
+ border: 1px solid var(--border);
}
-.wrapper p {
- color: var(--gray-500);
- margin-top: var(--space-2x);
- margin-bottom: var(--space-3x);
- line-height: var(--space-6x);
+.row {
+ display: grid;
+ grid-template-columns: repeat(3, 1fr);
+ border-bottom: 1px solid var(--border);
}
-.resourcesMenuContentMain {
- padding-top: var(--space-16x);
- padding-left: var(--space-16x);
- padding-bottom: var(--space-16x);
- padding-right: var(--space-8x);
- display: grid;
- grid-template-columns: 1fr 1fr 1fr;
- gap: var(--space-16x);
+.row:last-child {
+ border-bottom: none;
}
-.resourcesMenuContentRow {
+.wrapper header {
display: flex;
- flex-direction: column;
+ align-items: center;
+ gap: var(--space-3x);
+ padding: var(--space-4x) var(--space-6x);
}
-.verticalDivider {
- border-left: 1px solid var(--gray-300);
- margin: 0 var(--space-3x);
+.wrapper p {
+ margin-bottom: 0;
}
-.links {
- margin-bottom: var(--space-10x);
+.section {
+ display: flex;
+ flex-direction: column;
+ border-right: 1px solid var(--border);
}
-.links a {
- font-weight: var(--font-weight-medium);
- color: var(--color-text-link);
+.section:last-child {
+ border-right: none;
}
-.resourcesMenuContentFeatured {
- padding-top: var(--space-16x);
- padding-left: var(--space-8x);
- padding-bottom: var(--space-16x);
- padding-right: var(--space-16x);
- background-color: var(--gray-100);
+.section header {
+ border-bottom: 1px solid var(--border);
}
-.megaMenuLink {
+.groupItem {
display: flex;
align-items: center;
- gap: var(--space-2x);
-}
-
-.megaMenuLink h3 {
- margin-bottom: 0;
+ padding: var(--space-6x) var(--space-8x);
+ gap: var(--space-4x);
+ text-decoration: none;
+ transition: background-color 0.2s;
}
-.megaMenuLink img {
- width: var(--space-5x);
- height: var(--space-5x);
+.groupItem:hover {
+ background-color: var(--muted);
}
-.featuredImage {
- width: 100%;
+.groupItemIcon {
+ width: 24px;
+ height: 24px;
+ flex-shrink: 0;
}
-.divider {
- border-bottom: 1px solid var(--gray-200);
- margin: var(--space-8x) auto;
-}
-
-.bottomLinks {
- margin-top: auto;
+.itemList {
display: flex;
flex-direction: column;
- gap: var(--space-3x);
}
-.bottomLinks div {
- display: flex;
- align-items: center;
- gap: var(--space-2x);
- line-height: var(--space-6x);
+.groupItemDescription {
+ display: -webkit-box;
+ -webkit-line-clamp: 1;
+ line-clamp: 1;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
}
-.bottomLinks a {
- color: var(--gray-900);
+.groupItemTitle {
+ display: -webkit-box;
+ -webkit-line-clamp: 1;
+ line-clamp: 1;
+ -webkit-box-orient: vertical;
+ overflow: hidden;
+ font-size: 18px;
+ font-weight: 500;
}
-/* TODO: change with a var when available in the chainlink repo */
-.bottomLink a:hover {
- color: #0847f7;
+.wrapper.mobile {
+ border: none;
+ overflow: unset;
+
+ & .row {
+ grid-template-columns: 1fr;
+ border-bottom: none;
+ }
+
+ & .section header {
+ border-bottom: 1px solid var(--border);
+ border-top: 1px solid var(--border);
+ }
+
+ & .section {
+ border-right: none;
+ }
+
+ & .groupItemTitle {
+ display: block;
+ -webkit-line-clamp: unset;
+ line-clamp: unset;
+ -webkit-box-orient: unset;
+ overflow: visible;
+ }
+
+ & .groupItemDescription {
+ display: block;
+ -webkit-line-clamp: unset;
+ line-clamp: unset;
+ -webkit-box-orient: unset;
+ overflow: visible;
+ }
}
@media screen and (min-width: 768px) {
diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css b/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css
index 4057b7ac853..048809c260c 100644
--- a/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css
+++ b/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css
@@ -57,19 +57,6 @@
opacity: 1;
}
-.megaMenu::after {
- content: "";
- position: absolute;
- bottom: -35px;
- right: 35%;
- transform: translateX(-50%) rotate(45deg);
- width: 20px;
- height: 20px;
- z-index: 100;
- background-color: white;
- padding: var(--space-2x);
-}
-
@media screen and (min-width: 992px) {
.root {
display: flex;
diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/MegaMenu.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/MegaMenu.tsx
deleted file mode 100644
index f3c1d0dfd6b..00000000000
--- a/src/components/Header/Nav/ProductNavigation/Mobile/MegaMenu.tsx
+++ /dev/null
@@ -1,94 +0,0 @@
-import styles from "./megaMenu.module.css"
-import { Fragment } from "react/jsx-runtime"
-import { megaMenuSections } from "../Desktop/MegaMenu.tsx"
-import { useState } from "react"
-
-function MegaMenu() {
- return (
-
-
- {megaMenuSections.map((section) => (
-
-
{section.title}
- {section.items.map((item, index) => (
-
- ))}
-
- ))}
-
-
-
-
-
Featured
-

-
-
-
Blockchain 101
-
-
-
- )
-}
-
-function MegaMenuItem({
- image,
- title,
- description,
- links,
-}: {
- image?: string
- title?: string
- description?: string
- links: { label: string; href: string | undefined }[]
-}) {
- const [open, setOpen] = useState(false)
- return (
- <>
-
- {open && (
-
-
{description}
- {links.map((link, index) => (
-
-
- {link.label}
-
- {index < links.length - 1 && }
-
- ))}
-
- )}
- >
- )
-}
-
-export default MegaMenu
diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx
index dc0f0371d88..b00ccb80fb2 100644
--- a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx
+++ b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx
@@ -6,7 +6,7 @@ import styles from "./productNavigation.module.css"
import { MenuIcon } from "./MenuIcon.tsx"
import { BackArrowIcon } from "./BackArrowIcon.tsx"
import { CaretRightIcon } from "./CaretRightIcon.tsx"
-import MegaMenu from "./MegaMenu.tsx"
+import MegaMenu from "../Desktop/MegaMenu.tsx"
const Trigger = extendRadixComponent(Dialog.Trigger)
const Close = extendRadixComponent(Dialog.Close)
@@ -71,14 +71,12 @@ export function ProductNavigation() {
className={styles.productContentLink}
onClick={() => setProductsSlidePosition("submenu")}
data-testid="sub-product-navigation-trigger-mobile"
- aria-label="Open Resources submenu"
+ aria-label="Open Docs submenu"
>
- Resources
+ Docs
-
- Docs
-
+
Demos
@@ -103,11 +101,11 @@ export function ProductNavigation() {
>
-
Resources
+
Docs
{/* Spacer */}