Skip to content

Commit 2eaa893

Browse files
committed
fix: scroll and archive artifacts
1 parent 7186a9b commit 2eaa893

File tree

5 files changed

+63
-71
lines changed

5 files changed

+63
-71
lines changed

apps/site/components/Downloads/MinorReleasesTable/index.module.css

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,26 @@
1010
.scrollable {
1111
@apply scrollbar-thin
1212
flex
13-
snap-x
13+
max-h-[21rem]
14+
snap-y
1415
snap-mandatory
15-
overflow-x-auto;
16+
overflow-y-auto;
1617

17-
> table {
18-
@apply shrink-0
19-
snap-start;
18+
thead {
19+
@apply rounded-t-xs
20+
sticky
21+
top-px
22+
bg-white
23+
shadow-[0_-1px_0_0_var(--color-neutral-200)]
24+
dark:bg-neutral-950
25+
dark:shadow-[0_-1px_0_0_var(--color-neutral-800)];
26+
}
27+
28+
thead th {
29+
@apply last:md:w-56;
30+
}
2031

21-
thead th {
22-
@apply last:md:w-56;
23-
}
32+
tr {
33+
@apply snap-start;
2434
}
2535
}

apps/site/components/Downloads/MinorReleasesTable/index.tsx

Lines changed: 36 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { FC } from 'react';
77
import Link from '#site/components/Link';
88
import { BASE_CHANGELOG_URL } from '#site/next.constants.mjs';
99
import type { MinorVersion } from '#site/types';
10-
import { chunk } from '#site/util/arrayUtils';
1110
import { getNodeApiLink } from '#site/util/getNodeApiLink';
1211

1312
import styles from './index.module.css';
@@ -21,57 +20,45 @@ export const MinorReleasesTable: FC<MinorReleasesTableProps> = ({
2120
}) => {
2221
const t = useTranslations('components.minorReleasesTable');
2322

24-
// Chunk minor releases into groups of 8 for scrollable display.
25-
// This is to ensure that the table does not become too wide and remains user-friendly
26-
const releaseGroups = chunk(releases, 8);
27-
2823
return (
2924
<div className={styles.scrollable}>
30-
{releaseGroups.map(releases => (
31-
<table key={releases[0].version}>
32-
<thead>
33-
<tr>
34-
<th>{t('version')}</th>
35-
<th>{t('links')}</th>
36-
</tr>
37-
</thead>
38-
<tbody>
39-
{releases.map(release => (
40-
<tr key={release.version}>
41-
<td>
42-
<Link kind="neutral" href={`/download/v${release.version}`}>
43-
v{release.version}
25+
<table>
26+
<thead>
27+
<tr>
28+
<th>{t('version')}</th>
29+
<th>{t('links')}</th>
30+
</tr>
31+
</thead>
32+
<tbody>
33+
<tr />
34+
{releases.map(release => (
35+
<tr key={release.version}>
36+
<td>
37+
<Link kind="neutral" href={`/download/v${release.version}`}>
38+
v{release.version}
39+
</Link>
40+
</td>
41+
<td>
42+
<div className={styles.links}>
43+
<Link
44+
kind="neutral"
45+
href={`${BASE_CHANGELOG_URL}${release.version}`}
46+
>
47+
{t('actions.changelog')}
4448
</Link>
45-
</td>
46-
<td>
47-
<div className={styles.links}>
48-
<Link
49-
kind="neutral"
50-
href={`https://nodejs.org/download/release/v${release.version}/`}
51-
>
52-
{t('actions.release')}
53-
</Link>
54-
<Separator orientation="vertical" />
55-
<Link
56-
kind="neutral"
57-
href={`${BASE_CHANGELOG_URL}${release.version}`}
58-
>
59-
{t('actions.changelog')}
60-
</Link>
61-
<Separator orientation="vertical" />
62-
<Link
63-
kind="neutral"
64-
href={getNodeApiLink(`v${release.version}`)}
65-
>
66-
{t('actions.docs')}
67-
</Link>
68-
</div>
69-
</td>
70-
</tr>
71-
))}
72-
</tbody>
73-
</table>
74-
))}
49+
<Separator orientation="vertical" />
50+
<Link
51+
kind="neutral"
52+
href={getNodeApiLink(`v${release.version}`)}
53+
>
54+
{t('actions.docs')}
55+
</Link>
56+
</div>
57+
</td>
58+
</tr>
59+
))}
60+
</tbody>
61+
</table>
7562
</div>
7663
);
7764
};

apps/site/components/withDownloadArchive.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ const WithDownloadArchive: FC<WithDownloadArchiveProps> = async ({
3939
}
4040

4141
const majorVersions = releaseData.map(release => release.versionWithPrefix);
42-
const releaseArtifacts = buildReleaseArtifacts(release, version);
42+
const releaseArtifacts = buildReleaseArtifacts(
43+
release,
44+
version === 'archive' ? release.versionWithPrefix : version
45+
);
4346

4447
return <Component {...releaseArtifacts} majorVersions={majorVersions} />;
4548
};

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ layout: download-archive
66
<WithDownloadArchive>
77
{({ binaries, installers, version, release, sources, majorVersions }) => (
88
<>
9-
<h1>Download Node.js® {version}</h1>
9+
<h1>Node.js Download Archive</h1>
10+
<h2>
11+
{version}
12+
{release.codename && ` (${release.codename})`}
13+
</h2>
1014
<ReleaseOverview release={release} />
1115
<ul>
1216
<li>

apps/site/util/arrayUtils.ts

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)