-
Notifications
You must be signed in to change notification settings - Fork 440
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
1 parent
4a9b333
commit 35dae18
Showing
6 changed files
with
84 additions
and
99 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 |
---|---|---|
@@ -1,32 +1,19 @@ | ||
"use client"; | ||
|
||
import { buttonVariants } from "@/components/ui/Button"; | ||
import { Plus } from "@phosphor-icons/react"; | ||
import { useAtomValue } from "jotai"; | ||
import { Plus } from "@phosphor-icons/react/dist/ssr"; | ||
import Link from "next/link"; | ||
import { isNavStuckAtom } from "../atoms"; | ||
|
||
export const CreateGuildLink = () => { | ||
const isNavStuck = useAtomValue(isNavStuckAtom); | ||
return ( | ||
<Link | ||
href="/create-guild" | ||
aria-label="Create guild" | ||
prefetch={false} | ||
className={buttonVariants({ | ||
variant: "ghost", | ||
size: "sm", | ||
className: [ | ||
// Temporarily, until we don't migrate the scrollable Tabs component | ||
"min-h-11 w-11 gap-1.5 px-0 sm:min-h-0 sm:w-auto sm:px-3", | ||
{ | ||
"text-white": !isNavStuck, | ||
}, | ||
], | ||
})} | ||
> | ||
<Plus /> | ||
<span className="hidden sm:inline-block">Create guild</span> | ||
</Link> | ||
); | ||
}; | ||
export const CreateGuildLink = () => ( | ||
<Link | ||
href="/create-guild" | ||
aria-label="Create guild" | ||
prefetch={false} | ||
className={buttonVariants({ | ||
variant: "ghost", | ||
size: "sm", | ||
className: "min-h-11 w-11 gap-1.5 px-0 sm:min-h-0 sm:w-auto sm:px-3", | ||
})} | ||
> | ||
<Plus /> | ||
<span className="hidden sm:inline-block">Create guild</span> | ||
</Link> | ||
); |
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,66 @@ | ||
import { Badge } from "@/components/ui/Badge"; | ||
import { Card } from "@/components/ui/Card"; | ||
import { Skeleton } from "@/components/ui/Skeleton"; | ||
import { ImageSquare, Users } from "@phosphor-icons/react/dist/ssr"; | ||
import { Avatar, AvatarFallback, AvatarImage } from "@radix-ui/react-avatar"; | ||
import Link from "next/link"; | ||
import type { FunctionComponent } from "react"; | ||
|
||
export const GuildCard: FunctionComponent<{ guild: Guild }> = ({ guild }) => { | ||
return ( | ||
<Link | ||
href={`/${guild.urlName}`} | ||
className="relative rounded-2xl outline-none focus-visible:ring-4" | ||
> | ||
<Card className="relative grid grid-cols-[theme(space.12)_1fr] grid-rows-2 items-center gap-x-4 gap-y-0.5 overflow-hidden rounded-2xl px-6 py-7 shadow-md before:absolute before:inset-0 before:bg-black/5 before:opacity-0 before:transition-opacity before:duration-200 before:content-[''] hover:before:opacity-55 active:before:opacity-85 dark:before:bg-white/5"> | ||
<Avatar className="row-span-2 grid size-12 place-items-center overflow-hidden rounded-full bg-image text-white"> | ||
<AvatarImage | ||
src={ | ||
!!guild.imageUrl && !guild.imageUrl.startsWith("/guildLogos") | ||
? guild.imageUrl | ||
: undefined | ||
} | ||
className="size-full" | ||
alt="guild avatar" | ||
/> | ||
<AvatarFallback> | ||
<ImageSquare weight="duotone" className="size-6" /> | ||
</AvatarFallback> | ||
</Avatar> | ||
|
||
<h3 className="line-clamp-1 font-black font-display text-lg"> | ||
{guild.name} | ||
</h3> | ||
<div className="flex flex-wrap gap-1"> | ||
<Badge> | ||
<Users className="size-4" /> | ||
<span> | ||
{new Intl.NumberFormat("en", { | ||
notation: "compact", | ||
}).format(12345)} | ||
</span> | ||
</Badge> | ||
|
||
<Badge>5 groups</Badge> | ||
</div> | ||
</Card> | ||
</Link> | ||
); | ||
}; | ||
|
||
export const GuildCardSkeleton = () => { | ||
return ( | ||
<div className="grid grid-cols-[theme(space.14)_1fr] items-center gap-4 rounded-2xl bg-card px-5 py-6 shadow-md"> | ||
<Skeleton className="size-14 rounded-full" /> | ||
|
||
<div className="grid gap-1.5"> | ||
<Skeleton className="h-6 w-3/4" /> | ||
|
||
<div className="flex flex-wrap gap-1"> | ||
<Skeleton className="h-6 w-16" /> | ||
<Skeleton className="h-6 w-16" /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
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 was deleted.
Oops, something went wrong.