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.

simplify link settings tab

Steven Tey256219c3e4df
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 a972e42a65..8c9ae70a2a 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
@@ -16,10 +16,7 @@ import { toast } from "sonner";
import { mutate } from "swr";
import { SettingsRow } from "../program-settings-row";
-type FormData = Pick<
- ProgramProps,
- "domain" | "url" | "cookieLength" | "defaultFolderId" | "linkStructure"
->;
+type FormData = Pick<ProgramProps, "domain" | "url" | "linkStructure">;
export function LinksSettings() {
const { program } = useProgram();
@@ -53,8 +50,6 @@ function LinksSettingsForm({ program }: { program: ProgramProps }) {
defaultValues: {
domain: program.domain,
url: program.url,
- cookieLength: program.cookieLength,
- defaultFolderId: program.defaultFolderId,
linkStructure: program.linkStructure,
},
});
@@ -151,84 +146,6 @@ function LinksSettingsForm({ program }: { program: ProgramProps }) {
);
})}
</div>
- <div className="mt-6">
- <label>
- <span className="text-sm font-medium text-neutral-800">
- Cookie length
- </span>
- <div className="relative mt-2 rounded-md shadow-sm">
- <select
- className="block w-full rounded-md border-neutral-300 text-neutral-900 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
- {...register("cookieLength", {
- required: true,
- valueAsNumber: true,
- })}
- >
- {[7, 14, 30, 60, 90, 180].map((v) => (
- <option value={v} key={v}>
- {v} days
- </option>
- ))}
- </select>
- </div>
- </label>
- <p className="mt-2 text-xs text-neutral-400">
- Days your cookie will remain active and track referrals
- </p>
- </div>
-
- <div className="mt-6">
- <span className="text-sm font-medium text-neutral-800">
- Installation
- </span>
- <p className="mt-2 text-sm text-neutral-500">
- View our{" "}
- <a
- href="https://dub.co/docs/sdks/client-side/introduction"
- target="_blank"
- className="underline transition-colors duration-75 hover:text-neutral-600"
- >
- installation guides
- </a>{" "}
- to add our tracking script to your website.
- </p>
- </div>
- </SettingsRow>
-
- <SettingsRow heading="Folder for partner links">
- <div className="flex flex-col gap-6">
- <div>
- <label
- htmlFor="defaultFolderId"
- className="text-sm font-medium text-neutral-800"
- >
- Default Folder
- </label>
- <div className="relative mt-2 rounded-md shadow-sm">
- <select
- className={cn(
- "block w-full rounded-md border-neutral-300 text-neutral-900 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",
- loadingFolders && "opacity-50",
- )}
- {...register("defaultFolderId", {
- // required: true,
- })}
- disabled={loadingFolders}
- >
- <option value="">Select a folder</option>
- {folders?.map((folder) => (
- <option
- key={folder.id}
- value={folder.id}
- selected={folder.id === program.defaultFolderId}
- >
- {folder.name}
- </option>
- ))}
- </select>
- </div>
- </div>
- </div>
</SettingsRow>
</div>
diff --git a/packages/ui/src/hooks/use-toast-with-undo.tsx b/packages/ui/src/hooks/use-toast-with-undo.tsx
index 2dbdde7987..34ec85e86d 100644
--- a/packages/ui/src/hooks/use-toast-with-undo.tsx
+++ b/packages/ui/src/hooks/use-toast-with-undo.tsx
@@ -1,6 +1,6 @@
import { useEffect } from "react";
import { toast } from "sonner";
-import Success from "../icons/success";
+import { Success } from "../icons/success";
function ToastWithUndo({
id,
diff --git a/packages/ui/src/icons/copy.tsx b/packages/ui/src/icons/copy.tsx
index 5ce054f1d0..2b586764e2 100644
--- a/packages/ui/src/icons/copy.tsx
+++ b/packages/ui/src/icons/copy.tsx
@@ -1,4 +1,4 @@
-export default function Copy({ className }: { className?: string }) {
+export function Copy({ className }: { className?: string }) {
return (
<svg
fill="none"
diff --git a/packages/ui/src/icons/expanding-arrow.tsx b/packages/ui/src/icons/expanding-arrow.tsx
index a4b6baea95..8d53091d52 100644
--- a/packages/ui/src/icons/expanding-arrow.tsx
+++ b/packages/ui/src/icons/expanding-arrow.tsx
@@ -1,6 +1,6 @@
import { cn } from "@dub/utils";
-export default function ExpandingArrow({ className }: { className?: string }) {
+export function ExpandingArrow({ className }: { className?: string }) {
return (
<div className="group relative flex items-center">
<svg
diff --git a/packages/ui/src/icons/index.tsx b/packages/ui/src/icons/index.tsx
index 6bfc775b10..f33ec2ea8a 100644
--- a/packages/ui/src/icons/index.tsx
+++ b/packages/ui/src/icons/index.tsx
@@ -4,21 +4,21 @@ import { LucideIcon } from "lucide-react";
import { ComponentType, SVGProps } from "react";
// custom icons
-export { default as Copy } from "./copy";
+export * from "./copy";
export * from "./crown-small";
export * from "./dub-analytics";
export * from "./dub-api";
export * from "./dub-crafted-shield";
export * from "./dub-links";
export * from "./dub-partners";
-export { default as ExpandingArrow } from "./expanding-arrow";
-export { default as Magic } from "./magic";
+export * from "./expanding-arrow";
+export * from "./magic";
export * from "./markdown-icon";
export * from "./matrix-lines";
-export { default as Photo } from "./photo";
-export { default as SortOrder } from "./sort-order";
-export { default as Success } from "./success";
-export { default as Tick } from "./tick";
+export * from "./photo";
+export * from "./sort-order";
+export * from "./success";
+export * from "./tick";
// loaders
export * from "./loading-circle";
diff --git a/packages/ui/src/icons/magic.tsx b/packages/ui/src/icons/magic.tsx
index b50f766451..a41ef6c831 100644
--- a/packages/ui/src/icons/magic.tsx
+++ b/packages/ui/src/icons/magic.tsx
@@ -1,4 +1,4 @@
-export default function Magic({ className }: { className: string }) {
+export function Magic({ className }: { className: string }) {
return (
<svg
width="469"
diff --git a/packages/ui/src/icons/photo.tsx b/packages/ui/src/icons/photo.tsx
index 0f7bfa3a68..d0b9d17b4c 100644
--- a/packages/ui/src/icons/photo.tsx
+++ b/packages/ui/src/icons/photo.tsx
@@ -1,4 +1,4 @@
-export default function Photo({ className }: { className?: string }) {
+export function Photo({ className }: { className?: string }) {
return (
<svg
fill="none"
diff --git a/packages/ui/src/icons/sort-order.tsx b/packages/ui/src/icons/sort-order.tsx
index 57c1809125..611dc67d61 100644
--- a/packages/ui/src/icons/sort-order.tsx
+++ b/packages/ui/src/icons/sort-order.tsx
@@ -4,7 +4,7 @@ import { motion } from "framer-motion";
const upPath = "M6.75 8.25L4 11L1.25 8.25";
const downPath = "M6.75 3.75L4 1L1.25 3.75";
-export default function SortOrder({
+export function SortOrder({
order,
className,
}: {
diff --git a/packages/ui/src/icons/success.tsx b/packages/ui/src/icons/success.tsx
index 822df279d9..66e6f6162d 100644
--- a/packages/ui/src/icons/success.tsx
+++ b/packages/ui/src/icons/success.tsx
@@ -1,4 +1,4 @@
-export default function Success({ className }: { className?: string }) {
+export function Success({ className }: { className?: string }) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
diff --git a/packages/ui/src/icons/tick.tsx b/packages/ui/src/icons/tick.tsx
index 3e9b87db82..d001db0a86 100644
--- a/packages/ui/src/icons/tick.tsx
+++ b/packages/ui/src/icons/tick.tsx
@@ -1,4 +1,4 @@
-export default function Tick({ className }: { className: string }) {
+export function Tick({ className }: { className: string }) {
return (
<svg
fill="none"