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.

Update group-settings.tsx

Kiran Kd83ee8b733cb
diff --git a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/groups/[groupSlug]/group-settings.tsx b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/groups/[groupSlug]/group-settings.tsx
index 23daec4fd2..1f2f1eeb70 100644
--- a/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/groups/[groupSlug]/group-settings.tsx
+++ b/apps/web/app/app.dub.co/(dashboard)/[slug]/(ee)/program/partners/groups/[groupSlug]/group-settings.tsx
@@ -67,116 +67,115 @@ export function GroupSettings() {
};
return (
- <div className="space-y-6">
- <div>
- <h2 className="text-lg font-semibold text-neutral-900">Settings</h2>
- <p className="text-sm text-neutral-500">
- Manage your group settings and configuration.
- </p>
- </div>
-
- <form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
- <div>
- <label
- htmlFor="name"
- className="text-sm font-medium text-neutral-800"
- >
- Name
- </label>
- <div className="mt-2">
- <div className="relative">
- <input
- type="text"
- id="name"
- className={cn(
- "block w-full rounded-md border-neutral-300 px-3 py-2 pr-12 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",
- errors.name &&
- "border-red-600 focus:border-red-500 focus:ring-red-600",
- )}
- {...register("name", {
- required: true,
- })}
- onChange={(e) => {
- const name = e.target.value;
- setValue("name", name, { shouldDirty: true });
- setValue("slug", slugify(name), { shouldDirty: true });
- }}
- placeholder="Group name"
- />
- <div className="absolute inset-y-0 right-0 flex items-center pr-2.5">
- <div className="relative">
- <div
- className="h-6 w-6 cursor-pointer rounded-full border-none"
- style={{
- backgroundColor: watch("color") || "",
- }}
- onClick={() =>
- document.getElementById("color-picker")?.click()
- }
- />
- <input
- id="color-picker"
- type="color"
- {...register("color", {
- required: true,
- })}
- className="absolute inset-0 cursor-pointer opacity-0"
- title="Choose group color"
- />
+ <form
+ onSubmit={handleSubmit(onSubmit)}
+ className="rounded-lg border border-neutral-200"
+ >
+ <div className="px-5 py-5">
+ <h2 className="mb-4 text-base font-bold text-neutral-900">Settings</h2>
+ <div className="space-y-6">
+ <div>
+ <label
+ htmlFor="name"
+ className="text-sm font-medium text-neutral-800"
+ >
+ Name
+ </label>
+ <div className="mt-2">
+ <div className="relative">
+ <input
+ type="text"
+ id="name"
+ className={cn(
+ "block w-full rounded-md border-neutral-300 px-3 py-2 pr-12 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",
+ errors.name &&
+ "border-red-600 focus:border-red-500 focus:ring-red-600",
+ )}
+ {...register("name", {
+ required: true,
+ })}
+ onChange={(e) => {
+ const name = e.target.value;
+ setValue("name", name, { shouldDirty: true });
+ setValue("slug", slugify(name), { shouldDirty: true });
+ }}
+ placeholder="Group name"
+ />
+ <div className="absolute inset-y-0 right-0 flex items-center pr-2.5">
+ <div className="relative">
+ <div
+ className="h-6 w-6 cursor-pointer rounded-full border-none"
+ style={{
+ backgroundColor: watch("color") || "",
+ }}
+ onClick={() =>
+ document.getElementById("color-picker")?.click()
+ }
+ />
+ <input
+ id="color-picker"
+ type="color"
+ {...register("color", {
+ required: true,
+ })}
+ className="absolute inset-0 cursor-pointer opacity-0"
+ title="Choose group color"
+ />
+ </div>
</div>
</div>
- </div>
- <p className="mt-2 text-xs text-neutral-500">
- For internal use only, never visible to partners
- </p>
+ <p className="mt-2 text-xs text-neutral-500">
+ For internal use only, never visible to partners
+ </p>
+ </div>
</div>
- </div>
- <div>
- <label
- htmlFor="slug"
- className="text-sm font-medium text-neutral-800"
- >
- Landing page slug
- </label>
- <div className="mt-2">
- <div className="flex">
- <div className="flex items-center rounded-l-md border-y border-l border-neutral-300 px-3 py-2 text-sm text-neutral-800">
- partners.dub.co/{program?.slug}
+ <div>
+ <label
+ htmlFor="slug"
+ className="text-sm font-medium text-neutral-800"
+ >
+ Landing page slug
+ </label>
+ <div className="mt-2">
+ <div className="flex">
+ <div className="flex items-center rounded-l-md border-y border-l border-neutral-300 px-3 py-2 text-sm text-neutral-800">
+ partners.dub.co/{program?.slug}
+ </div>
+ <input
+ type="text"
+ id="slug"
+ className={cn(
+ "block w-full rounded-r-md border border-neutral-300 px-3 py-2 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",
+ errors.slug &&
+ "border-red-600 focus:border-red-500 focus:ring-red-600",
+ )}
+ {...register("slug", {
+ required: true,
+ })}
+ placeholder="group-name"
+ />
</div>
- <input
- type="text"
- id="slug"
- className={cn(
- "block w-full rounded-r-md border border-neutral-300 px-3 py-2 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm",
- errors.slug &&
- "border-red-600 focus:border-red-500 focus:ring-red-600",
- )}
- {...register("slug", {
- required: true,
- })}
- placeholder="group-name"
- />
- </div>
- <p className="mt-2 text-xs text-neutral-500">
- For both internal and external use
- </p>
+ <p className="mt-2 text-xs text-neutral-500">
+ For both internal and external use
+ </p>
+ </div>
</div>
</div>
+ </div>
- <div className="flex items-center justify-end gap-2 pt-4">
+ <div className="flex items-center justify-end rounded-b-lg border-t border-neutral-200 bg-neutral-50 px-6 py-5">
+ <div>
<Button
- type="submit"
- variant="primary"
text="Save changes"
- className="w-fit"
+ className="h-8"
loading={isSubmitting}
disabled={!isDirty}
/>
</div>
- </form>
- </div>
+ </div>
+ </form>
);
}