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.

fix LinkCreatorInfo regression

Steven Tey2cc8717f3e34
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx
index 1e61d359f9..7c642d3ef4 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/links/[...link]/page-client.tsx
@@ -90,7 +90,7 @@ function LinkBuilder({ link }: { link: ExpandedLinkProps }) {
const router = useRouter();
const workspace = useWorkspace();
- const { isDesktop, isMobile } = useMediaQuery();
+ const { isDesktop } = useMediaQuery();
const [copied, copyToClipboard] = useCopyToClipboard();
const { control, handleSubmit, reset, getValues } =
@@ -243,8 +243,14 @@ function LinkBuilder({ link }: { link: ExpandedLinkProps }) {
</div>
)}
{/* Creator info at the bottom (desktop only) */}
- <LinkCreatorInfo link={link} className="hidden lg:flex" />
+ {isDesktop && <LinkCreatorInfo link={link} />}
</div>
+ {isDesktop && (
+ <>
+ <div className="grow" />
+ <LinkActionBar />
+ </>
+ )}
</div>
<div className="px-4 md:px-6 lg:bg-neutral-50 lg:px-0">
<div className="mx-auto max-w-xl divide-neutral-200 lg:divide-y">
@@ -257,8 +263,7 @@ function LinkBuilder({ link }: { link: ExpandedLinkProps }) {
<div className="py-4 lg:px-4 lg:py-6">
<LinkPreview />
</div>
- {/* Creator info below preview (mobile only) */}
- <LinkCreatorInfo link={link} className="pb-8 lg:hidden" />
+ {!isDesktop && <LinkCreatorInfo link={link} />}
</div>
</div>
{!isDesktop && (
diff --git a/apps/web/ui/links/link-builder/link-creator-info.tsx b/apps/web/ui/links/link-builder/link-creator-info.tsx
index 64efd4b0fd..6c6012bb4a 100644
--- a/apps/web/ui/links/link-builder/link-creator-info.tsx
+++ b/apps/web/ui/links/link-builder/link-creator-info.tsx
@@ -1,7 +1,7 @@
import { ExpandedLinkProps } from "@/lib/types";
import { UserAvatar } from "@/ui/links/link-title-column";
import { Tooltip } from "@dub/ui";
-import { cn, formatDateTime, timeAgo } from "@dub/utils";
+import { formatDateTime, timeAgo } from "@dub/utils";
import Link from "next/link";
import { useParams } from "next/navigation";
@@ -10,18 +10,13 @@ interface LinkCreatorInfoProps {
className?: string;
}
-export function LinkCreatorInfo({ link, className }: LinkCreatorInfoProps) {
+export function LinkCreatorInfo({ link }: { link: ExpandedLinkProps }) {
const { slug } = useParams();
if (!link.user) return null;
return (
- <div
- className={cn(
- "mt-2 flex items-center gap-1 border-t border-neutral-200 pt-6 text-sm text-neutral-600",
- className,
- )}
- >
+ <div className="flex items-center gap-1 border-t border-neutral-200 py-8 text-sm text-neutral-600">
<UserAvatar user={link.user} />
<span>Created by</span>
<Link