Skip to content

Commit

Permalink
Versions page fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bbazukun123 committed Dec 18, 2023
1 parent 150eeeb commit 512aafe
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions src/pages/versions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ export default function Version(): JSX.Element
{
// TODO: Make it an adaptive version listing instead
const versions = Versions as IVersion[];
const latestVersion: IVersion = versions[0].prerelease ? versions[1] : versions[0];
const latestVersion = versions.find((version) => version.latest);
const preReleaseVersion = versions.find((version) => version.prerelease);
const pastVersions = versions.slice(1);
const pastVersions = versions.filter((version) => !version.latest && !version.prerelease);

return (
<Layout title="Versions" description="PixiJS Versions page listing all API documentation versions">
Expand All @@ -42,39 +42,6 @@ export default function Version(): JSX.Element
<Translate id="versionsPage.title">PixiJS API documentation versions</Translate>
</Heading>

<div className="margin-bottom--lg">
<Heading as="h3" id="next">
<Translate id="versionsPage.current.title">Current version (Stable)</Translate>
</Heading>
<p>
<Translate id="versionsPage.current.description">
Here you can find the documentation for current released version.
</Translate>
</p>
<table>
<tbody>
<tr>
<th>{latestVersion.version}</th>
<td>
<Link to={latestVersion.docs}>
<DocumentationLabel />
</Link>
</td>
<td>
<Link to={latestVersion.build}>
<BuildLabel />
</Link>
</td>
<td>
<Link to={latestVersion.releaseNotes}>
<ReleaseNotesLabel />
</Link>
</td>
</tr>
</tbody>
</table>
</div>

{preReleaseVersion && (
<div className="margin-bottom--lg">
<Heading as="h3" id="latest">
Expand Down Expand Up @@ -105,6 +72,41 @@ export default function Version(): JSX.Element
</div>
)}

{latestVersion && (
<div className="margin-bottom--lg">
<Heading as="h3" id="next">
<Translate id="versionsPage.current.title">Current version (Stable)</Translate>
</Heading>
<p>
<Translate id="versionsPage.current.description">
Here you can find the documentation for current released version.
</Translate>
</p>
<table>
<tbody>
<tr>
<th>{latestVersion.version}</th>
<td>
<Link to={latestVersion.docs}>
<DocumentationLabel />
</Link>
</td>
<td>
<Link to={latestVersion.build}>
<BuildLabel />
</Link>
</td>
<td>
<Link to={latestVersion.releaseNotes}>
<ReleaseNotesLabel />
</Link>
</td>
</tr>
</tbody>
</table>
</div>
)}

{pastVersions.length > 0 && (
<div className="margin-bottom--lg">
<Heading as="h3" id="archive">
Expand Down

0 comments on commit 512aafe

Please sign in to comment.