From 2d540dfe448fd485aac21b7c9fdf7a263b06f1ff Mon Sep 17 00:00:00 2001 From: Simone Cuomo Date: Fri, 18 Oct 2024 16:16:01 +0100 Subject: [PATCH] Add General icons (#2127) * Add General * Update General Icon * Update links as requested by Nav --------- Co-authored-by: Amine E. --- astro.config.ts | 4 +++ src/assets/product-logos/default-logo.svg | 11 +++++++ src/assets/product-logos/general-logo.svg | 13 ++------ src/assets/product-logos/node-logo.svg | 20 ++----------- src/assets/product-logos/quickstart-logo.svg | 12 ++------ .../DocsPickerDesktop.tsx | 3 +- .../DocsNavigationMobile/DocsPickerMobile.tsx | 3 +- src/components/Header/getNavigationProps.ts | 30 +++++++++++++------ src/pages/index.astro | 3 +- 9 files changed, 50 insertions(+), 49 deletions(-) create mode 100644 src/assets/product-logos/default-logo.svg diff --git a/astro.config.ts b/astro.config.ts index 6474b38b55b..aefe05cd456 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -11,6 +11,10 @@ import { RehypePlugins } from "@astrojs/markdown-remark" // https://astro.build/config export default defineConfig({ site: "https://docs.chain.link", + redirects: { + "/getting-started": "/getting-started/conceptual-overview", + "/resources": "/resources/link-token-contracts", + }, integrations: [ preact({ include: ["**/preact/*"], diff --git a/src/assets/product-logos/default-logo.svg b/src/assets/product-logos/default-logo.svg new file mode 100644 index 00000000000..1f7710d095b --- /dev/null +++ b/src/assets/product-logos/default-logo.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/assets/product-logos/general-logo.svg b/src/assets/product-logos/general-logo.svg index 5e9aff345dd..aedcbb7bed2 100644 --- a/src/assets/product-logos/general-logo.svg +++ b/src/assets/product-logos/general-logo.svg @@ -1,11 +1,4 @@ - - - - - - - - - - + + + diff --git a/src/assets/product-logos/node-logo.svg b/src/assets/product-logos/node-logo.svg index 615d88095db..2ada527e5d4 100644 --- a/src/assets/product-logos/node-logo.svg +++ b/src/assets/product-logos/node-logo.svg @@ -1,19 +1,5 @@ - - - - - - - - - - - - - - - - - + + + diff --git a/src/assets/product-logos/quickstart-logo.svg b/src/assets/product-logos/quickstart-logo.svg index 67160818a5f..fdd10054c89 100644 --- a/src/assets/product-logos/quickstart-logo.svg +++ b/src/assets/product-logos/quickstart-logo.svg @@ -1,12 +1,4 @@ - - - - - - - - - - + + diff --git a/src/components/DocsNavigation/DocsNavigationDesktop/DocsPickerDesktop.tsx b/src/components/DocsNavigation/DocsNavigationDesktop/DocsPickerDesktop.tsx index 2fcc546e8c6..0723ea62325 100644 --- a/src/components/DocsNavigation/DocsNavigationDesktop/DocsPickerDesktop.tsx +++ b/src/components/DocsNavigation/DocsNavigationDesktop/DocsPickerDesktop.tsx @@ -3,6 +3,7 @@ import { isMatchedPath } from "../../Header/Nav/isMatchedPath" import { getNavigationProps } from "../../Header/getNavigationProps" import styles from "./docsPickerDesktop.module.css" import { clsx } from "../../Header/Nav/utils" +import defaultLogo from "../../../assets/product-logos/default-logo.svg" function DocsPickerDesktop({ pathname }: { pathname: string }) { const [productMenuOpen, setProductMenuOpen] = useState(false) @@ -10,7 +11,7 @@ function DocsPickerDesktop({ pathname }: { pathname: string }) { const subProductTrigger = subProductsNav?.find(({ href }) => isMatchedPath(pathname, href)) const label = subProductTrigger?.label || "Resources" - const icon = subProductTrigger?.label ? subProductTrigger.icon : undefined + const icon = subProductTrigger?.label ? subProductTrigger.icon : defaultLogo.src return (
isMatchedPath(path, href)) const label = subProductTrigger?.label || "Resources" - const icon = subProductTrigger?.label ? subProductTrigger.icon : undefined + const icon = subProductTrigger?.label ? subProductTrigger.icon : defaultLogo.src useEffect(() => { const foundSubProduct = productsNav.categories.find((category) => diff --git a/src/components/Header/getNavigationProps.ts b/src/components/Header/getNavigationProps.ts index 47f5fbb032b..4c3b660b7ba 100644 --- a/src/components/Header/getNavigationProps.ts +++ b/src/components/Header/getNavigationProps.ts @@ -97,13 +97,25 @@ const desktopSubProductsNav = [ icon: quickstartLogo.src, col: 2, }, - { label: "Documentation", href: "/", hideFromDropdown: true, col: 2, }, + { + label: "General", + href: "/getting-started", + icon: generalLogo.src, + col: 2, + }, + { + label: "General", + href: "/resources", + icon: generalLogo.src, + col: 2, + hideFromDropdown: true, + }, ] const docsSections = [ @@ -147,6 +159,12 @@ const docsSections = [ icon: automationLogo.src, subProducts: getSubProducts(sidebar.automation), }, + { + label: "Chainlink Local", + href: "/chainlink-local", + icon: chainlinkLocal.src, + subProducts: getSubProducts(sidebar.chainlinkLocal), + }, { label: "Nodes", href: "/chainlink-nodes", @@ -154,10 +172,9 @@ const docsSections = [ subProducts: getSubProducts(sidebar.nodeOperator), }, { - label: "Chainlink Local", - href: "/chainlink-local", + label: "Quickstarts", + href: "/quickstarts", icon: quickstartLogo.src, - subProducts: getSubProducts(sidebar.chainlinkLocal), }, { label: "General", @@ -165,11 +182,6 @@ const docsSections = [ icon: generalLogo.src, subProducts: getSubProducts(sidebar.global), }, - { - label: "Quickstarts", - href: "/quickstarts", - icon: quickstartLogo.src, - }, ], }, ] diff --git a/src/pages/index.astro b/src/pages/index.astro index 5a31cb17375..2a27d71c557 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -22,7 +22,8 @@ const formattedContentTitle = `${CONFIG.PAGE.titleFallback} | ${CONFIG.SITE.titl

Recommended reading

We think you'd love to explore

- LINK Token Contracts + General + Link Token Contracts Getting Started with CCIP CCIP Supported Networks Data Feed Addresses