Skip to content

Commit 6e1ccf7

Browse files
committed
feat: add contribution cta to alphabetic route with no words
1 parent 60c4ff8 commit 6e1ccf7

1 file changed

Lines changed: 27 additions & 2 deletions

File tree

src/pages/browse/[alpha]/[page].astro

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export async function getStaticPaths({ paginate }) {
4141

4242
<!-- Words List -->
4343
<div>
44-
{page.data.map(word => (
44+
{page.data.length ? page.data.map(word => (
4545
<a href={`/browse/${word.slug}`}
4646
class="flex items-center md:text-lg justify-between no-underline w-full p-4 even:bg-gray-100 hover:bg-gray-100/50"
4747
>
@@ -50,7 +50,32 @@ export async function getStaticPaths({ paginate }) {
5050
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5"></path>
5151
</svg>
5252
</a>
53-
))}
53+
)) : (
54+
<div class="mt-10 space-y-6">
55+
<p>
56+
Looks like this alphabet is feeling a bit lonely! 🤔 Why not be the first to add a word and give it some company?
57+
</p>
58+
<section class="rounded-lg border shadow-sm">
59+
<div class="space-y-1.5 p-3 md:p-6 flex flex-col lg:flex-row lg:items-center justify-between gap-4">
60+
<div class="space-y-1">
61+
<h3 class="font-semibold tracking-tight text-2xl">Contribute Words</h3>
62+
<p class="text-sm">
63+
You can contribute new words to the jargons.dev dictionary.
64+
</p>
65+
</div>
66+
<a
67+
class="flex items-center w-fit justify-center no-underline px-4 py-2 rounded-md border border-gray-200 bg-white hover:bg-gray-100 text-sm shadow-sm hover:shadow transition-colors"
68+
href="/editor/new"
69+
>
70+
<span>Start Now</span>
71+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width={1.5} stroke="currentColor" class="w-4 h-4">
72+
<path stroke-linecap="round" stroke-linejoin="round" d="m4.5 19.5 15-15m0 0H8.25m11.25 0v11.25" />
73+
</svg>
74+
</a>
75+
</div>
76+
</section>
77+
</div>
78+
)}
5479
</div>
5580

5681
<!-- Pagination -->

0 commit comments

Comments
 (0)