-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
114 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react" | ||
|
||
import { ListSites } from "@/app/(app)/showcase/partials/list-sites" | ||
import { Header } from "@/components/header" | ||
import { siteConfig } from "@/resources/config/site" | ||
import type { Metadata } from "next" | ||
import { Container } from "ui" | ||
|
||
export const metadata: Metadata = { | ||
title: "Showcase", | ||
description: "A showcase of justd components, tools, and more.", | ||
metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL ?? siteConfig.url), | ||
applicationName: siteConfig.name | ||
} | ||
|
||
export default async function Page() { | ||
const res = await fetch( | ||
"https://raw.githubusercontent.com/justdlabs/showcase/refs/heads/main/sites.json" | ||
) | ||
const sites = await res.json() | ||
return ( | ||
<> | ||
<Header> | ||
Show | ||
<span className="text-muted-fg">case</span> | ||
</Header> | ||
<Container className="py-4 sm:py-16"> | ||
<ListSites sites={sites} /> | ||
</Container> | ||
</> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
"use client" | ||
|
||
import * as React from "react" | ||
|
||
import { getSiteName } from "@/resources/lib/utils" | ||
import { Collection, ListBox as Primitive, ListBoxItem, Section, Text } from "react-aria-components" | ||
import { Avatar } from "ui" | ||
|
||
interface Props { | ||
sites: { | ||
name: string | ||
url: string | ||
}[] | ||
} | ||
|
||
export function ListSites({ sites }: Props) { | ||
return ( | ||
<Primitive aria-label="Showcase"> | ||
<Section className="grid lg:grid-cols-4 sm:grid-cols-2 gap-4 lg:gap-6"> | ||
<Collection items={sites}> | ||
{(item) => { | ||
return ( | ||
<ListBoxItem | ||
target="_blank" | ||
className="flex items-center focus:outline-none focus-visible:ring-1 focus-visible:ring-ring gap-x-3 bg-secondary/70 hover:bg-secondary transition ring-1 ring-border rounded-lg px-3 py-2.5" | ||
textValue={item.name} | ||
href={item.url} | ||
id={getSiteName(item.url)} | ||
> | ||
<Avatar | ||
size="medium" | ||
shape="square" | ||
src={`https://favicon.im/${item.url}`} | ||
alt="irsyad.co favicon (large)" | ||
/> | ||
<div className="flex flex-col gap-y-0.5"> | ||
<Text slot="label" className="font-medium lg:text-sm"> | ||
{item.name} | ||
</Text> | ||
<Text slot="description" className="text-muted-fg text-xs"> | ||
{item.url} | ||
</Text> | ||
</div> | ||
</ListBoxItem> | ||
) | ||
}} | ||
</Collection> | ||
</Section> | ||
</Primitive> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters