Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

Update tag cards

Tim Wilson984a10096976
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card-placeholder.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card-placeholder.tsx
index 91a3f68493..12123dfaf7 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card-placeholder.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card-placeholder.tsx
@@ -3,9 +3,15 @@ import { CardList } from "@dub/ui";
export function TagCardPlaceholder() {
return (
<CardList.Card>
- <div className="flex h-8 grow items-center gap-5 sm:gap-8 md:gap-12">
- <div className="hidden h-5 w-32 animate-pulse rounded-md bg-gray-200 sm:block" />
- <div className="hidden h-5 w-12 animate-pulse rounded-md bg-gray-200 sm:block" />
+ <div className="flex h-8 items-center justify-between gap-5 sm:gap-8 md:gap-12">
+ <div className="flex items-center gap-3">
+ <div className="h-5 w-5 animate-pulse rounded-md bg-gray-200" />
+ <div className="h-5 w-16 animate-pulse rounded-md bg-gray-200 sm:w-32" />
+ </div>
+ <div className="flex items-center gap-5 sm:gap-8 md:gap-12">
+ <div className="h-5 w-16 animate-pulse rounded-md bg-gray-200" />
+ <div className="w-8" />
+ </div>
</div>
</CardList.Card>
);
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card.tsx
index d29da1e05f..9721ba4a9c 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/settings/tags/tag-card.tsx
@@ -2,11 +2,11 @@
import useWorkspace from "@/lib/swr/use-workspace";
import { TagProps } from "@/lib/types";
-import TagBadge from "@/ui/links/tag-badge";
+import { COLORS_LIST } from "@/ui/links/tag-badge";
import { useAddEditTagModal } from "@/ui/modals/add-edit-tag-modal";
import { Delete, ThreeDots } from "@/ui/shared/icons";
import { Button, CardList, Popover } from "@dub/ui";
-import { LoadingSpinner, PenWriting } from "@dub/ui/src/icons";
+import { LoadingSpinner, PenWriting, Tag } from "@dub/ui/src/icons";
import { cn } from "@dub/utils";
import Link from "next/link";
import { useState } from "react";
@@ -67,8 +67,21 @@ export function TagCard({
processing && "opacity-50",
)}
>
- <div className="flex min-w-0 grow items-center gap-5 sm:gap-8 md:gap-12">
- <TagBadge {...tag} withIcon primary className="min-w-0 truncate" />
+ <div className="flex min-w-0 grow items-center gap-3">
+ <div
+ className={cn(
+ "shrink-0 rounded-md p-1.5",
+ COLORS_LIST.find(({ color }) => color === tag.color)?.css,
+ )}
+ >
+ <Tag className="h-2.5 w-2.5" />
+ </div>
+ <span className="min-w-0 truncate whitespace-nowrap text-gray-800">
+ {tag.name}
+ </span>
+ </div>
+
+ <div className="flex items-center gap-5 sm:gap-8 md:gap-12">
{tagsCount !== undefined && (
<Link
href={`/${slug}?tagIds=${tag.id}`}
@@ -77,9 +90,6 @@ export function TagCard({
{linksCount || 0} link{linksCount !== 1 && "s"}
</Link>
)}
- </div>
-
- <div>
<Popover
content={
<div className="grid w-full gap-px p-2 sm:w-48">