Skip to content

Commit d241894

Browse files
committed
refactor: minor text and styling updates
1 parent 1c8abdd commit d241894

File tree

4 files changed

+26
-18
lines changed

4 files changed

+26
-18
lines changed

apps/site/components/Downloads/Release/ReleaseCodeBox.tsx

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { useContext, useMemo } from 'react';
1010
import CodeBox from '#site/components/Common/CodeBox';
1111
import Link from '#site/components/Link';
1212
import LinkWithArrow from '#site/components/LinkWithArrow';
13+
import WithReleaseAlertBox from '#site/components/withReleaseAlertBox';
1314
import { createSval } from '#site/next.jsx.compiler.mjs';
1415
import {
1516
ReleaseContext,
@@ -114,17 +115,10 @@ const ReleaseCodeBox: FC = () => {
114115
</AlertBox>
115116
</noscript>
116117

117-
{release.status === 'End-of-life' && (
118-
<AlertBox
119-
title={t('components.common.alertBox.warning')}
120-
level="warning"
121-
size="small"
122-
>
123-
{t.rich('layouts.download.codeBox.unsupportedVersionWarning', {
124-
link: text => <Link href="/about/previous-releases/">{text}</Link>,
125-
})}
126-
</AlertBox>
127-
)}
118+
<WithReleaseAlertBox
119+
status={release.status}
120+
link="/about/previous-releases"
121+
/>
128122

129123
{!currentPlatform || currentPlatform.recommended || (
130124
<AlertBox

apps/site/components/withReleaseAlertBox.tsx

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,38 @@ import AlertBox from '@node-core/ui-components/Common/AlertBox';
22
import { useTranslations } from 'next-intl';
33
import type { FC } from 'react';
44

5+
import Link from '#site/components/Link';
56
import type { NodeReleaseStatus } from '#site/types';
67

78
type WithReleaseAlertBoxProps = {
89
status: NodeReleaseStatus;
10+
link?: string;
911
};
1012

11-
const WithReleaseAlertBox: FC<WithReleaseAlertBoxProps> = ({ status }) => {
13+
const WithReleaseAlertBox: FC<WithReleaseAlertBoxProps> = ({
14+
status,
15+
link,
16+
}) => {
1217
const t = useTranslations();
1318

19+
const getAlertContent = () => {
20+
if (link) {
21+
return t.rich('layouts.download.codeBox.unsupportedVersionWarning', {
22+
link: text => <Link href={link}>{text}</Link>,
23+
});
24+
}
25+
26+
return t('components.releaseModal.unsupportedVersionWarning');
27+
};
28+
1429
switch (status) {
1530
case 'End-of-life':
1631
return (
1732
<AlertBox
1833
title={t('components.common.alertBox.warning')}
1934
level="warning"
20-
size="small"
2135
>
22-
{t('components.releaseModal.unsupportedVersionWarning')}
36+
{getAlertContent()}
2337
</AlertBox>
2438
);
2539
default:

apps/site/pages/en/download/archive.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ layout: download-archive
66
<WithDownloadArchive>
77
{({ binaries, installers, version, release, sources, navigation }) => (
88
<>
9-
<h1>Node.js Download Archive</h1>
9+
<h1>Node.js® Download Archive</h1>
1010

1111
<h2 className="flex items-center gap-2">
1212
<img
@@ -19,11 +19,11 @@ layout: download-archive
1919
{release.codename && ` (${release.codename})`}
2020
</h2>
2121

22-
<WithReleaseAlertBox status={release.status} />
22+
<WithReleaseAlertBox status={release.status} link="/about/previous-releases" />
2323

2424
<ReleaseOverview release={release} />
2525

26-
<ul>
26+
<ul className='flex list-none flex-col gap-2 p-0 text-sm'>
2727

2828
<li>
2929
Learn more about <Link href="/about/previous-releases">Node.js releases</Link>, including the release schedule and LTS status.

apps/site/pages/en/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ layout: home
2929
{({ release }) => (
3030
<small>
3131
Want new features sooner?
32-
Get <b>Node.js <DownloadLink release={release}>{release.versionWithPrefix}</DownloadLink></b>
32+
Get <b>Node.js <Link href="/download/current">{release.versionWithPrefix}</Link></b>
3333
<sup title="Downloads a Node.js installer for your current platform">1</sup> instead.
3434
</small>
3535
)}

0 commit comments

Comments
 (0)