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.

added some CTAs

Steven Teyf13cf3f116d4
diff --git a/components/app/links/link-card.tsx b/components/app/links/link-card.tsx
index cd78294e8d..f71fa3f8df 100644
--- a/components/app/links/link-card.tsx
+++ b/components/app/links/link-card.tsx
@@ -28,7 +28,7 @@ import { Archive, CopyPlus, Edit3, Tag } from "lucide-react";
import punycode from "punycode/";
import { GOOGLE_FAVICON_URL } from "@/lib/constants";
import useTags from "@/lib/swr/use-tags";
-import Badge from "@/components/shared/badge";
+import TagBadge from "@/components/app/links/tag-badge";
export default function LinkCard({ props }: { props: LinkProps }) {
const { key, domain, url, createdAt, archived, tagId } = props;
@@ -268,7 +268,7 @@ export default function LinkCard({ props }: { props: LinkProps }) {
onClick={() => setShowTagLinkModal(true)}
className="hidden transition-all duration-75 hover:scale-105 active:scale-100 sm:block"
>
- <Badge {...tag} withIcon />
+ <TagBadge {...tag} withIcon />
</button>
)}
</div>
diff --git a/components/app/links/link-filters.tsx b/components/app/links/link-filters.tsx
index 96b8bd9757..89dd2d03a3 100644
--- a/components/app/links/link-filters.tsx
+++ b/components/app/links/link-filters.tsx
@@ -22,7 +22,7 @@ import { useSession } from "next-auth/react";
import { toast } from "sonner";
import { ModalContext } from "#/ui/modal-provider";
import useTags from "@/lib/swr/use-tags";
-import Badge from "@/components/shared/badge";
+import TagBadge from "@/components/app/links/tag-badge";
import { TagProps } from "@/lib/types";
export default function LinkFilters() {
@@ -236,7 +236,7 @@ const TagsFilter = ({
}) => {
const router = useRouter();
const { slug } = router.query as { slug?: string };
- const [collapsed, setCollapsed] = useState(false);
+ const [collapsed, setCollapsed] = useState(tags.length === 0 ? true : false);
const [search, setSearch] = useState("");
const [showMore, setShowMore] = useState(false);
@@ -282,6 +282,9 @@ const TagsFilter = ({
className={`${collapsed ? "" : "rotate-90"} h-5 w-5 transition-all`}
/>
<h4 className="font-medium text-gray-900">Tags</h4>
+ <span className="-mt-3 rounded-full border border-blue-500 bg-blue-500 px-2 py-0.5 text-xs font-medium text-white">
+ New
+ </span>
</button>
<button
onClick={addTag}
@@ -348,7 +351,7 @@ const TagsFilter = ({
htmlFor={id}
className="flex w-full cursor-pointer justify-between px-3 py-1.5 pl-0 text-sm font-medium text-gray-700"
>
- <Badge name={name} color={color} />
+ <TagBadge name={name} color={color} />
<p className="text-gray-500">{nFormatter(count)}</p>
</label>
</div>
diff --git a/components/shared/badge.tsx b/components/app/links/tag-badge.tsx
similarity index 97%
rename from components/shared/badge.tsx
rename to components/app/links/tag-badge.tsx
index 787941f022..d82020fac7 100644
--- a/components/shared/badge.tsx
+++ b/components/app/links/tag-badge.tsx
@@ -3,7 +3,7 @@ import { truncate } from "@/lib/utils";
import clsx from "clsx";
import { Tag } from "lucide-react";
-export default function Badge({
+export default function TagBadge({
name,
color,
withIcon,
diff --git a/components/app/modals/tag-link-modal.tsx b/components/app/modals/tag-link-modal.tsx
index 66bd007d9e..043af4db13 100644
--- a/components/app/modals/tag-link-modal.tsx
+++ b/components/app/modals/tag-link-modal.tsx
@@ -20,7 +20,7 @@ import { Check, ChevronDown, Search, Trash, X } from "lucide-react";
import { Command } from "cmdk";
import Button from "#/ui/button";
import useTags from "@/lib/swr/use-tags";
-import Badge, { COLORS_LIST } from "@/components/shared/badge";
+import TagBadge, { COLORS_LIST } from "@/components/app/links/tag-badge";
import va from "@vercel/analytics";
import { ThreeDots } from "@/components/shared/icons";
import Popover from "@/components/shared/popover";
@@ -153,7 +153,17 @@ function TagLinkModal({
height={20}
/>
<h3 className="text-lg font-medium">{type.title}</h3>
- <p className="text-sm text-gray-500">{type.description}</p>
+ <p className="text-sm text-gray-500">
+ {type.description} <br className="mt-1" />
+ <a
+ className="underline underline-offset-4 transition-colors hover:text-black"
+ href="https://dub.sh/tags"
+ target="_blank"
+ rel="noopener noreferrer"
+ >
+ Read the announcement.
+ </a>
+ </p>
</div>
<form
@@ -249,7 +259,7 @@ function TagLinkModal({
}}
className="group flex cursor-pointer items-center justify-between rounded-md px-4 py-2 text-sm text-gray-900 hover:bg-gray-100 hover:text-gray-900 active:bg-gray-200 aria-selected:bg-gray-100 aria-selected:text-gray-900"
>
- <Badge {...tag} />
+ <TagBadge {...tag} />
<TagPopover key={tag.id} tag={tag} />
</Command.Item>
))}
diff --git a/pages/api/links/[key]/tag.ts b/pages/api/links/[key]/tag.ts
index 4881160a52..2e93689e01 100644
--- a/pages/api/links/[key]/tag.ts
+++ b/pages/api/links/[key]/tag.ts
@@ -1,4 +1,4 @@
-import { randomBadgeColor } from "@/components/shared/badge";
+import { randomBadgeColor } from "@/components/app/links/tag-badge";
import { withLinksAuth } from "@/lib/auth";
import prisma from "@/lib/prisma";
diff --git a/pages/api/projects/[slug]/tags/index.ts b/pages/api/projects/[slug]/tags/index.ts
index d4288ce341..0c132e2fd3 100644
--- a/pages/api/projects/[slug]/tags/index.ts
+++ b/pages/api/projects/[slug]/tags/index.ts
@@ -1,4 +1,4 @@
-import { randomBadgeColor } from "@/components/shared/badge";
+import { randomBadgeColor } from "@/components/app/links/tag-badge";
import { withProjectAuth } from "@/lib/auth";
import prisma from "@/lib/prisma";