From f2e77d7254e95fcc6fd65d7d6e59fa4bb0eb6440 Mon Sep 17 00:00:00 2001 From: Dwight Lyle Date: Fri, 29 Mar 2024 23:29:20 -0600 Subject: [PATCH 01/14] Docs navigation redesign --- .../assets/icons/automation-navbar-icon.svg | 10 - public/assets/icons/ccip-navbar-icon.svg | 16 -- public/assets/icons/data-navbar-icon.svg | 21 -- .../icons/documentation-navbar-icon.svg | 11 - public/assets/icons/feeds-navbar-icon.svg | 15 -- public/assets/icons/functions-navbar-icon.svg | 10 - public/assets/icons/general-navbar-icon.svg | 16 -- public/assets/icons/home-navbar-icon.svg | 3 - public/assets/icons/resources-navbar-icon.svg | 20 -- public/assets/icons/staking-navbar-icon.svg | 15 -- public/assets/icons/streams-navbar-icon.svg | 11 - public/assets/icons/vrf-navbar-icon.svg | 14 - public/chainlink-docs.svg | 108 ++++++-- src/assets/icons/external-arrow.svg | 16 ++ .../product-logos}/automation-logo.svg | 0 .../product-logos}/automation-shape.svg | 0 .../product-logos}/ccip-logo.svg | 0 .../product-logos}/ccip-shape.svg | 0 .../product-logos}/data-feeds-logo.svg | 0 .../product-logos}/data-feeds-shape.svg | 0 .../product-logos}/data-streams-logo.svg | 0 .../product-logos}/data-streams-shape.svg | 0 .../product-logos}/external-api-logo.svg | 0 .../product-logos}/external-api-shape.svg | 0 .../product-logos}/functions-logo.svg | 0 .../product-logos}/functions-shape.svg | 0 .../product-logos}/general-logo.svg | 0 .../product-logos}/general-shape.svg | 0 .../product-logos}/node-logo.svg | 0 .../product-logos}/node-shape.svg | 0 .../product-logos}/vrf-logo.svg | 0 .../product-logos}/vrf-shape.svg | 0 src/components/Header/Nav/NavBar.tsx | 11 + .../Desktop/ProductNavigation.tsx | 54 +--- .../Desktop/SubProductContent.tsx | 1 + .../Nav/ProductNavigation/Desktop/Trigger.tsx | 2 +- .../Desktop/productNavigation.module.css | 22 +- .../Desktop/subProductContent.module.css | 5 + .../Nav/ProductNavigation/Mobile/Category.tsx | 2 +- .../Mobile/ProductNavigation.tsx | 26 +- .../Mobile/SubProductContent.tsx | 30 ++- .../Mobile/subProductContent.module.css | 10 +- src/components/Header/Nav/config.tsx | 69 +---- src/components/Header/Nav/index.ts | 1 - src/components/Header/getNavigationProps.ts | 250 +++++++++++------- .../Quickstart/QuickstartOverview.astro | 2 +- src/config/sidebar.ts | 28 -- .../getting-started/other-tutorials.mdx | 138 ---------- src/features/landing/data/index.ts | 24 +- src/features/redirects/redirects.json | 10 + 50 files changed, 359 insertions(+), 612 deletions(-) delete mode 100644 public/assets/icons/automation-navbar-icon.svg delete mode 100644 public/assets/icons/ccip-navbar-icon.svg delete mode 100644 public/assets/icons/data-navbar-icon.svg delete mode 100644 public/assets/icons/documentation-navbar-icon.svg delete mode 100644 public/assets/icons/feeds-navbar-icon.svg delete mode 100644 public/assets/icons/functions-navbar-icon.svg delete mode 100644 public/assets/icons/general-navbar-icon.svg delete mode 100644 public/assets/icons/home-navbar-icon.svg delete mode 100644 public/assets/icons/resources-navbar-icon.svg delete mode 100644 public/assets/icons/staking-navbar-icon.svg delete mode 100644 public/assets/icons/streams-navbar-icon.svg delete mode 100644 public/assets/icons/vrf-navbar-icon.svg create mode 100644 src/assets/icons/external-arrow.svg rename src/{features/landing/assets => assets/product-logos}/automation-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/automation-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/ccip-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/ccip-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/data-feeds-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/data-feeds-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/data-streams-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/data-streams-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/external-api-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/external-api-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/functions-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/functions-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/general-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/general-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/node-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/node-shape.svg (100%) rename src/{features/landing/assets => assets/product-logos}/vrf-logo.svg (100%) rename src/{features/landing/assets => assets/product-logos}/vrf-shape.svg (100%) delete mode 100644 src/content/getting-started/other-tutorials.mdx diff --git a/public/assets/icons/automation-navbar-icon.svg b/public/assets/icons/automation-navbar-icon.svg deleted file mode 100644 index f697091749e..00000000000 --- a/public/assets/icons/automation-navbar-icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/public/assets/icons/ccip-navbar-icon.svg b/public/assets/icons/ccip-navbar-icon.svg deleted file mode 100644 index e909482f364..00000000000 --- a/public/assets/icons/ccip-navbar-icon.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/public/assets/icons/data-navbar-icon.svg b/public/assets/icons/data-navbar-icon.svg deleted file mode 100644 index 504dd88e64d..00000000000 --- a/public/assets/icons/data-navbar-icon.svg +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/icons/documentation-navbar-icon.svg b/public/assets/icons/documentation-navbar-icon.svg deleted file mode 100644 index 4a84ac45e4e..00000000000 --- a/public/assets/icons/documentation-navbar-icon.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/public/assets/icons/feeds-navbar-icon.svg b/public/assets/icons/feeds-navbar-icon.svg deleted file mode 100644 index a612100cdd0..00000000000 --- a/public/assets/icons/feeds-navbar-icon.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/public/assets/icons/functions-navbar-icon.svg b/public/assets/icons/functions-navbar-icon.svg deleted file mode 100644 index 0d9d8597bfe..00000000000 --- a/public/assets/icons/functions-navbar-icon.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/public/assets/icons/general-navbar-icon.svg b/public/assets/icons/general-navbar-icon.svg deleted file mode 100644 index 01dd88103cb..00000000000 --- a/public/assets/icons/general-navbar-icon.svg +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/public/assets/icons/home-navbar-icon.svg b/public/assets/icons/home-navbar-icon.svg deleted file mode 100644 index 8e220c70048..00000000000 --- a/public/assets/icons/home-navbar-icon.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/assets/icons/resources-navbar-icon.svg b/public/assets/icons/resources-navbar-icon.svg deleted file mode 100644 index 5d49590c597..00000000000 --- a/public/assets/icons/resources-navbar-icon.svg +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - - - - - - - - - diff --git a/public/assets/icons/staking-navbar-icon.svg b/public/assets/icons/staking-navbar-icon.svg deleted file mode 100644 index 2d2d19f933f..00000000000 --- a/public/assets/icons/staking-navbar-icon.svg +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/public/assets/icons/streams-navbar-icon.svg b/public/assets/icons/streams-navbar-icon.svg deleted file mode 100644 index a7b7122f4c1..00000000000 --- a/public/assets/icons/streams-navbar-icon.svg +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/public/assets/icons/vrf-navbar-icon.svg b/public/assets/icons/vrf-navbar-icon.svg deleted file mode 100644 index 7339bb9ef52..00000000000 --- a/public/assets/icons/vrf-navbar-icon.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/public/chainlink-docs.svg b/public/chainlink-docs.svg index 3449eea4a4e..95745e05904 100644 --- a/public/chainlink-docs.svg +++ b/public/chainlink-docs.svg @@ -1,17 +1,91 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + + + + + + + + + diff --git a/src/assets/icons/external-arrow.svg b/src/assets/icons/external-arrow.svg new file mode 100644 index 00000000000..bec70c2a8fb --- /dev/null +++ b/src/assets/icons/external-arrow.svg @@ -0,0 +1,16 @@ + + + + \ No newline at end of file diff --git a/src/features/landing/assets/automation-logo.svg b/src/assets/product-logos/automation-logo.svg similarity index 100% rename from src/features/landing/assets/automation-logo.svg rename to src/assets/product-logos/automation-logo.svg diff --git a/src/features/landing/assets/automation-shape.svg b/src/assets/product-logos/automation-shape.svg similarity index 100% rename from src/features/landing/assets/automation-shape.svg rename to src/assets/product-logos/automation-shape.svg diff --git a/src/features/landing/assets/ccip-logo.svg b/src/assets/product-logos/ccip-logo.svg similarity index 100% rename from src/features/landing/assets/ccip-logo.svg rename to src/assets/product-logos/ccip-logo.svg diff --git a/src/features/landing/assets/ccip-shape.svg b/src/assets/product-logos/ccip-shape.svg similarity index 100% rename from src/features/landing/assets/ccip-shape.svg rename to src/assets/product-logos/ccip-shape.svg diff --git a/src/features/landing/assets/data-feeds-logo.svg b/src/assets/product-logos/data-feeds-logo.svg similarity index 100% rename from src/features/landing/assets/data-feeds-logo.svg rename to src/assets/product-logos/data-feeds-logo.svg diff --git a/src/features/landing/assets/data-feeds-shape.svg b/src/assets/product-logos/data-feeds-shape.svg similarity index 100% rename from src/features/landing/assets/data-feeds-shape.svg rename to src/assets/product-logos/data-feeds-shape.svg diff --git a/src/features/landing/assets/data-streams-logo.svg b/src/assets/product-logos/data-streams-logo.svg similarity index 100% rename from src/features/landing/assets/data-streams-logo.svg rename to src/assets/product-logos/data-streams-logo.svg diff --git a/src/features/landing/assets/data-streams-shape.svg b/src/assets/product-logos/data-streams-shape.svg similarity index 100% rename from src/features/landing/assets/data-streams-shape.svg rename to src/assets/product-logos/data-streams-shape.svg diff --git a/src/features/landing/assets/external-api-logo.svg b/src/assets/product-logos/external-api-logo.svg similarity index 100% rename from src/features/landing/assets/external-api-logo.svg rename to src/assets/product-logos/external-api-logo.svg diff --git a/src/features/landing/assets/external-api-shape.svg b/src/assets/product-logos/external-api-shape.svg similarity index 100% rename from src/features/landing/assets/external-api-shape.svg rename to src/assets/product-logos/external-api-shape.svg diff --git a/src/features/landing/assets/functions-logo.svg b/src/assets/product-logos/functions-logo.svg similarity index 100% rename from src/features/landing/assets/functions-logo.svg rename to src/assets/product-logos/functions-logo.svg diff --git a/src/features/landing/assets/functions-shape.svg b/src/assets/product-logos/functions-shape.svg similarity index 100% rename from src/features/landing/assets/functions-shape.svg rename to src/assets/product-logos/functions-shape.svg diff --git a/src/features/landing/assets/general-logo.svg b/src/assets/product-logos/general-logo.svg similarity index 100% rename from src/features/landing/assets/general-logo.svg rename to src/assets/product-logos/general-logo.svg diff --git a/src/features/landing/assets/general-shape.svg b/src/assets/product-logos/general-shape.svg similarity index 100% rename from src/features/landing/assets/general-shape.svg rename to src/assets/product-logos/general-shape.svg diff --git a/src/features/landing/assets/node-logo.svg b/src/assets/product-logos/node-logo.svg similarity index 100% rename from src/features/landing/assets/node-logo.svg rename to src/assets/product-logos/node-logo.svg diff --git a/src/features/landing/assets/node-shape.svg b/src/assets/product-logos/node-shape.svg similarity index 100% rename from src/features/landing/assets/node-shape.svg rename to src/assets/product-logos/node-shape.svg diff --git a/src/features/landing/assets/vrf-logo.svg b/src/assets/product-logos/vrf-logo.svg similarity index 100% rename from src/features/landing/assets/vrf-logo.svg rename to src/assets/product-logos/vrf-logo.svg diff --git a/src/features/landing/assets/vrf-shape.svg b/src/assets/product-logos/vrf-shape.svg similarity index 100% rename from src/features/landing/assets/vrf-shape.svg rename to src/assets/product-logos/vrf-shape.svg diff --git a/src/components/Header/Nav/NavBar.tsx b/src/components/Header/Nav/NavBar.tsx index cf709758762..0266cae25ec 100644 --- a/src/components/Header/Nav/NavBar.tsx +++ b/src/components/Header/Nav/NavBar.tsx @@ -38,6 +38,17 @@ export const NavBar = ({ path, searchTrigger, onHideChange, productsNav, subProd
+ + Documentation Home + +
+
- - Chainlink Home - - - - - - - - - - - - - - -
- - - -
- -
- - - - - - Docs - - {subProductTrigger && subProductsNav && ( <> - - + @@ -105,6 +62,13 @@ export const ProductNavigation = ({ path, setNavMenuOpen, productsNav, subProduc
+ + + Developer Hub +
+ +
+
) diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/SubProductContent.tsx b/src/components/Header/Nav/ProductNavigation/Desktop/SubProductContent.tsx index 604f143a939..32f0ad99c89 100644 --- a/src/components/Header/Nav/ProductNavigation/Desktop/SubProductContent.tsx +++ b/src/components/Header/Nav/ProductNavigation/Desktop/SubProductContent.tsx @@ -20,6 +20,7 @@ export const SubProductContent = ({ subProductsNav }: { subProductsNav: SubProdu .map((item) => ( + {item.label} diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/Trigger.tsx b/src/components/Header/Nav/ProductNavigation/Desktop/Trigger.tsx index 2a01e7a1798..f73f512b2e4 100644 --- a/src/components/Header/Nav/ProductNavigation/Desktop/Trigger.tsx +++ b/src/components/Header/Nav/ProductNavigation/Desktop/Trigger.tsx @@ -9,7 +9,7 @@ type Props = { export const Trigger = ({ icon, label, className }: Props) => (
- {icon && } + {icon && } {label}
diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css b/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css index 57ebee4d21b..b1bc93d81ce 100644 --- a/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css +++ b/src/components/Header/Nav/ProductNavigation/Desktop/productNavigation.module.css @@ -34,13 +34,12 @@ } .button { - composes: text-300 from global; + composes: text-100 from global; line-height: 1.5rem; - padding-block: var(--space-2x); user-select: none; display: flex; align-items: center; - gap: var(--space-2x); + gap: var(--space-1x); width: fit-content; color: var(--blue-800); } @@ -49,6 +48,23 @@ color: var(--blue-600); } +.button > div > img { + display: flex; + width: 1.2rem; + transform: translate3d(0rem, 0rem, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) skew(0deg, 0deg); + transition-duration: 200ms; + opacity: 0.6; + transform-style: prserve-3d; +} + +.button:hover > div > img { + transform: translate3d(0.15rem, -0.15rem, 0px) scale3d(1, 1, 1) rotateX(0deg) rotateY(0deg) rotateZ(0deg) + skew(0deg, 0deg); + transition-duration: 200ms; + opacity: 1; + transform-style: preserve-3d; +} + .content { position: absolute; top: 0; diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/subProductContent.module.css b/src/components/Header/Nav/ProductNavigation/Desktop/subProductContent.module.css index afa3d13a55e..c97580320ef 100644 --- a/src/components/Header/Nav/ProductNavigation/Desktop/subProductContent.module.css +++ b/src/components/Header/Nav/ProductNavigation/Desktop/subProductContent.module.css @@ -13,3 +13,8 @@ color: var(--blue-600); background: var(--blue-100); } + +.icon { + width: 1.2rem; + height: 1.2rem; +} diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx index 03493199a49..86eaaa68b3a 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx @@ -14,7 +14,7 @@ const Item = React.forwardRef( ({ item: { label, icon, href, subProducts }, onProductClick }, forwardedRef) => { const itemComponent = ( <> - {icon && } + {icon && } {label} diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx index 12107d9f82a..7eb953b44f9 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx @@ -9,10 +9,16 @@ import { BottomBar } from "./BottomBar" import { ProductContent } from "./ProductContent" import styles from "./productNavigation.module.css" import { SubProductContent } from "./SubProductContent" +import externalArrow from "../../../../../assets/icons/external-arrow.svg" + +type Page = { + label: string; + href: string; +} export type SubProducts = { label: string - items: { label: string; href: string }[] + items: { label: string; href: string; pages?: Page[] }[] } type Props = { @@ -50,27 +56,12 @@ export function ProductNavigation({ productsNav }: Props) { return ( - - Chainlink Home - - Developer Hub + Documentation - diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx index e47dd78755d..b5e598bd463 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx @@ -2,12 +2,17 @@ import { clsx } from "../../utils" import { BackArrowIcon } from "./BackArrowIcon" import styles from "./subProductContent.module.css" +type Page = { + label: string; + href: string; +} + type Props = { onSubproductClick: () => void subProducts?: | { label: string - items: { label: string; icon?: string; href: string }[] + items: { label: string; icon?: string; href: string; pages?: Page[] }[] } | undefined } @@ -16,22 +21,19 @@ export const SubProductContent = ({ subProducts, onSubproductClick }: Props) => if (!subProducts) return null return ( <> - - - {subProducts.label} - - {subProducts.items.map(({ label, href }) => ( - - {label} - + {subProducts.items.map(({ label, pages }) => ( +
+

{label}

+ {pages?.map(({ label, href }) => ( + + {label} + + ))} +
))} ) diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css b/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css index f3c57ece2d7..d3c322a51fb 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css +++ b/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css @@ -11,7 +11,13 @@ fill: var(--color-text-link); } +.section { + padding-top: var(--space-4x); + composes: text-400 from global; +} + .link { - padding-block: var(--space-5x); - composes: text-300 from global; + display: block; + padding-bottom: var(--space-5x); + padding-left: var(--space-5x); } diff --git a/src/components/Header/Nav/config.tsx b/src/components/Header/Nav/config.tsx index e08da0663e7..abf8dbaab52 100644 --- a/src/components/Header/Nav/config.tsx +++ b/src/components/Header/Nav/config.tsx @@ -4,7 +4,7 @@ type LinksConfig = { actionButton?: { label: string; href: string } } -export type Item = { label: string; icon?: string; href: string } +export type Item = { label: string; icon?: string; href: string; } export type ProductItem = Item & { subProducts?: { @@ -39,70 +39,3 @@ export type AppConfig = { productsNav: ProductsNav subProductsNav?: SubProductsNav } & LinksConfig - -export const devHubCategories = [ - { - items: [ - { - label: "Home", - icon: "home", - href: "https://dev.chain.link/", - subMenu: { - label: "Home's subproducts", - items: [ - { label: "Subproduct 1", href: "https://..." }, - { - label: "Subproduct 2", - href: "https://", - }, - ], - }, - }, - { - label: "Docs", - icon: "docs", - href: "https://docs.chain.link", - }, - { - label: "All Resources", - icon: "resources", - href: "https://dev.chain.link/resources", - }, - ], - }, - { - label: "Product Resources", - items: [ - { - label: "CCIP", - icon: "ccip", - href: "https://dev.chain.link/products/ccip", - }, - { - label: "Data", - icon: "data", - href: "https://dev.chain.link/products/data", - }, - { - label: "Functions", - icon: "functions", - href: "https://dev.chain.link/products/functions", - }, - { - label: "Automation", - icon: "automation", - href: "https://dev.chain.link/products/automation", - }, - { - label: "VRF", - icon: "vrf", - href: "https://dev.chain.link/products/vrf", - }, - { - label: "General", - icon: "general", - href: "https://dev.chain.link/products/general", - }, - ], - }, -] diff --git a/src/components/Header/Nav/index.ts b/src/components/Header/Nav/index.ts index 17a83186e70..b7303c11d22 100644 --- a/src/components/Header/Nav/index.ts +++ b/src/components/Header/Nav/index.ts @@ -1,2 +1 @@ export { NavBar } from "./NavBar" -export type { devHubCategories } from "./config" diff --git a/src/components/Header/getNavigationProps.ts b/src/components/Header/getNavigationProps.ts index 67c73ffe9d2..f988f30a1f8 100644 --- a/src/components/Header/getNavigationProps.ts +++ b/src/components/Header/getNavigationProps.ts @@ -1,168 +1,216 @@ -const devHubProductsUrl = "https://dev.chain.link/products/" +import ccipLogo from "../../assets/product-logos/ccip-logo.svg" +import vrfLogo from "../../assets/product-logos/vrf-logo.svg" +import functionsLogo from "../../assets/product-logos/functions-logo.svg" +import automationLogo from "../../assets/product-logos/automation-logo.svg" +import dataFeedsLogo from "../../assets/product-logos/data-feeds-logo.svg" +import dataStreamsLogo from "../../assets/product-logos/data-streams-logo.svg" +import nodesLogo from "../../assets/product-logos/general-logo.svg" +import { SIDEBAR as sidebar } from "../../config/sidebar.ts" -const docsSubProductsNav = [ +const desktopSubProductsNav = [ { label: "Data Feeds", href: "/data-feeds", + icon: dataFeedsLogo.src, }, { label: "Data Streams", href: "/data-streams", + icon: dataStreamsLogo.src, }, { label: "CCIP", href: "/ccip", + icon: ccipLogo.src, }, { label: "Functions", href: "/chainlink-functions", - }, - { - label: "VRF", - href: "/vrf", + icon: functionsLogo.src, }, { label: "Automation", href: "/chainlink-automation", + icon: automationLogo.src, }, { - label: "Nodes", - href: "/chainlink-nodes", - }, - { - label: "Overview", - href: "/", - hideFromDropdown: true, - }, -] - -const devHubResourcesUrl = "https://dev.chain.link/resources/" - -const quickStartsSubProductsNav = [ - { - label: "All Resources", - href: devHubResourcesUrl, - }, - { - label: "Guides", - href: devHubResourcesUrl + "guides", - }, - { - label: "Courses", - href: devHubResourcesUrl + "courses", + label: "VRF", + href: "/vrf", + icon: vrfLogo.src, }, { - label: "Beginner Tutorials", - href: devHubResourcesUrl + "beginner-tutorials", + label: "Chainlink Nodes", + href: "/chainlink-nodes", + icon: nodesLogo.src, }, { - label: "Tech Talks", - href: devHubResourcesUrl + "tech-talks", + label: "Quickstarts", + href: "/quickstarts", + icon: nodesLogo.src, }, { label: "Documentation", - href: "https://docs.chain.link", - }, - { - label: "QuickStarts", - href: devHubResourcesUrl + "quickstarts", - }, - { - label: "Case Studies", - href: devHubResourcesUrl + "case-studies", - }, - { - label: "Blogs", - href: devHubResourcesUrl + "blogs", - }, - { - label: "Videos", - href: devHubResourcesUrl + "videos", - }, - { - label: "QuickStarts", - href: "/quickstarts", + href: "/", hideFromDropdown: true, }, ] -const devHubCategories = [ +const docsSections = [ { - label: "Developer Hub", + label: "Documentation", items: [ { - label: "Home", - icon: "home", - href: "https://dev.chain.link/", - }, - { - label: "Docs", - icon: "documentation", - href: "https://docs.chain.link", + label: "Data Feeds", + href: "/data-feeds", + icon: dataFeedsLogo.src, subProducts: { - label: "Docs", - items: docsSubProductsNav, + label: "Data Feeds", + href: "/data-feeds", + items: sidebar.dataFeeds?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), }, }, { - label: "All Resources", - icon: "resources", - href: "https://dev.chain.link/resources", + label: "Data Streams", + href: "/data-streams", + icon: dataStreamsLogo.src, + subProducts: { + label: "Data Streams", + href: "/data-streams", + items: sidebar.dataStreams?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), + }, }, - ], - }, - { - label: "Product Resources", - items: [ { label: "CCIP", - icon: "ccip", - href: devHubProductsUrl + "ccip", - }, - { - label: "Data", - icon: "data", - href: devHubProductsUrl + "data", + href: "/ccip", + icon: ccipLogo.src, + subProducts: { + label: "CCIP", + href: "/ccip", + items: sidebar.ccip?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), + }, }, { label: "Functions", - icon: "functions", - href: devHubProductsUrl + "functions", + href: "/chainlink-functions", + icon: functionsLogo.src, + subProducts: { + label: "Functions", + href: "/chainlink-functions", + items: sidebar.chainlinkFunctions?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), + }, }, { label: "Automation", - icon: "automation", - href: devHubProductsUrl + "automation", + href: "/chainlink-automation", + icon: automationLogo.src, + subProducts: { + label: "Automation", + href: "/chainlink-automation", + items: sidebar.automation?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), + }, }, { label: "VRF", - icon: "vrf", - href: devHubProductsUrl + "vrf", + href: "/vrf", + icon: vrfLogo.src, + subProducts: { + label: "VRF", + href: "/vrf", + items: sidebar.vrf?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), + }, + }, + { + label: "Chainlink Nodes", + href: "/chainlink-nodes", + icon: nodesLogo.src, + subProducts: { + label: "Chainlink Nodes", + href: "/chainlink-nodes", + items: sidebar.nodeOperator?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), + }, }, { label: "General", - icon: "general", - href: devHubProductsUrl + "general", + href: "/resources", + subProducts: { + label: "General", + href: "/resources", + items: sidebar.global?.map((item) => ({ + label: item.section, + pages: item.contents.map((page) => ({ + label: page.title, + href: page.url, + })), + })), + }, }, ], }, ] -const quickStartsProductsNav = { - trigger: { label: "All Resources", icon: "resources" }, - categories: devHubCategories, -} +/* + { + label: "Learning Resources", + items: [ + { + label: "Developer Hub", + icon: nodesLogo.src, + href: "https://dev.chain.link", + external: true, + }, + ] + } +*/ -const docsProductsNav = { +const desktopProductsNav = { trigger: { label: "Docs", icon: "docs" }, - categories: devHubCategories, + categories: docsSections, } -const quickStartsProps = { productsNav: quickStartsProductsNav, subProductsNav: quickStartsSubProductsNav } -const docsProps = { productsNav: docsProductsNav, subProductsNav: docsSubProductsNav } +const docsProps = { productsNav: desktopProductsNav, subProductsNav: desktopSubProductsNav } export const getNavigationProps = (path: string) => { - const isQuickStarts = path.startsWith("/quickstarts") - - return isQuickStarts ? quickStartsProps : docsProps + return docsProps } diff --git a/src/components/Quickstart/QuickstartOverview.astro b/src/components/Quickstart/QuickstartOverview.astro index 6a37014b3e5..39b504a79ca 100644 --- a/src/components/Quickstart/QuickstartOverview.astro +++ b/src/components/Quickstart/QuickstartOverview.astro @@ -9,7 +9,7 @@ const { frontmatter } = Astro.props - Back

{frontmatter.title}

{frontmatter.description}

diff --git a/src/config/sidebar.ts b/src/config/sidebar.ts index 15f1479b46f..39e7d8e98e7 100644 --- a/src/config/sidebar.ts +++ b/src/config/sidebar.ts @@ -132,10 +132,6 @@ export const SIDEBAR: Partial> = { { section: "Resources", contents: [ - { - title: "Learning Resources", - url: "getting-started/other-tutorials?parent=dataFeeds", - }, { title: "Smart Contract Overview", url: "getting-started/conceptual-overview?parent=dataFeeds", @@ -237,10 +233,6 @@ export const SIDEBAR: Partial> = { { section: "Resources", contents: [ - { - title: "Learning Resources", - url: "getting-started/other-tutorials?parent=dataStreams", - }, { title: "Smart Contract Overview", url: "getting-started/conceptual-overview?parent=dataStreams", @@ -418,10 +410,6 @@ export const SIDEBAR: Partial> = { { section: "Resources", contents: [ - { - title: "Learning Resources", - url: "getting-started/other-tutorials?parent=automation", - }, { title: "Smart Contract Overview", url: "getting-started/conceptual-overview?parent=automation", @@ -609,10 +597,6 @@ export const SIDEBAR: Partial> = { { section: "Resources", contents: [ - { - title: "Learning Resources", - url: "getting-started/other-tutorials?parent=chainlinkFunctions", - }, { title: "Smart Contract Overview", url: "getting-started/conceptual-overview?parent=chainlinkFunctions", @@ -763,10 +747,6 @@ export const SIDEBAR: Partial> = { { section: "Resources", contents: [ - { - title: "Learning Resources", - url: "getting-started/other-tutorials?parent=vrf", - }, { title: "Smart Contract Overview", url: "getting-started/conceptual-overview?parent=vrf", @@ -983,10 +963,6 @@ export const SIDEBAR: Partial> = { { section: "Resources", contents: [ - { - title: "Learning Resources", - url: "getting-started/other-tutorials?parent=ccip", - }, { title: "Smart Contract Overview", url: "getting-started/conceptual-overview?parent=ccip", @@ -1276,10 +1252,6 @@ export const SIDEBAR: Partial> = { { section: "General Documentation", contents: [ - { - title: "Learning Resources", - url: "getting-started/other-tutorials", - }, { title: "Smart Contract Overview", url: "getting-started/conceptual-overview", diff --git a/src/content/getting-started/other-tutorials.mdx b/src/content/getting-started/other-tutorials.mdx deleted file mode 100644 index a43bd1f495e..00000000000 --- a/src/content/getting-started/other-tutorials.mdx +++ /dev/null @@ -1,138 +0,0 @@ ---- -section: global -date: Last Modified -title: "Learning Resources" ---- - -Welcome to the Resources page. This is a list of links and pages that you might need to help you throughout your learning journey. If you're new to Chainlink, start with the [Getting Started](/getting-started/conceptual-overview) guide to better understand the products and services Chainlink offers. This page contains more resources, inspiration, and outreach information to further your learning. - -## Smart contract learning materials - -Videos, tutorials, examples, and bootcamps are a great way to get experience building smart contracts and using Chainlink products. The following learning materials are useful for expanding your knowledge. - -### Video tutorials - -We're constantly uploading new videos to our [YouTube](https://www.youtube.com/c/chainlink) channel. Here are some direct links to playlists that may be helpful if you're starting your Chainlink learning journey or if you're looking for interesting ways to apply Chainlink to your project: - -- [Two-Minute Explainers](https://www.youtube.com/playlist?list=PLVP9aGDn-X0Q3qBME3T9sBMw66xPsglMA) -- [Chainlink Developer Workshops](https://www.youtube.com/playlist?list=PLVP9aGDn-X0SPHromvpiGvoNDpH7YErmf) -- [Chainlink Engineering Tutorials](https://www.youtube.com/playlist?list=PLVP9aGDn-X0QwJVbQvuKr-zrh2_DV5M6J) -- [Solidity, Blockchain, and Smart Contract Python Course](https://www.youtube.com/watch?v=M576WGiDBdQ) -- [Chainlink Engineering YouTube](https://www.youtube.com/playlist?list=PLVP9aGDn-X0QwJVbQvuKr-zrh2_DV5M6J) -- [Dapp University](https://www.youtube.com/watch?v=YLmMNocc1ys) -- [Austin Griffith](https://www.youtube.com/watch?v=ffU96UhlA0A) -- [Patrick Collins](https://www.youtube.com/watch?v=p36tXHX1JD8) -- [Nader Dabit](https://www.youtube.com/watch?v=nS9xP1hxg3w) -- [Alchemy University](https://university.alchemy.com/) - -### Applications - -Below is a list of applications of Chainlink's products and services sorted by difficulty and type to help you navigate and search for projects that you might find interesting. See the [Chainlink Blog](https://blog.chain.link/) to stay up to date with new ways to use Chainlink. - -#### Data feeds - -| Name | Type | Difficulty | -| :------------------------------------------------------------------------------------------------------------------------------------------------ | :------- | :--------- | -| [How to Calculate Price Volatility for DeFi Variance Swaps](https://blog.chain.link/how-to-calculate-price-volatility-for-defi-variance-swaps/) | DeFi | Advanced | -| [Build a dApp on Gnosis Chain (xDai) with Secure Data Feeds](https://blog.chain.link/build-a-dapp-on-xdai-chain-with-secure-data-feeds/) | DeFi | Medium | -| [Craft Whiskey Crypto Payments With Chainlink Oracles](https://blog.chain.link/craft-whiskey-crypto-payments-with-chainlink-oracles/) | Payments | Advanced | -| [Convert a Vending Machine to Accept Cryptocurrency Payments Using Chainlink Data Feeds](https://blog.chain.link/cryptocurrency-vending-machine/) | Payments | Advanced | -| [Build a dApp on BNB Chain With Secure Data Feeds](https://blog.chain.link/build-a-dapp-on-binance-smart-chain-with-secure-data-feeds/) | DeFi | Medium | -| [How to Use Chainlink With Hardhat](https://blog.chain.link/using-chainlink-with-hardhat/) | DeFi | Medium | -| [Develop a DeFi Project Using Python](https://blog.chain.link/develop-python-defi-project/) | DeFi | Medium | -| [Build a DeFi Call Option Exchange With Chainlink Data Feeds](https://blog.chain.link/defi-call-option-exchange-in-solidity/) | DeFi | Advanced | -| [Build a DeFi Yield Farming dApp Using Chainlink Data Feeds](https://blog.chain.link/build-defi-yield-farming-application-with-chainlink/) | DeFi | Advanced | -| [Build and Deploy an Avalanche Smart Contract](https://blog.chain.link/how-to-build-and-deploy-an-avalanche-smart-contract/) | DeFi | Beginner | - -#### Randomness (VRF) - -| Name | Type | Difficulty | -| :------------------------------------------------------------------------------------------------------------------ | :------- | :--------- | -| [How to Get a Random Number on Polygon](https://blog.chain.link/how-to-get-a-random-number-on-polygon/) | DeFi | Medium | -| [Build Your Own Dynamic NFT With Hardhat](https://blog.chain.link/dynamic-nft-hardhat/) | NFT | Advanced | -| [Build, Deploy, and Sell Your Own Dynamic NFT](https://blog.chain.link/build-deploy-and-sell-your-own-dynamic-nft/) | NFT | Advanced | -| [How to Build a Blockchain Lottery](https://blog.chain.link/how-to-build-a-blockchain-lottery-2/) | Gambling | Advanced | - -#### API requests - -| Name | Type | Difficulty | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------- | :--------- | -| [Build a Real Estate dApp With Chainlink Oracles](https://blog.chain.link/build-a-real-estate-dapp-with-chainlink-oracles/) | Real-Estate | Medium | -| [Offchain Computation: Statistical Analysis With Chainlink](https://blog.chain.link/off-chain-computation-statistical-analysis-with-chainlink/) | Statistical Analysis | Advanced | -| [Blockchain Fintech Tutorial: Lending and Borrowing With Python](https://blog.chain.link/blockchain-fintech-defi-tutorial-lending-borrowing-python/) | Lending | Medium | -| [Build a Blockchain-Based Fantasy Sports Game Using a Chainlink External Adapter](https://blog.chain.link/blockchain-based-fantasy-sports-game) | Sports | Medium | -| [Fetch IPFS Data in Smart Contracts Using a Chainlink External Adapter](https://blog.chain.link/fetch-ipfs-api-data-token-distribution/) | Audius | Medium | -| [How to Connect a Two-Factor Authentication (2FA) API to a Smart Contract With Chainlink](https://blog.chain.link/2fa-authentication-smart-contracts/) | Security | Medium | -| [Build a Marine Insurance Smart Contract With Chainlink](https://blog.chain.link/build-a-marine-insurance-smart-contract-with-chainlink/) | Insurance | Medium | -| [How to Build a Parametric Insurance Smart Contract](https://blog.chain.link/parametric-insurance-smart-contract/) | Insurance | Advanced | -| [Connect a Smart Contract to the Twitter API](https://blog.chain.link/connect-smart-contract-to-twitter-api/) | Social Media | Advanced | -| [Build an RFID Blockchain Integration With Chainlink External Adapters](https://blog.chain.link/rfid-blockchain-integration-with-chainlink-external-adapters/) | Identification | Advanced | -| [How to Connect a Tesla Vehicle API to a Smart Contract Via a Chainlink External Adapter](https://blog.chain.link/create-tesla-smart-contract-rental/) | Transportation | Advanced | -| [OAuth and API Authentication in Smart Contracts](https://blog.chain.link/oauth-and-api-authentication-in-smart-contracts-2/) | Security | Advanced | -| [Connect APIs to your Smart Contracts using Chainlink](https://docs.alchemy.com/docs/connect-apis-to-your-smart-contracts-using-chainlink) | NFT | Advanced | - -#### Automation - -| Name | Type | Difficulty | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | :--------- | :--------- | -| [Automation Introduction Video](https://www.youtube.com/watch?v=dj0impNJdls) | Automation | Beginner | -| [Smart Contract Automation Master Class Module #1](https://youtu.be/D3rMFshrj7c) | Automation | Beginner | -| [Smart Contract Automation Master Class Module #2](https://youtu.be/UT2qpUh0tmA/) | Automation | Beginner | -| [Smart Contract Automation Master Class Module #3](https://youtu.be/FirUe1YCcqs) | Automation | Beginner | -| [Smart Contract Automation Master Class Module #4](https://youtu.be/1a0wguM5Ig0) | Automation | Beginner | -| [Entropyfi Saves Engineering Hours with Chainlink Automation](https://medium.com/entropyfi/entropyfi-saves-engineering-hours-with-chainlink-keepers-6ec172a76249) | Gaming | Medium | -| [Enabling Limit Orders on CivTrade With Chainlink Automation](https://coinmarketcap.com/community/articles/63638ad4e0e9157c0425aa4b/) | Trading | Medium | -| [Pickle Finance UniV3 Jars Powered by Chainlink Automation](https://picklefinance.medium.com/pickle-finance-univ3-jars-powered-by-chainlink-keepers-8ce1756a2497) | Finance | Medium | -| [JamonSwap Introduces New Limit Order Functionality Using Chainlink Automation](https://medium.com/@JamonSwap/jamonswap-introduces-new-limit-order-functionality-using-chainlink-keepers-51bd94d75feb) | DeFi | Medium | -| [How Cratos used Chainlink Automation to automate the token vesting process](https://cratostoken.medium.com/how-cratos-used-chainlink-keepers-to-automate-the-token-vesting-process-69bcb3611161) | DeFi | Medium | -| [How ApeSwap Integrated Chainlink Automation for BANANA Maximizer Vaults](https://ape-swap.medium.com/how-apeswap-integrated-chainlink-keepers-for-banana-maximizer-vaults-2e88abb34eca) | DeFi | Medium | - -### Game resources - -- [CryptoZombies](https://cryptozombies.io/) -- [DamnVulnerableDefi](https://damnvulnerabledefi.xyz/challenges/8.html) -- [Ethernaut](https://ethernaut.openzeppelin.com/) - -### Coding bootcamps - -- [ChainShot](https://www.chainshot.com/courses) -- [Consensys Bootcamp](https://consensys.net/academy/bootcamp/) -- [Ivan On Tech](https://academy.moralis.io/courses/chainlink-101) - -### Starter kits - -Our Starter Kits help jumpstart your full-stack development process. You can get starter kits for Brownie (Python), Truffle (Javascript), and Hardhat (Javascript). See the [Engineering Tutorials](https://www.youtube.com/playlist?list=PLVP9aGDn-X0QwJVbQvuKr-zrh2_DV5M6J) playlist to learn more about each kit and how to use them. - -- [Chainlink Brownie Starter Kit (Python)](https://github.com/smartcontractkit/chainlink-mix) -- [Chainlink Truffle Starter Kit (Javascript)](https://github.com/smartcontractkit/truffle-starter-kit) -- [Chainlink Hardhat Starter Kit (Javascript)](https://github.com/smartcontractkit/hardhat-starter-kit) - -### External tutorials - -- [Ethereum Developers](https://ethereum.org/en/developers/tutorials/) -- [useWeb3](https://www.useweb3.xyz/) - -### More inspiration - -Looking for more ways to use Chainlink? Here are some resources that discuss Chainlink's use cases as well as the winning projects we've had in our previous hackathons. There is also a link to the Marketplace where you can find the latest data provider nodes and explore the network. - -- [77 Use Cases by Chainlink](https://blog.chain.link/44-ways-to-enhance-your-smart-contract-with-chainlink/) -- [Blog posts featuring past hackathons and winners](https://blog.chain.link/?s=hackathon) - -## Outreach - -The Chainlink community is an inviting group of engineers that is always looking to help users expand their knowledge on Chainlink and solve related issues. Refer back to the [Getting Help](/resources/getting-help) page for the latest information about how to get support. - -### Get support - -- [Stack Overflow](https://stackoverflow.com/questions/tagged/chainlink) -- [Stack Exchange Ethereum](https://ethereum.stackexchange.com/questions/tagged/chainlink) -- [Hackathon Discord](https://discord.gg/h3AvTHj) -- [Developer Discord](https://discord.gg/2YHSAey) - -### Join the community - -- [Twitter](https://mobile.twitter.com/chainlink) -- [Reddit](https://www.reddit.com/r/Chainlink/) -- [Telegram](https://t.me/chainlinkofficial) -- [Blog](https://blog.chain.link) diff --git a/src/features/landing/data/index.ts b/src/features/landing/data/index.ts index 5f4522ba7d2..70341e37682 100644 --- a/src/features/landing/data/index.ts +++ b/src/features/landing/data/index.ts @@ -1,15 +1,15 @@ -import ccipLogo from "../assets/ccip-logo.svg" -import vrfLogo from "../assets/vrf-logo.svg" -import functionsLogo from "../assets/functions-logo.svg" -import automationLogo from "../assets/automation-logo.svg" -import dataFeedsLogo from "../assets/data-feeds-logo.svg" -import ccipShape from "../assets/ccip-shape.svg" -import vrfShape from "../assets/vrf-shape.svg" -import functionsShape from "../assets/functions-shape.svg" -import automationShape from "../assets/automation-shape.svg" -import dataFeedShape from "../assets/data-feeds-shape.svg" -import dataStreamsLogo from "../assets/data-streams-logo.svg" -import dataStreamsShape from "../assets/data-streams-shape.svg" +import ccipLogo from "../../../assets/product-logos/ccip-logo.svg" +import vrfLogo from "../../../assets/product-logos/vrf-logo.svg" +import functionsLogo from "../../../assets/product-logos/functions-logo.svg" +import automationLogo from "../../../assets/product-logos/automation-logo.svg" +import dataFeedsLogo from "../../../assets/product-logos/data-feeds-logo.svg" +import ccipShape from "../../../assets/product-logos/ccip-shape.svg" +import vrfShape from "../../../assets/product-logos/vrf-shape.svg" +import functionsShape from "../../../assets/product-logos/functions-shape.svg" +import automationShape from "../../../assets/product-logos/automation-shape.svg" +import dataFeedShape from "../../../assets/product-logos/data-feeds-shape.svg" +import dataStreamsLogo from "../../../assets/product-logos/data-streams-logo.svg" +import dataStreamsShape from "../../../assets/product-logos/data-streams-shape.svg" import { ProductCardProps } from "../components/ProductCard" const baseChains = [ diff --git a/src/features/redirects/redirects.json b/src/features/redirects/redirects.json index 0b0585d5c9c..a7dd761784d 100644 --- a/src/features/redirects/redirects.json +++ b/src/features/redirects/redirects.json @@ -1869,6 +1869,16 @@ "source": "chainlink-nodes/resources/best-practices-aws", "destination": "chainlink-nodes", "statuscode": 301 + }, + { + "source": "getting-started/other-tutorials", + "destination": "https://dev.chain.link", + "statuscode": 301 + }, + { + "source": "quickstarts", + "destination": "https://dev.chain.link/resources/quickstarts", + "statuscode": 301 } ] } From 703d69bd96812ce1b5948c2bcfe765fe997629d0 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Fri, 31 May 2024 10:56:11 -0500 Subject: [PATCH 02/14] Formatting --- .../Mobile/ProductNavigation.tsx | 4 ++-- .../Mobile/SubProductContent.tsx | 16 +++++++++------- src/components/Header/Nav/config.tsx | 2 +- .../common/StreamsLookupInterface.mdx | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx index 7eb953b44f9..82a265b8bbe 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx @@ -12,8 +12,8 @@ import { SubProductContent } from "./SubProductContent" import externalArrow from "../../../../../assets/icons/external-arrow.svg" type Page = { - label: string; - href: string; + label: string + href: string } export type SubProducts = { diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx index b5e598bd463..2892679fdc3 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx @@ -3,8 +3,8 @@ import { BackArrowIcon } from "./BackArrowIcon" import styles from "./subProductContent.module.css" type Page = { - label: string; - href: string; + label: string + href: string } type Props = { @@ -27,12 +27,14 @@ export const SubProductContent = ({ subProducts, onSubproductClick }: Props) => {subProducts.items.map(({ label, pages }) => (
-

{label}

- {pages?.map(({ label, href }) => ( - +

{label} - - ))} +

+ {pages?.map(({ label, href }) => ( + + {label} + + ))}
))} diff --git a/src/components/Header/Nav/config.tsx b/src/components/Header/Nav/config.tsx index abf8dbaab52..13cea8d049c 100644 --- a/src/components/Header/Nav/config.tsx +++ b/src/components/Header/Nav/config.tsx @@ -4,7 +4,7 @@ type LinksConfig = { actionButton?: { label: string; href: string } } -export type Item = { label: string; icon?: string; href: string; } +export type Item = { label: string; icon?: string; href: string } export type ProductItem = Item & { subProducts?: { diff --git a/src/features/chainlink-automation/common/StreamsLookupInterface.mdx b/src/features/chainlink-automation/common/StreamsLookupInterface.mdx index 1a49c28fc13..917424cb2c0 100644 --- a/src/features/chainlink-automation/common/StreamsLookupInterface.mdx +++ b/src/features/chainlink-automation/common/StreamsLookupInterface.mdx @@ -19,7 +19,7 @@ Automation network will use this revert to trigger fetching of the specified rep | `feeds` | `String[]` | String list of feed identifiers | e.g. `["feedID1","feedID2",..]` with a maximum of 5 IDs | | `timeParamKey` | `String` | Specify query type | `"timestamp"` | | `time` | `uint256` | Specify query value | e.g. `log.timestamp` from the returned Log struct in `checkLog` | -| `extraData` | `bytes` | Any extra data user wants to receive in callback, alongside API bytes[] | e.g. log data | +| `extraData` | `bytes` | Any extra data user wants to receive in callback, alongside API bytes[] | e.g. log data | #### Outputs From 5812b2bf5a0c7135d29d09f263f2da16955f5ad9 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Fri, 31 May 2024 13:30:02 -0500 Subject: [PATCH 03/14] Left burger mobile menu --- src/components/Header/Nav/NavBar.tsx | 4 +-- .../Nav/ProductNavigation/Mobile/MenuIcon.tsx | 2 +- .../Mobile/ProductNavigation.tsx | 3 +- src/components/Header/Nav/navBar.module.css | 33 ++++++++++++++++++- src/content/any-api/getting-started.mdx | 2 -- 5 files changed, 37 insertions(+), 7 deletions(-) diff --git a/src/components/Header/Nav/NavBar.tsx b/src/components/Header/Nav/NavBar.tsx index cc9a2d471f9..0cbb4680308 100644 --- a/src/components/Header/Nav/NavBar.tsx +++ b/src/components/Header/Nav/NavBar.tsx @@ -82,7 +82,7 @@ export const NavBar = ({ path, searchTrigger, onHideChange, productsNav, subProd
-
+ -
+
( - + - Documentation + Date: Fri, 31 May 2024 14:21:45 -0500 Subject: [PATCH 04/14] Mobile menu --- .../ProductNavigation/Mobile/BottomBar.tsx | 28 ++++++++----------- .../Mobile/ProductNavigation.tsx | 1 - .../Mobile/bottomBar.module.css | 5 +++- src/components/Header/Nav/navBar.module.css | 12 ++++++++ 4 files changed, 27 insertions(+), 19 deletions(-) diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx index 86552922874..55b4b930b53 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx @@ -3,30 +3,24 @@ import { ResourcesIcon } from "./ResourcesIcon" import { Search } from "../../../aiSearch/Search" const ResourcesButton = () => ( - + - - GitHub - - + GitHub
) const SearchButton = () => +const DeveloperHubButton = () => ( + + Developer Hub +
+ +) + export const BottomBar = () => { - // Additional buttons should be added to this array in order to have the right number of columns in the layout - const buttons = [SearchButton, ResourcesButton] + const buttons = [, , ] return (
{ }} > {buttons.map((ButtonComponent, index) => ( - +
{ButtonComponent}
))}
) diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx index 51e98bc9d10..6d051e7b3f7 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx @@ -9,7 +9,6 @@ import { BottomBar } from "./BottomBar" import { ProductContent } from "./ProductContent" import styles from "./productNavigation.module.css" import { SubProductContent } from "./SubProductContent" -import externalArrow from "../../../../../assets/icons/external-arrow.svg" import { MenuIcon } from "./MenuIcon" type Page = { diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/bottomBar.module.css b/src/components/Header/Nav/ProductNavigation/Mobile/bottomBar.module.css index ca31c08fcc0..7f0e5665655 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/bottomBar.module.css +++ b/src/components/Header/Nav/ProductNavigation/Mobile/bottomBar.module.css @@ -7,6 +7,8 @@ background-color: var(--color-background-secondary); color: var(--color-text-secondary); display: grid; + grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); + gap: var(--space-2x); align-items: center; justify-content: center; } @@ -17,6 +19,7 @@ align-items: center; gap: var(--space-2x); height: 100%; + width: 100%; position: relative; } @@ -30,7 +33,7 @@ .divider { background-color: var(--blue-200); - width: 1px; + width: 2px; height: 100%; align-self: center; position: absolute; diff --git a/src/components/Header/Nav/navBar.module.css b/src/components/Header/Nav/navBar.module.css index f1ee9e2933c..731e917ab89 100644 --- a/src/components/Header/Nav/navBar.module.css +++ b/src/components/Header/Nav/navBar.module.css @@ -332,4 +332,16 @@ flex-grow: 0; justify-content: flex-end; } + + .searchTrigger { + display: none; + } + + .quickLinksWrapper { + display: none; + } + + .weglotContainer { + margin-right: 0; + } } From c5c9c8f2b9861f83fde173b950baeb9048ce6c69 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:05:50 -0500 Subject: [PATCH 05/14] Nav improvements --- src/components/Header/Nav/NavBar.tsx | 2 +- .../Desktop/ProductNavigation.tsx | 26 +++++++++---------- .../ProductNavigation/Mobile/BottomBar.tsx | 17 +++++------- .../Mobile/ProductNavigation.tsx | 14 +++++----- .../Mobile/bottomBar.module.css | 24 ++++++++--------- .../Mobile/subProductContent.module.css | 3 +-- src/components/Header/Nav/navBar.module.css | 10 ++----- 7 files changed, 41 insertions(+), 55 deletions(-) diff --git a/src/components/Header/Nav/NavBar.tsx b/src/components/Header/Nav/NavBar.tsx index 0cbb4680308..90768aed403 100644 --- a/src/components/Header/Nav/NavBar.tsx +++ b/src/components/Header/Nav/NavBar.tsx @@ -89,7 +89,7 @@ export const NavBar = ({ path, searchTrigger, onHideChange, productsNav, subProd title="Documentation Home" style={{ display: "flex" }} src="/chainlink-docs.svg" - height={28} + height={30} />
diff --git a/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx b/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx index 379dadf70cf..881ebdd83e6 100644 --- a/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx +++ b/src/components/Header/Nav/ProductNavigation/Desktop/ProductNavigation.tsx @@ -37,23 +37,23 @@ export const ProductNavigation = ({ path, setNavMenuOpen, productsNav, subProduc const subProductTrigger = subProductsNav?.find(({ href }) => isMatchedPath(path, href)) + const label = subProductTrigger?.label || "Resources" + const icon = subProductTrigger?.label ? subProductTrigger.icon : undefined + return ( <> - {subProductTrigger && subProductsNav && ( - <> - - - - - - - - - - )} - + + + + + {(subProductTrigger || label === "Resources") && subProductsNav && ( + + + + )} +
diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx index 55b4b930b53..9663fd36f22 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/BottomBar.tsx @@ -6,7 +6,6 @@ const ResourcesButton = () => ( GitHub -
) @@ -15,22 +14,18 @@ const SearchButton = () => const DeveloperHubButton = () => ( Developer Hub -
) export const BottomBar = () => { const buttons = [, , ] return ( -
- {buttons.map((ButtonComponent, index) => ( -
{ButtonComponent}
- ))} +
+
+ {buttons.map((ButtonComponent, index) => ( +
{ButtonComponent}
+ ))} +
) } diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx index 6d051e7b3f7..f6fce4af12b 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/ProductNavigation.tsx @@ -9,7 +9,6 @@ import { BottomBar } from "./BottomBar" import { ProductContent } from "./ProductContent" import styles from "./productNavigation.module.css" import { SubProductContent } from "./SubProductContent" -import { MenuIcon } from "./MenuIcon" type Page = { label: string @@ -57,12 +56,13 @@ export function ProductNavigation({ productsNav }: Props) { return ( - - - + Documentation Home div { + display: flex; + justify-content: space-between; + align-items: center; + gap: var(--space-2x); + width: calc(100% - 2 * var(--space-2x)); } .bottomBar :is(button, a) { @@ -30,12 +37,3 @@ .back svg { fill: var(--color-text-link); } - -.divider { - background-color: var(--blue-200); - width: 2px; - height: 100%; - align-self: center; - position: absolute; - left: 0; -} diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css b/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css index d3c322a51fb..825edfb433f 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css +++ b/src/components/Header/Nav/ProductNavigation/Mobile/subProductContent.module.css @@ -18,6 +18,5 @@ .link { display: block; - padding-bottom: var(--space-5x); - padding-left: var(--space-5x); + padding: var(--space-2x) 0 var(--space-2x) var(--space-5x); } diff --git a/src/components/Header/Nav/navBar.module.css b/src/components/Header/Nav/navBar.module.css index 731e917ab89..b2764fa7a88 100644 --- a/src/components/Header/Nav/navBar.module.css +++ b/src/components/Header/Nav/navBar.module.css @@ -37,6 +37,7 @@ } .logoSection, +.menuSection, .rightSection { display: flex; align-items: center; @@ -315,10 +316,7 @@ } .logoSection { - position: absolute; - left: 50%; - transform: translateX(-50%); - width: auto; + display: none; } .menuSection { @@ -337,10 +335,6 @@ display: none; } - .quickLinksWrapper { - display: none; - } - .weglotContainer { margin-right: 0; } From 234a5dfdebb4a358df66babb44bc1ce2e4855beb Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Mon, 3 Jun 2024 10:58:13 -0500 Subject: [PATCH 06/14] Temp fix type error --- .../Header/Nav/ProductNavigation/Mobile/Category.tsx | 11 ++++++++++- src/components/Header/Nav/config.tsx | 7 ++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx index 86eaaa68b3a..f47503b27ef 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/Category.tsx @@ -24,7 +24,16 @@ const Item = React.forwardRef(
diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx index 2892679fdc3..780b3a14d1f 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx @@ -9,16 +9,16 @@ type Page = { type Props = { onSubproductClick: () => void - subProducts?: - | { - label: string - items: { label: string; icon?: string; href: string; pages?: Page[] }[] - } - | undefined + subProducts?: { + label: string + items: { label: string; icon?: string; href: string; pages?: Page[] }[] + } + currentPath: string } -export const SubProductContent = ({ subProducts, onSubproductClick }: Props) => { +export const SubProductContent = ({ subProducts, onSubproductClick, currentPath }: Props) => { if (!subProducts) return null + return ( <> {subProducts.items.map(({ label, pages }) => (
-

- {label} -

- {pages?.map(({ label, href }) => ( - - {label} - - ))} +

{label}

+ {pages?.map(({ label, href }) => { + const adjustedHref = "/" + href + const isActive = currentPath === adjustedHref + + const linkStyle = { + backgroundColor: isActive ? "var(--blue-100)" : "transparent", + color: isActive ? "var(--blue-600)" : "inherit", + fontWeight: isActive ? "500" : "normal", + } + + return ( + + {label} + + ) + })}
))} From 6a25df043b270c734e467f7456e1e3c55a72e072 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Mon, 3 Jun 2024 18:23:59 -0500 Subject: [PATCH 09/14] Normalize URL paths --- .../Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx index 780b3a14d1f..bd1bc6ee50f 100644 --- a/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx +++ b/src/components/Header/Nav/ProductNavigation/Mobile/SubProductContent.tsx @@ -30,7 +30,7 @@ export const SubProductContent = ({ subProducts, onSubproductClick, currentPath

{label}

{pages?.map(({ label, href }) => { const adjustedHref = "/" + href - const isActive = currentPath === adjustedHref + const isActive = currentPath.replace(/\/$/, "") === adjustedHref.replace(/\/$/, "") const linkStyle = { backgroundColor: isActive ? "var(--blue-100)" : "transparent", From da9a193f884a925c071139556ebf481755a75451 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:17:17 -0500 Subject: [PATCH 10/14] Hide home hero-background on mobile --- src/features/landing/sections/HeroCTA.astro | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/features/landing/sections/HeroCTA.astro b/src/features/landing/sections/HeroCTA.astro index d1d6f1566d1..6c6ed1fc4d2 100644 --- a/src/features/landing/sections/HeroCTA.astro +++ b/src/features/landing/sections/HeroCTA.astro @@ -13,7 +13,7 @@ import button from "@chainlink/design-system/button.module.css" Get Started Starter Kits
-
+
@@ -57,4 +57,10 @@ import button from "@chainlink/design-system/button.module.css" flex-wrap: nowrap; } } + + @media screen and (max-width: 767px) { + .hero-image-container { + display: none; + } + } From 18b3875a6dd46156ca1e7cdd2a4fea6879096c0d Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:26:16 -0500 Subject: [PATCH 11/14] Remove back button from docs pages --- src/components/PageContent/PageContent.astro | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/PageContent/PageContent.astro b/src/components/PageContent/PageContent.astro index 5da78083195..5e5689abf6b 100644 --- a/src/components/PageContent/PageContent.astro +++ b/src/components/PageContent/PageContent.astro @@ -8,7 +8,6 @@ export type Props = { const { titleHeading } = Astro.props --- -

{titleHeading.text}

From db5190ad5933357247ed450a491b1343cc077ed8 Mon Sep 17 00:00:00 2001 From: Karim <98668332+khadni@users.noreply.github.com> Date: Tue, 4 Jun 2024 11:31:36 -0500 Subject: [PATCH 12/14] Add QS link to mobile nav --- src/components/Header/getNavigationProps.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/Header/getNavigationProps.ts b/src/components/Header/getNavigationProps.ts index f988f30a1f8..8660fd4171c 100644 --- a/src/components/Header/getNavigationProps.ts +++ b/src/components/Header/getNavigationProps.ts @@ -171,6 +171,11 @@ const docsSections = [ })), }, }, + { + label: "Quickstarts", + href: "/quickstarts", + icon: nodesLogo.src, + }, { label: "General", href: "/resources", From 693b69b5d7b81ad9e50cae9ff1410f3a31511f56 Mon Sep 17 00:00:00 2001 From: Dwight Lyle Date: Tue, 4 Jun 2024 13:39:00 -0600 Subject: [PATCH 13/14] Add remaining logos --- src/assets/product-logos/quickstart-logo.svg | 3 +++ src/components/Header/getNavigationProps.ts | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 src/assets/product-logos/quickstart-logo.svg diff --git a/src/assets/product-logos/quickstart-logo.svg b/src/assets/product-logos/quickstart-logo.svg new file mode 100644 index 00000000000..907d92761cd --- /dev/null +++ b/src/assets/product-logos/quickstart-logo.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/Header/getNavigationProps.ts b/src/components/Header/getNavigationProps.ts index 8660fd4171c..b9321521ae1 100644 --- a/src/components/Header/getNavigationProps.ts +++ b/src/components/Header/getNavigationProps.ts @@ -4,7 +4,9 @@ import functionsLogo from "../../assets/product-logos/functions-logo.svg" import automationLogo from "../../assets/product-logos/automation-logo.svg" import dataFeedsLogo from "../../assets/product-logos/data-feeds-logo.svg" import dataStreamsLogo from "../../assets/product-logos/data-streams-logo.svg" -import nodesLogo from "../../assets/product-logos/general-logo.svg" +import generalLogo from "../../assets/product-logos/general-logo.svg" +import nodesLogo from "../../assets/product-logos/node-logo.svg" +import quickstartLogo from "../../assets/product-logos/quickstart-logo.svg" import { SIDEBAR as sidebar } from "../../config/sidebar.ts" const desktopSubProductsNav = [ @@ -46,7 +48,7 @@ const desktopSubProductsNav = [ { label: "Quickstarts", href: "/quickstarts", - icon: nodesLogo.src, + icon: quickstartLogo.src, }, { label: "Documentation", @@ -174,11 +176,12 @@ const docsSections = [ { label: "Quickstarts", href: "/quickstarts", - icon: nodesLogo.src, + icon: quickstartLogo.src, }, { label: "General", href: "/resources", + icon: generalLogo.src, subProducts: { label: "General", href: "/resources", From 144ab50f49f128ef337b63e2a436286a49170e31 Mon Sep 17 00:00:00 2001 From: Dwight Lyle Date: Tue, 4 Jun 2024 14:28:02 -0600 Subject: [PATCH 14/14] Swap QS and General logos and nav position --- src/assets/product-logos/general-logo.svg | 17 ++--------------- src/assets/product-logos/quickstart-logo.svg | 17 +++++++++++++++-- .../{general-shape.svg => quickstart-shape.svg} | 0 src/components/Header/getNavigationProps.ts | 10 +++++----- 4 files changed, 22 insertions(+), 22 deletions(-) rename src/assets/product-logos/{general-shape.svg => quickstart-shape.svg} (100%) diff --git a/src/assets/product-logos/general-logo.svg b/src/assets/product-logos/general-logo.svg index f477dc5a697..907d92761cd 100644 --- a/src/assets/product-logos/general-logo.svg +++ b/src/assets/product-logos/general-logo.svg @@ -1,16 +1,3 @@ - - - - - - - - - - - - - - - + + diff --git a/src/assets/product-logos/quickstart-logo.svg b/src/assets/product-logos/quickstart-logo.svg index 907d92761cd..f477dc5a697 100644 --- a/src/assets/product-logos/quickstart-logo.svg +++ b/src/assets/product-logos/quickstart-logo.svg @@ -1,3 +1,16 @@ - - + + + + + + + + + + + + + + + diff --git a/src/assets/product-logos/general-shape.svg b/src/assets/product-logos/quickstart-shape.svg similarity index 100% rename from src/assets/product-logos/general-shape.svg rename to src/assets/product-logos/quickstart-shape.svg diff --git a/src/components/Header/getNavigationProps.ts b/src/components/Header/getNavigationProps.ts index b9321521ae1..56ddc73aa81 100644 --- a/src/components/Header/getNavigationProps.ts +++ b/src/components/Header/getNavigationProps.ts @@ -173,11 +173,6 @@ const docsSections = [ })), }, }, - { - label: "Quickstarts", - href: "/quickstarts", - icon: quickstartLogo.src, - }, { label: "General", href: "/resources", @@ -194,6 +189,11 @@ const docsSections = [ })), }, }, + { + label: "Quickstarts", + href: "/quickstarts", + icon: quickstartLogo.src, + }, ], }, ]