Skip to content

Commit 5fbcca6

Browse files
committed
feat: implement the /browse page with alphabetic browsing
1 parent 9a6061b commit 5fbcca6

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

src/pages/browse/index.astro

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
import { getCollection } from "astro:content";
3+
import { ALPHABETS } from "../../../constants.js";
4+
import BaseLayout from "../../layouts/base.astro";
5+
import Navbar from "../../components/navbar.astro";
6+
import Search from "../../components/islands/search.jsx";
7+
8+
const dictionary = await getCollection("dictionary");
9+
---
10+
11+
<BaseLayout
12+
pageTitle="Browse Words"
13+
class="min-h-screen"
14+
>
15+
<Navbar>
16+
<Search triggerSize="sm" dictionary={dictionary} client:load />
17+
</Navbar>
18+
19+
<main class="max-w-screen-lg p-5 md:mt-10 mx-auto space-y-6">
20+
<h2 class="text-3xl md:text-5xl font-black">
21+
Browse Alphabetically
22+
</h2>
23+
<div class="flex flex-wrap gap-3">
24+
{ALPHABETS.map(alpha => (
25+
<a
26+
href={`/browse/${alpha}/1`}
27+
class="no-underline flex h-16 w-16 md:h-20 md:w-20 bg-gray-100 hover:bg-black hover:text-white rounded md:text-lg transition-colors ease-in-out"
28+
>
29+
<span class="m-auto">{ alpha.toUpperCase() }</span>
30+
</a>
31+
))}
32+
</div>
33+
</main>
34+
</BaseLayout>

0 commit comments

Comments
 (0)