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.

make Short Link recommended

Steven Teyd29da556f073
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/link-settings/form.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/link-settings/form.tsx
index a46658c0ba..c2eea21f9a 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/link-settings/form.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/link-settings/form.tsx
@@ -122,10 +122,7 @@ function LinksSettingsFormInner({ program }: { program: ProgramProps }) {
key={type.id}
className={cn(
"relative flex w-full cursor-pointer items-start gap-0.5 rounded-md border border-neutral-200 bg-white p-3 text-neutral-600",
- type.comingSoon
- ? "cursor-default opacity-80"
- : "hover:bg-neutral-50",
- "transition-all duration-150",
+ "transition-all duration-150 hover:bg-neutral-50",
isSelected &&
"border-black bg-neutral-50 text-neutral-900 ring-1 ring-black",
)}
@@ -134,7 +131,6 @@ function LinksSettingsFormInner({ program }: { program: ProgramProps }) {
type="radio"
value={type.id}
className="hidden"
- disabled={type.comingSoon === true}
{...register("linkStructure")}
/>
@@ -143,16 +139,17 @@ function LinksSettingsFormInner({ program }: { program: ProgramProps }) {
<span className="text-neutral-600">{type.example}</span>
</div>
- {type.comingSoon ? (
- <Badge variant="blueGradient">Coming soon</Badge>
- ) : (
+ <div className="flex items-center justify-end gap-2">
+ {type.recommended && (
+ <Badge variant="blueGradient">Recommended</Badge>
+ )}
<CircleCheckFill
className={cn(
"-mr-px -mt-px flex size-4 scale-75 items-center justify-center rounded-full opacity-0 transition-[transform,opacity] duration-150",
isSelected && "scale-100 opacity-100",
)}
/>
- )}
+ </div>
</label>
);
})}
diff --git a/apps/web/lib/partners/get-link-structure-options.ts b/apps/web/lib/partners/get-link-structure-options.ts
index 77e2089f45..f8c720a776 100644
--- a/apps/web/lib/partners/get-link-structure-options.ts
+++ b/apps/web/lib/partners/get-link-structure-options.ts
@@ -16,21 +16,19 @@ export const getLinkStructureOptions = ({
return [
{
id: PartnerLinkStructure.short,
- label: "Short link",
- example: `${shortDomain}/{partnerName}`,
- comingSoon: false,
+ label: "Short Link",
+ example: `${shortDomain}/{partnerLinkKey}`,
+ recommended: true,
},
{
id: PartnerLinkStructure.query,
- label: "Query parameter",
- example: `${websiteDomain}?via={partnerName}`,
- comingSoon: false,
- },
- {
- id: PartnerLinkStructure.path,
- label: "Dynamic path",
- example: `${websiteDomain}/refer/{partnerName}`,
- comingSoon: true,
+ label: "Query Parameter",
+ example: `${websiteDomain}?via={partnerLinkKey}`,
},
+ // {
+ // id: PartnerLinkStructure.path,
+ // label: "Dynamic path",
+ // example: `${websiteDomain}/refer/{partnerLinkKey}`,
+ // },
];
};