From 008047f5b9e24410154da66d4850b4cd9f2090cc Mon Sep 17 00:00:00 2001 From: BrickheadJohnny Date: Tue, 26 Nov 2024 17:02:07 +0100 Subject: [PATCH] feat: GuildImage component --- src/app/(dashboard)/[guildId]/layout.tsx | 76 +++++++++---------- .../explorer/components/GuildCard.tsx | 24 ++---- src/components/GuildImage.tsx | 30 ++++++++ 3 files changed, 74 insertions(+), 56 deletions(-) create mode 100644 src/components/GuildImage.tsx diff --git a/src/app/(dashboard)/[guildId]/layout.tsx b/src/app/(dashboard)/[guildId]/layout.tsx index 0d03fcd36c..d87df77ee5 100644 --- a/src/app/(dashboard)/[guildId]/layout.tsx +++ b/src/app/(dashboard)/[guildId]/layout.tsx @@ -1,4 +1,4 @@ -import { DashboardContainer } from "@/components/DashboardContainer"; +import { GuildImage } from "@/components/GuildImage"; import { Button } from "@/components/ui/Button"; import { ScrollArea, ScrollBar } from "@/components/ui/ScrollArea"; import { env } from "@/lib/env"; @@ -24,49 +24,45 @@ const GuildPage = async ({ const roleGroups = paginatedRoleGroup.items; return ( - -
-
-
-
-
- avatar -

- {guild.name} -

-
- +
+
+
+
+
+ +

+ {guild.name} +

-

- {guild.description} -

+
+

+ {guild.description} +

+
- -
- {roleGroups.map((rg) => ( - - ))} -
- -
- {children} -
- + +
+ {roleGroups.map((rg) => ( + + ))} +
+ +
+ {children} +
); }; diff --git a/src/app/(dashboard)/explorer/components/GuildCard.tsx b/src/app/(dashboard)/explorer/components/GuildCard.tsx index bc19365ba9..c62c7db5f1 100644 --- a/src/app/(dashboard)/explorer/components/GuildCard.tsx +++ b/src/app/(dashboard)/explorer/components/GuildCard.tsx @@ -1,9 +1,10 @@ +import { GuildImage } from "@/components/GuildImage"; import { Badge } from "@/components/ui/Badge"; import { Card } from "@/components/ui/Card"; import { Skeleton } from "@/components/ui/Skeleton"; import type { Guild } from "@/lib/schemas/guild"; -import { ImageSquare, Users } from "@phosphor-icons/react/dist/ssr"; -import { Avatar, AvatarFallback, AvatarImage } from "@radix-ui/react-avatar"; +import { Users } from "@phosphor-icons/react/dist/ssr"; + import Link from "next/link"; import type { FunctionComponent } from "react"; @@ -14,20 +15,11 @@ export const GuildCard: FunctionComponent<{ guild: Guild }> = ({ guild }) => { className="relative rounded-2xl outline-none focus-visible:ring-4" > - - - - - - +

{guild.name} diff --git a/src/components/GuildImage.tsx b/src/components/GuildImage.tsx new file mode 100644 index 0000000000..3ee8f5e1d3 --- /dev/null +++ b/src/components/GuildImage.tsx @@ -0,0 +1,30 @@ +import { cn } from "@/lib/cssUtils"; +import type { Guild } from "@/lib/schemas/guild"; +import { ImageSquare } from "@phosphor-icons/react/dist/ssr"; +import { Avatar, AvatarFallback, AvatarImage } from "@radix-ui/react-avatar"; + +type Props = { + className?: string; + name: Guild["name"]; + imageUrl: Guild["imageUrl"]; +}; + +export const GuildImage = ({ name, imageUrl, className }: Props) => ( + + + + + + +);