From f90c4928ddb59822595e430194aeb0d8661f3ccc Mon Sep 17 00:00:00 2001 From: aelmanaa Date: Sat, 20 Jul 2024 13:10:27 +0200 Subject: [PATCH 01/46] chainlink-local api ref --- src/components/Header/getNavigationProps.ts | 7 + src/components/LeftSidebar/LeftSidebar.astro | 100 +++++-- src/config/sidebar.ts | 88 +++++- .../chainlink-local/api-reference/index.mdx | 9 + .../javascript/CCIPLocalSimulatorFork.mdx | 90 ++++++ .../api-reference/javascript/index.mdx | 8 + .../solidity/ccip/BurnMintERC677Helper.mdx | 49 ++++ .../solidity/ccip/CCIPLocalSimulator.mdx | 177 ++++++++++++ .../solidity/ccip/CCIPLocalSimulatorFork.mdx | 175 ++++++++++++ .../solidity/ccip/MockEvm2EvmOffRamp.mdx | 181 ++++++++++++ .../api-reference/solidity/ccip/Register.mdx | 76 +++++ .../api-reference/solidity/ccip/index.mdx | 12 + .../data-feeds/MockOffchainAggregator.mdx | 182 ++++++++++++ .../solidity/data-feeds/MockV3Aggregator.mdx | 268 ++++++++++++++++++ .../solidity/data-feeds/index.mdx | 10 + .../interfaces/AggregatorInterface.mdx | 127 +++++++++ .../interfaces/AggregatorV2V3Interface.mdx | 10 + .../interfaces/AggregatorV3Interface.mdx | 103 +++++++ .../solidity/data-feeds/interfaces/index.mdx | 10 + .../api-reference/solidity/index.mdx | 10 + .../solidity/shared/LinkToken.mdx | 37 +++ .../api-reference/solidity/shared/WETH9.mdx | 110 +++++++ .../api-reference/solidity/shared/index.mdx | 9 + src/content/chainlink-local/index.mdx | 18 ++ src/content/config.ts | 4 + src/pages/chainlink-local/[...slug].astro | 21 ++ src/pages/chainlink-local/index.astro | 10 + 27 files changed, 1884 insertions(+), 17 deletions(-) create mode 100644 src/content/chainlink-local/api-reference/index.mdx create mode 100644 src/content/chainlink-local/api-reference/javascript/CCIPLocalSimulatorFork.mdx create mode 100644 src/content/chainlink-local/api-reference/javascript/index.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/ccip/BurnMintERC677Helper.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/ccip/CCIPLocalSimulator.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/ccip/CCIPLocalSimulatorFork.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/ccip/MockEvm2EvmOffRamp.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/ccip/Register.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/ccip/index.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/data-feeds/MockOffchainAggregator.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/data-feeds/MockV3Aggregator.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/data-feeds/index.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/data-feeds/interfaces/AggregatorInterface.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/data-feeds/interfaces/AggregatorV2V3Interface.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/data-feeds/interfaces/AggregatorV3Interface.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/data-feeds/interfaces/index.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/index.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/shared/LinkToken.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/shared/WETH9.mdx create mode 100644 src/content/chainlink-local/api-reference/solidity/shared/index.mdx create mode 100644 src/content/chainlink-local/index.mdx create mode 100644 src/pages/chainlink-local/[...slug].astro create mode 100644 src/pages/chainlink-local/index.astro diff --git a/src/components/Header/getNavigationProps.ts b/src/components/Header/getNavigationProps.ts index 54766bf8c93..1ea47337cb9 100644 --- a/src/components/Header/getNavigationProps.ts +++ b/src/components/Header/getNavigationProps.ts @@ -77,6 +77,7 @@ const desktopSubProductsNav = [ href: "/chainlink-nodes", icon: nodesLogo.src, }, + { label: "Chainlink Local", href: "/chainlink-local", icon: quickstartLogo.src }, { label: "Quickstarts", href: "/quickstarts", @@ -135,6 +136,12 @@ const docsSections = [ icon: nodesLogo.src, subProducts: getSubProducts(sidebar.nodeOperator), }, + { + label: "Chainlink Local", + href: "/chainlink-local", + icon: quickstartLogo.src, + subProducts: getSubProducts(sidebar.chainlinkLocal), + }, { label: "General", href: "/resources", diff --git a/src/components/LeftSidebar/LeftSidebar.astro b/src/components/LeftSidebar/LeftSidebar.astro index 5e9dc9b8671..d5f81863db5 100644 --- a/src/components/LeftSidebar/LeftSidebar.astro +++ b/src/components/LeftSidebar/LeftSidebar.astro @@ -1,8 +1,9 @@ --- import { Sections } from "~/content/config" -import { SIDEBAR, MENU, SectionContent } from "../../config" +import { SIDEBAR, SectionContent } from "../../config" import { flattenChildren } from "../../scripts/flatten-children" import ActiveIcon from "./ActiveIcon.astro" + export type Props = { currentPage: string section?: Sections @@ -47,6 +48,19 @@ const isCurrentPageMatch = (sectionUrl: string, currentPage: string, highlightAs return false } + +// This function checks if any of the nested pages match the current page +const isAnyPageMatch = (contents: SectionContent[], currentPage: string): boolean => { + return contents.some((content) => { + if (isCurrentPageMatch(content.url, currentPage)) { + return true + } + if (content.children && isAnyPageMatch(content.children, currentPage)) { + return true + } + return false + }) +} ---