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.

Panel toggle + truncation improvements

Tim Wilsone90404452fb0
diff --git a/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx b/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx
index c6eeea5d40..6d24137d18 100644
--- a/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx
+++ b/apps/web/app/(ee)/partners.dub.co/(dashboard)/messages/[programSlug]/page-client.tsx
@@ -98,24 +98,30 @@ export function PartnerMessagesProgramPageClient() {
>
<ChevronLeft className="size-3.5" />
</button>
- <div className="flex min-w-0 items-center gap-3">
- {!program ? (
- <>
- <div className="size-8 animate-pulse rounded-full bg-neutral-200" />
- <div className="h-8 w-36 animate-pulse rounded-md bg-neutral-200" />
- </>
- ) : (
- <>
- <img
- src={program?.logo || "https://assets.dub.co/logo.png"}
- alt={`${program?.name} logo`}
- className="size-8 shrink-0 rounded-full"
- />
- <h2 className="text-content-emphasis min-w-0 truncate text-lg font-semibold leading-7">
- {program?.name ?? "Program"}
- </h2>
- </>
- )}
+ <div className="min-w-0">
+ <button
+ type="button"
+ onClick={() => setIsRightPanelOpen((o) => !o)}
+ className="-mx-2 -my-1 flex min-w-0 max-w-full items-center gap-3 rounded-lg px-2 py-1 transition-colors duration-100 hover:bg-black/5 active:bg-black/10"
+ >
+ {!program ? (
+ <>
+ <div className="size-8 animate-pulse rounded-full bg-neutral-200" />
+ <div className="h-8 w-36 animate-pulse rounded-md bg-neutral-200" />
+ </>
+ ) : (
+ <>
+ <img
+ src={program?.logo || "https://assets.dub.co/logo.png"}
+ alt={`${program?.name} logo`}
+ className="size-8 shrink-0 rounded-full"
+ />
+ <h2 className="text-content-emphasis min-w-0 truncate text-lg font-semibold leading-7">
+ {program?.name ?? "Program"}
+ </h2>
+ </>
+ )}
+ </button>
</div>
</div>
<ToggleSidePanelButton
@@ -314,7 +320,7 @@ function ProgramInfoPanel({
className="size-12 rounded-full"
/>
<div>
- <span className="text-content-emphasis block text-lg font-semibold">
+ <span className="text-content-emphasis block truncate text-lg font-semibold">
{program.name}
</span>
<span className="text-content-subtle text-sm font-medium">
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx
index bdbf1201b9..f7d6419771 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/messages/[partnerId]/page-client.tsx
@@ -91,7 +91,7 @@ export function ProgramMessagesPartnerPageClient() {
<button
type="button"
onClick={() => setIsRightPanelOpen((o) => !o)}
- className="-mx-2 -my-1 flex min-w-0 items-center gap-3 rounded-lg px-2 py-1 transition-colors duration-100 hover:bg-black/5 active:bg-black/10"
+ className="-mx-2 -my-1 flex min-w-0 max-w-full items-center gap-3 rounded-lg px-2 py-1 transition-colors duration-100 hover:bg-black/5 active:bg-black/10"
>
{!partner ? (
<>
diff --git a/apps/web/ui/messages/messages-list.tsx b/apps/web/ui/messages/messages-list.tsx
index 93762834a0..27b2637039 100644
--- a/apps/web/ui/messages/messages-list.tsx
+++ b/apps/web/ui/messages/messages-list.tsx
@@ -48,11 +48,11 @@ export function MessagesList({
</div>
<div className="min-w-0 grow">
<div className="flex items-center justify-between gap-2">
- <span className="text-content-emphasis text-sm font-semibold">
+ <span className="text-content-emphasis min-w-0 truncate text-sm font-semibold">
{group.name}
</span>
{lastMessage && (
- <span className="text-content-subtle text-xs font-medium">
+ <span className="text-content-subtle whitespace-nowrap text-xs font-medium">
{timeAgo(lastMessage.createdAt, { withAgo: true })}
</span>
)}