From 2bcf50daa24aa64d61db7de73673247da374aff5 Mon Sep 17 00:00:00 2001 From: Claudio W Date: Thu, 14 Mar 2024 04:59:38 +0100 Subject: [PATCH] feat: npm link to npm version (#6472) * feat: npm link to npm version * Update NpmLink.tsx Co-authored-by: Caner Akdas Signed-off-by: Claudio W * chore: fix stuff * Update next.mdx.use.mjs Signed-off-by: Brian Muenzenmeyer --------- Signed-off-by: Claudio W Signed-off-by: Brian Muenzenmeyer Co-authored-by: Caner Akdas Co-authored-by: Brian Muenzenmeyer --- components/Downloads/Release/NpmLink.tsx | 19 +++++++++++++++++++ components/Downloads/Release/NpmVersion.tsx | 16 ---------------- next.mdx.use.mjs | 6 +++--- pages/en/download/current.mdx | 2 +- pages/en/download/index.mdx | 2 +- pages/en/download/package-manager/current.mdx | 2 +- pages/en/download/package-manager/index.mdx | 2 +- .../en/download/prebuilt-binaries/current.mdx | 2 +- pages/en/download/prebuilt-binaries/index.mdx | 2 +- pages/en/download/source-code/current.mdx | 2 +- pages/en/download/source-code/index.mdx | 2 +- 11 files changed, 30 insertions(+), 27 deletions(-) create mode 100644 components/Downloads/Release/NpmLink.tsx delete mode 100644 components/Downloads/Release/NpmVersion.tsx diff --git a/components/Downloads/Release/NpmLink.tsx b/components/Downloads/Release/NpmLink.tsx new file mode 100644 index 0000000000000..543452ae162f5 --- /dev/null +++ b/components/Downloads/Release/NpmLink.tsx @@ -0,0 +1,19 @@ +'use client'; + +import { useContext } from 'react'; +import type { FC } from 'react'; + +import LinkWithArrow from '@/components/Downloads/Release/LinkWithArrow'; +import { ReleaseContext } from '@/providers/releaseProvider'; + +const NpmLink: FC = () => { + const { release } = useContext(ReleaseContext); + + return ( + + npm ({release.npm}) + + ); +}; + +export default NpmLink; diff --git a/components/Downloads/Release/NpmVersion.tsx b/components/Downloads/Release/NpmVersion.tsx deleted file mode 100644 index c4070563874e8..0000000000000 --- a/components/Downloads/Release/NpmVersion.tsx +++ /dev/null @@ -1,16 +0,0 @@ -'use client'; - -import { useContext } from 'react'; -import type { FC } from 'react'; - -import { ReleaseContext } from '@/providers/releaseProvider'; - -const NpmVersion: FC = () => { - const { - release: { npm }, - } = useContext(ReleaseContext); - - return <>{npm}; -}; - -export default NpmVersion; diff --git a/next.mdx.use.mjs b/next.mdx.use.mjs index 44581728dd13c..cc27b12efffbd 100644 --- a/next.mdx.use.mjs +++ b/next.mdx.use.mjs @@ -9,7 +9,7 @@ import BitnessDropdown from './components/Downloads/Release/BitnessDropdown'; import BlogPostLink from './components/Downloads/Release/BlogPostLink'; import ReleaseDownloadButton from './components/Downloads/Release/DownloadButton'; import LinkWithArrow from './components/Downloads/Release/LinkWithArrow'; -import NpmVersion from './components/Downloads/Release/NpmVersion'; +import NpmLink from './components/Downloads/Release/NpmLink'; import OperatingSystemDropdown from './components/Downloads/Release/OperatingSystemDropdown'; import PlatformDropdown from './components/Downloads/Release/PlatformDropdown'; import ReleaseCodeBox from './components/Downloads/Release/ReleaseCodeBox'; @@ -66,8 +66,8 @@ export const mdxComponents = { BitnessDropdown: BitnessDropdown, // Renders a drop-down menu from which the operating system can select OperatingSystemDropdown: OperatingSystemDropdown, - // Renders a npm version of the selected release - NpmVersion: NpmVersion, + // Renders a link to the npm version of the selected release + NpmLink: NpmLink, // Renders a release version of the selected release Version: ReleaseVersion, // Renders a release status of the selected release diff --git a/pages/en/download/current.mdx b/pages/en/download/current.mdx index 982ed2674b5d4..637327b30099e 100644 --- a/pages/en/download/current.mdx +++ b/pages/en/download/current.mdx @@ -11,7 +11,7 @@ I want the version of Node.js for
-Node.js includes npm (). +Node.js includes . Read the blog post for this version diff --git a/pages/en/download/index.mdx b/pages/en/download/index.mdx index 982ed2674b5d4..637327b30099e 100644 --- a/pages/en/download/index.mdx +++ b/pages/en/download/index.mdx @@ -11,7 +11,7 @@ I want the version of Node.js for
-Node.js includes npm (). +Node.js includes . Read the blog post for this version diff --git a/pages/en/download/package-manager/current.mdx b/pages/en/download/package-manager/current.mdx index 3081cc9bba167..7b970af146d64 100644 --- a/pages/en/download/package-manager/current.mdx +++ b/pages/en/download/package-manager/current.mdx @@ -11,7 +11,7 @@ Install Node.js on
-Node.js includes npm (). +Node.js includes . Read the blog post for this version diff --git a/pages/en/download/package-manager/index.mdx b/pages/en/download/package-manager/index.mdx index 27ab5b3a8566c..87f714dffbbba 100644 --- a/pages/en/download/package-manager/index.mdx +++ b/pages/en/download/package-manager/index.mdx @@ -11,7 +11,7 @@ Install Node.js on
-Node.js includes npm (). +Node.js includes . Read the blog post for this version diff --git a/pages/en/download/prebuilt-binaries/current.mdx b/pages/en/download/prebuilt-binaries/current.mdx index 8b59a12ad31d1..c3138a51457ac 100644 --- a/pages/en/download/prebuilt-binaries/current.mdx +++ b/pages/en/download/prebuilt-binaries/current.mdx @@ -11,7 +11,7 @@ I want the version of Node.js for
-Node.js includes npm (). +Node.js includes . Read the blog post for this version diff --git a/pages/en/download/prebuilt-binaries/index.mdx b/pages/en/download/prebuilt-binaries/index.mdx index 8b59a12ad31d1..c3138a51457ac 100644 --- a/pages/en/download/prebuilt-binaries/index.mdx +++ b/pages/en/download/prebuilt-binaries/index.mdx @@ -11,7 +11,7 @@ I want the version of Node.js for
-Node.js includes npm (). +Node.js includes . Read the blog post for this version diff --git a/pages/en/download/source-code/current.mdx b/pages/en/download/source-code/current.mdx index ab48e95e5bab6..75dd8002f3a7f 100644 --- a/pages/en/download/source-code/current.mdx +++ b/pages/en/download/source-code/current.mdx @@ -11,7 +11,7 @@ I want the version of the Node.js source code.
-Node.js includes npm (). +Node.js includes . Read the blog post for this version diff --git a/pages/en/download/source-code/index.mdx b/pages/en/download/source-code/index.mdx index ab48e95e5bab6..75dd8002f3a7f 100644 --- a/pages/en/download/source-code/index.mdx +++ b/pages/en/download/source-code/index.mdx @@ -11,7 +11,7 @@ I want the version of the Node.js source code.
-Node.js includes npm (). +Node.js includes . Read the blog post for this version