From 493265183750f03c9bead31c521cdc53cbce75be Mon Sep 17 00:00:00 2001 From: Claudio Wunder Date: Mon, 10 Jul 2023 11:18:05 +0200 Subject: [PATCH] chore: use defined urls for distribution and api docs --- components/Api/JsonLink/index.tsx | 8 ++-- components/Docs/NodeApiVersionLinks.tsx | 40 ++++++++++--------- .../Downloads/PrimaryDownloadMatrix.tsx | 33 +++++++-------- .../Downloads/SecondaryDownloadMatrix.tsx | 7 ++-- components/Home/HomeDownloadButton.tsx | 3 +- next.constants.mjs | 22 ++++++++-- util/downloadUrlByOS.ts | 3 +- util/getNodeApiLink.ts | 7 ++-- 8 files changed, 73 insertions(+), 50 deletions(-) diff --git a/components/Api/JsonLink/index.tsx b/components/Api/JsonLink/index.tsx index 8110de45c4de7..4ebf727435360 100644 --- a/components/Api/JsonLink/index.tsx +++ b/components/Api/JsonLink/index.tsx @@ -1,8 +1,10 @@ import { FormattedMessage } from 'react-intl'; import { FaRobot } from 'react-icons/fa'; -import styles from './index.module.scss'; +import { DOCS_URL } from '../../../next.constants.mjs'; import type { FC } from 'react'; +import styles from './index.module.scss'; + type JsonLinkProps = { fileName: string; version: string; @@ -10,9 +12,7 @@ type JsonLinkProps = { const JsonLink: FC = ({ fileName, version }) => (
- + diff --git a/components/Docs/NodeApiVersionLinks.tsx b/components/Docs/NodeApiVersionLinks.tsx index f3185f5fd1ee8..2f28474c6a295 100644 --- a/components/Docs/NodeApiVersionLinks.tsx +++ b/components/Docs/NodeApiVersionLinks.tsx @@ -1,62 +1,64 @@ +import { DOCS_URL } from '../../next.constants.mjs'; + // Note.: This is a temporary Component used only until the transition to `nodejs/nodejs.dev` content is done const NodeApiVersionLinks = () => ( ); diff --git a/components/Downloads/PrimaryDownloadMatrix.tsx b/components/Downloads/PrimaryDownloadMatrix.tsx index 46e16d4dd2a44..4857b0165635e 100644 --- a/components/Downloads/PrimaryDownloadMatrix.tsx +++ b/components/Downloads/PrimaryDownloadMatrix.tsx @@ -3,6 +3,7 @@ import semVer from 'semver'; import LocalizedLink from '../LocalizedLink'; import { useDetectOS } from '../../hooks/useDetectOS'; import { useLayoutContext } from '../../hooks/useLayoutContext'; +import { DIST_URL } from '../../next.constants.mjs'; import type { LegacyDownloadsFrontMatter, NodeRelease } from '../../types'; import type { FC } from 'react'; @@ -58,7 +59,7 @@ const PrimaryDownloadMatrix: FC = ({