Skip to content

Commit 571db29

Browse files
committed
try something
1 parent 92edbeb commit 571db29

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

apps/site/components/withDownloadArchive.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@ import type { FC } from 'react';
33

44
import { getClientContext } from '#site/client-context';
55
import provideReleaseData from '#site/next-data/providers/releaseData';
6+
import type { NodeRelease } from '#site/types';
67
import {
78
buildReleaseArtifacts,
89
extractVersionFromPath,
910
} from '#site/util/download/archive';
1011

11-
type DownloadArchive = ReturnType<typeof buildReleaseArtifacts>;
12+
type DownloadArchive = ReturnType<typeof buildReleaseArtifacts> & {
13+
releases: Array<NodeRelease>;
14+
};
1215

1316
type WithDownloadArchiveProps = {
1417
children: FC<DownloadArchive>;
@@ -39,7 +42,7 @@ const WithDownloadArchive: FC<WithDownloadArchiveProps> = async ({
3942

4043
const releaseArtifacts = buildReleaseArtifacts(release, version);
4144

42-
return <Component {...releaseArtifacts} />;
45+
return <Component {...releaseArtifacts} releases={releaseData} />;
4346
};
4447

4548
export default WithDownloadArchive;

apps/site/components/withNodeRelease.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use server';
2+
13
import type { FC } from 'react';
24

35
import provideReleaseData from '#site/next-data/providers/releaseData';

apps/site/components/withReleaseSelect.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,16 @@ const groupReleasesByStatus = (releases: Array<NodeRelease>) => {
4040
type WithReleaseSelectProps = Omit<
4141
ComponentProps<typeof WithNoScriptSelect>,
4242
'values' | 'as' | 'onChange'
43-
>;
43+
> & {
44+
releases: Array<NodeRelease>;
45+
};
4446

45-
const WithReleaseSelect: FC<WithReleaseSelectProps> = ({ ...props }) => {
46-
// const releaseData = provideReleaseData();
47+
const WithReleaseSelect: FC<WithReleaseSelectProps> = ({
48+
releases,
49+
...props
50+
}) => {
51+
const navigation = groupReleasesByStatus(releases);
4752
const { push } = useRouter();
48-
const navigation = groupReleasesByStatus([]); // fix later
4953

5054
return (
5155
<WithNoScriptSelect

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ layout: download-archive
44
---
55

66
<WithDownloadArchive>
7-
{({ binaries, installers, version, release, sources }) => (
7+
{({ releases, binaries, installers, version, release, sources }) => (
88
<>
99
<h1>Node.js® Download Archive</h1>
1010

@@ -42,7 +42,7 @@ layout: download-archive
4242
</ul>
4343

4444
<h2>Other releases</h2>
45-
<WithReleaseSelect placeholder={version} defaultValue={`/download/archive/${version}`} className="w-64"/>
45+
<WithReleaseSelect releases={releases} placeholder={version} defaultValue={`/download/archive/${version}`} className="w-64"/>
4646

4747
<h2>Binary Downloads</h2>
4848
<DownloadsTable source={binaries} />

0 commit comments

Comments
 (0)