Skip to content

Commit 6d870a7

Browse files
committed
cleanup: Change home page column ordering and version labels
1 parent 98cc961 commit 6d870a7

File tree

1 file changed

+4
-15
lines changed

1 file changed

+4
-15
lines changed

frontend/routes/index.tsx

+4-15
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { path } from "../utils/api.ts";
55
import type { Package, PackageVersion, Stats } from "../utils/api_types.ts";
66
import type { PanelEntry } from "../components/ListPanel.tsx";
77
import { ListPanel } from "../components/ListPanel.tsx";
8-
import twas from "$twas";
98
import { Head } from "$fresh/runtime.ts";
109
import { ComponentChildren } from "preact";
1110

@@ -23,14 +22,14 @@ export default function Home({ data }: PageProps<Data>) {
2322
</Head>
2423

2524
<div class="grid grid-cols-1 gap-8 lg:grid-cols-3 md:gap-14">
26-
<ListPanel title="New Packages">
27-
{data.stats.newest.map(PackageToPanelEntry)}
25+
<ListPanel title="Featured Packages">
26+
{data.stats.featured.map(PackageToPanelEntry)}
2827
</ListPanel>
2928
<ListPanel title="Recent updates">
3029
{data.stats.updated.map(PackageVersionToPanelEntry)}
3130
</ListPanel>
32-
<ListPanel title="Featured Packages">
33-
{data.stats.featured.map(PackageToPanelEntryNoLabel)}
31+
<ListPanel title="New Packages">
32+
{data.stats.newest.map(PackageToPanelEntry)}
3433
</ListPanel>
3534
</div>
3635

@@ -184,16 +183,6 @@ function BenefitText({ children }: { children: ComponentChildren }) {
184183

185184
function PackageToPanelEntry(
186185
entry: Package,
187-
): PanelEntry {
188-
return {
189-
value: `@${entry.scope}/${entry.name}`,
190-
href: `/@${entry.scope}/${entry.name}`,
191-
label: twas(new Date(entry.createdAt)),
192-
};
193-
}
194-
195-
function PackageToPanelEntryNoLabel(
196-
entry: Package,
197186
): PanelEntry {
198187
return {
199188
value: `@${entry.scope}/${entry.name}`,

0 commit comments

Comments
 (0)