The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
improve CTA connection
Steven Teyd24c25302d2b
diff --git a/apps/web/app/(ee)/app.dub.co/embed/referrals/links-list.tsx b/apps/web/app/(ee)/app.dub.co/embed/referrals/links-list.tsxindex c0051df82f..20ce5551ec 100644--- a/apps/web/app/(ee)/app.dub.co/embed/referrals/links-list.tsx+++ b/apps/web/app/(ee)/app.dub.co/embed/referrals/links-list.tsx@@ -125,14 +125,14 @@ export function ReferralsEmbedLinksList({emptyState: (<AnimatedEmptyStatetitle="No links found"- description="No referral links found for you."+ description="You don't have any referral links yet. Create a link to start earning commissions."cardContent={() => (<><Users className="text-content-default size-4" />- <div className="bg-bg-emphasis h-2.5 w-24 min-w-0 rounded-sm" />+ <div className="bg-bg-emphasis h-2.5 w-40 rounded-sm" /></>)}- className="border-none md:min-h-fit"+ className="max-w-xs border-none md:min-h-fit"addButton={<Buttontext="Create link"@@ -160,7 +160,9 @@ export function ReferralsEmbedLinksList({table={table}containerClassName="border-none max-h-[26rem] overflow-auto"/>- <div className="from-bg-default pointer-events-none absolute -bottom-px left-0 h-16 w-full rounded-b-lg bg-gradient-to-t sm:bottom-0" />+ {links.length > 0 && (+ <div className="from-bg-default pointer-events-none absolute -bottom-px left-0 h-16 w-full rounded-b-lg bg-gradient-to-t sm:bottom-0" />+ )}</motion.div>);}diff --git a/apps/web/app/(ee)/app.dub.co/embed/referrals/page-client.tsx b/apps/web/app/(ee)/app.dub.co/embed/referrals/page-client.tsxindex f7d475addd..e5a2b26b39 100644--- a/apps/web/app/(ee)/app.dub.co/embed/referrals/page-client.tsx+++ b/apps/web/app/(ee)/app.dub.co/embed/referrals/page-client.tsx@@ -130,43 +130,50 @@ export function ReferralsEmbedPageClient({<inputtype="text"readOnly- value={partnerLink ? getPrettyUrl(partnerLink) : "No link found"}+ value={+ partnerLink ? getPrettyUrl(partnerLink) : "No referral link"+ }className="border-border-default text-content-default focus:border-border-emphasis bg-bg-default h-10 min-w-0 shrink grow rounded-md border px-3 text-sm focus:outline-none focus:ring-neutral-500"/>- <Button- icon={- <div className="relative size-4">- <div- className={cn(- "absolute inset-0 transition-[transform,opacity]",- copied && "translate-y-1 opacity-0",- )}- >- <Copy className="size-4" />- </div>- <div- className={cn(- "absolute inset-0 transition-[transform,opacity]",- !copied && "translate-y-1 opacity-0",- )}- >- <Check className="size-4" />+ {hasPartnerLinks ? (+ <Button+ icon={+ <div className="relative size-4">+ <div+ className={cn(+ "absolute inset-0 transition-[transform,opacity]",+ copied && "translate-y-1 opacity-0",+ )}+ >+ <Copy className="size-4" />+ </div>+ <div+ className={cn(+ "absolute inset-0 transition-[transform,opacity]",+ !copied && "translate-y-1 opacity-0",+ )}+ >+ <Check className="size-4" />+ </div></div>- </div>- }- text={copied ? "Copied link" : "Copy link"}- className="xs:w-fit"- onClick={() => {- if (partnerLink) {- copyToClipboard(partnerLink);}- }}- disabledTooltip={- !hasPartnerLinks- ? "You need to create a link first."- : undefined- }- />+ text={copied ? "Copied link" : "Copy link"}+ className="xs:w-fit"+ onClick={() => {+ if (partnerLink) {+ copyToClipboard(partnerLink);+ }+ }}+ />+ ) : (+ <Button+ text="Create a link"+ onClick={() => {+ setSelectedTab("Links");+ }}+ className="xs:w-fit"+ />+ )}</div>{hasPartnerLinks && program.linkStructure === "query" && (@@ -245,9 +252,8 @@ export function ReferralsEmbedPageClient({<ReferralsEmbedQuickstartprogram={program}link={hasPartnerLinks ? links[0] : undefined}- onViewResources={- hasResources ? () => setSelectedTab("Resources") : undefined- }+ hasResources={hasResources}+ setSelectedTab={setSelectedTab}/>) : selectedTab === "Earnings" ? (<ReferralsEmbedEarnings salesCount={stats.sales} />diff --git a/apps/web/app/(ee)/app.dub.co/embed/referrals/quickstart.tsx b/apps/web/app/(ee)/app.dub.co/embed/referrals/quickstart.tsxindex febf409b83..6853cbc352 100644--- a/apps/web/app/(ee)/app.dub.co/embed/referrals/quickstart.tsx+++ b/apps/web/app/(ee)/app.dub.co/embed/referrals/quickstart.tsx@@ -19,16 +19,17 @@ const BUTTON_CLASSNAME = "h-9 rounded-lg bg-bg-inverted hover:bg-neutral-800";export function ReferralsEmbedQuickstart({program,link,- onViewResources,+ hasResources,+ setSelectedTab,}: {program: Program;link: ReferralsEmbedLink | undefined;- onViewResources?: () => void;+ hasResources: boolean;+ setSelectedTab: (tab: "Links" | "Resources") => void;}) {const [copied, copyToClipboard] = useCopyToClipboard();const { isMobile } = useMediaQuery();- const copyLinkDisabled = !link;const payoutsDisabled = !link || link.saleAmount === 0;const items = [@@ -38,35 +39,36 @@ export function ReferralsEmbedQuickstart({illustration: <ShareLink />,cta: (<Button- className={copyLinkDisabled ? "h-9 rounded-lg" : BUTTON_CLASSNAME}+ className={BUTTON_CLASSNAME}onClick={() => {if (link) {copyToClipboard(link.shortLink);+ } else {+ setSelectedTab("Links");}}}- disabledTooltip={- copyLinkDisabled ? "You need to create a link first." : undefined- }- text={copied ? "Copied link" : "Copy link"}+ text={link ? (copied ? "Copied link" : "Copy link") : "Create a link"}icon={- <div className="relative size-4">- <div- className={cn(- "absolute inset-0 transition-[transform,opacity]",- copied && "translate-y-1 opacity-0",- )}- >- <Copy className="size-4" />- </div>- <div- className={cn(- "absolute inset-0 transition-[transform,opacity]",- !copied && "translate-y-1 opacity-0",- )}- >- <Check className="size-4" />+ link ? (+ <div className="relative size-4">+ <div+ className={cn(+ "absolute inset-0 transition-[transform,opacity]",+ copied && "translate-y-1 opacity-0",+ )}+ >+ <Copy className="size-4" />+ </div>+ <div+ className={cn(+ "absolute inset-0 transition-[transform,opacity]",+ !copied && "translate-y-1 opacity-0",+ )}+ >+ <Check className="size-4" />+ </div></div>- </div>+ ) : undefined}/>),@@ -79,9 +81,11 @@ export function ReferralsEmbedQuickstart({cta: (<ButtonclassName="h-9 rounded-lg"- text={onViewResources ? "View resources" : "No resources"}- disabled={!onViewResources}- onClick={onViewResources}+ text={hasResources ? "View resources" : "No resources"}+ disabled={!hasResources}+ onClick={() => {+ setSelectedTab("Resources");+ }}/>),},