Skip to content

Commit 66ba365

Browse files
authored
Merge pull request #2257 from dubinc/invite-partner-truncation
Invite partner sheet destination URL truncation
2 parents e0c3209 + d15d8b2 commit 66ba365

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

apps/web/app/app.dub.co/(dashboard)/[slug]/programs/[programId]/partners/invite-partner-sheet.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function InvitePartnerSheetContent({ setIsOpen }: InvitePartnerSheetProps) {
146146

147147
<div className="flex-1 overflow-y-auto">
148148
<div className="p-6">
149-
<div className="grid gap-6">
149+
<div className="grid grid-cols-1 gap-6">
150150
<div>
151151
<label htmlFor="name" className="flex items-center space-x-2">
152152
<h2 className="text-sm font-medium text-neutral-900">Name</h2>
@@ -243,7 +243,7 @@ function InvitePartnerSheetContent({ setIsOpen }: InvitePartnerSheetProps) {
243243

244244
<AnimatedSizeContainer height>
245245
{showAdvancedOptions && (
246-
<div className="grid gap-6 py-6">
246+
<div className="grid grid-cols-1 gap-6 py-6">
247247
<div>
248248
<label
249249
htmlFor="rewardId"
@@ -370,7 +370,7 @@ function EmailPreview() {
370370
className="overflow-hidden"
371371
>
372372
<div className="mt-2 overflow-hidden rounded-md border border-neutral-200 bg-white">
373-
<div className="grid gap-4 p-6 pb-10">
373+
<div className="grid grid-cols-1 gap-4 p-6 pb-10">
374374
<MemoBlurImage
375375
src={program?.logo || "https://assets.dub.co/logo.png"}
376376
alt={program?.name || "Dub"}

apps/web/ui/partners/partner-link-selector.tsx

+21-9
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import useLink from "@/lib/swr/use-link";
22
import useLinks from "@/lib/swr/use-links";
33
import useProgram from "@/lib/swr/use-program";
44
import { LinkProps } from "@/lib/types";
5-
import { Combobox, LinkLogo } from "@dub/ui";
5+
import { Combobox, LinkLogo, Tooltip } from "@dub/ui";
66
import { ArrowTurnRight2 } from "@dub/ui/icons";
77
import { cn, getApexDomain, linkConstructor } from "@dub/utils";
88
import { useMemo, useState } from "react";
@@ -100,15 +100,27 @@ export function PartnerLinkSelector({
100100
{selectedLink?.url && showDestinationUrl && (
101101
<div className="ml-2 mt-2 flex items-center gap-1 text-xs text-neutral-500">
102102
<ArrowTurnRight2 className="size-3 shrink-0" />
103-
<span className="min-w-0 truncate">
104-
Destination URL:{" "}
105-
<a
106-
href={selectedLink.url}
107-
target="_blank"
108-
className="underline-offset-2 hover:underline"
103+
<span className="flex min-w-0 items-center gap-1 whitespace-nowrap">
104+
<span>Destination URL:</span>
105+
<Tooltip
106+
align="end"
107+
alignOffset={-10}
108+
sideOffset={9}
109+
delayDuration={300}
110+
content={
111+
<div className="line-clamp-4 max-w-[495px] overflow-hidden break-all p-2.5 text-xs text-neutral-600">
112+
{selectedLink.url}
113+
</div>
114+
}
109115
>
110-
{selectedLink.url}
111-
</a>
116+
<a
117+
href={selectedLink.url}
118+
target="_blank"
119+
className="min-w-0 truncate underline-offset-2 hover:underline"
120+
>
121+
{selectedLink.url}
122+
</a>
123+
</Tooltip>
112124
</span>
113125
</div>
114126
)}

0 commit comments

Comments
 (0)