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.

add AccountInputGroup

Kiran K51b42c12642c
diff --git a/apps/web/ui/partners/merge-accounts/account-input-group.tsx b/apps/web/ui/partners/merge-accounts/account-input-group.tsx
new file mode 100644
index 0000000000..71c2443b0e
--- /dev/null
+++ b/apps/web/ui/partners/merge-accounts/account-input-group.tsx
@@ -0,0 +1,19 @@
+import { ReactNode } from "react";
+
+interface AccountInputGroupProps {
+ title: string;
+ children: ReactNode;
+}
+
+export function AccountInputGroup({ title, children }: AccountInputGroupProps) {
+ return (
+ <div className="rounded-xl border border-solid border-neutral-200 bg-neutral-100 p-1 pt-0">
+ <h3 className="px-1.5 py-2 text-xs font-medium leading-4 text-neutral-500">
+ {title}
+ </h3>
+ <div className="rounded-lg border border-solid border-neutral-200 bg-white p-3">
+ {children}
+ </div>
+ </div>
+ );
+}
\ No newline at end of file
diff --git a/apps/web/ui/partners/merge-accounts/send-verification-code-form.tsx b/apps/web/ui/partners/merge-accounts/send-verification-code-form.tsx
index a24a6d4aed..f3e9fd7068 100644
--- a/apps/web/ui/partners/merge-accounts/send-verification-code-form.tsx
+++ b/apps/web/ui/partners/merge-accounts/send-verification-code-form.tsx
@@ -3,6 +3,7 @@
import { mergePartnerAccountsAction } from "@/lib/actions/partners/merge-partner-accounts";
import usePartnerProfile from "@/lib/swr/use-partner-profile";
import { useMergePartnerAccountsForm } from "@/ui/partners/merge-accounts/form-context";
+import { AccountInputGroup } from "@/ui/partners/merge-accounts/account-input-group";
import { Button } from "@dub/ui";
import { useAction } from "next-safe-action/hooks";
import { useEffect } from "react";
@@ -64,46 +65,36 @@ export function SendVerificationCodeForm({
</p>
<div className="flex flex-col gap-6">
- <div className="rounded-xl border border-solid border-neutral-200 bg-neutral-100 p-1 pt-0">
- <h3 className="px-1.5 py-2 text-xs font-medium leading-4 text-neutral-500">
- Source account
- </h3>
- <div className="rounded-lg border border-solid border-neutral-200 bg-white p-3">
- <label className="text-sm font-medium leading-5 text-neutral-900">
- Email
- </label>
- <div className="relative mt-2 rounded-md shadow-sm">
- <input
- type="email"
- required
- autoFocus
- placeholder="Enter source account email"
- className="block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
- {...register("sourceEmail")}
- />
- </div>
+ <AccountInputGroup title="Source account">
+ <label className="text-sm font-medium leading-5 text-neutral-900">
+ Email
+ </label>
+ <div className="relative mt-2 rounded-md shadow-sm">
+ <input
+ type="email"
+ required
+ autoFocus
+ placeholder="Enter source account email"
+ className="block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
+ {...register("sourceEmail")}
+ />
</div>
- </div>
+ </AccountInputGroup>
- <div className="rounded-xl border border-solid border-neutral-200 bg-neutral-100 p-1 pt-0">
- <h3 className="px-1.5 py-2 text-xs font-medium leading-4 text-neutral-500">
- Target account
- </h3>
- <div className="rounded-lg border border-solid border-neutral-200 bg-white p-3">
- <label className="text-sm font-medium leading-5 text-neutral-900">
- Email
- </label>
- <div className="relative mt-2 rounded-md shadow-sm">
- <input
- type="email"
- required
- placeholder="Enter target account email"
- className="block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
- {...register("targetEmail")}
- />
- </div>
+ <AccountInputGroup title="Target account">
+ <label className="text-sm font-medium leading-5 text-neutral-900">
+ Email
+ </label>
+ <div className="relative mt-2 rounded-md shadow-sm">
+ <input
+ type="email"
+ required
+ placeholder="Enter target account email"
+ className="block w-full rounded-md border-neutral-300 text-neutral-900 placeholder-neutral-400 focus:border-neutral-500 focus:outline-none focus:ring-neutral-500 sm:text-sm"
+ {...register("targetEmail")}
+ />
</div>
- </div>
+ </AccountInputGroup>
</div>
<div className="flex items-center justify-end gap-2">
diff --git a/apps/web/ui/partners/merge-accounts/verify-code-form.tsx b/apps/web/ui/partners/merge-accounts/verify-code-form.tsx
index b32e9cdfc3..5fc7c06735 100644
--- a/apps/web/ui/partners/merge-accounts/verify-code-form.tsx
+++ b/apps/web/ui/partners/merge-accounts/verify-code-form.tsx
@@ -2,6 +2,7 @@
import { mergePartnerAccountsAction } from "@/lib/actions/partners/merge-partner-accounts";
import { useMergePartnerAccountsForm } from "@/ui/partners/merge-accounts/form-context";
+import { AccountInputGroup } from "@/ui/partners/merge-accounts/account-input-group";
import { Button } from "@dub/ui";
import { cn } from "@dub/utils";
import { OTPInput } from "input-otp";
@@ -61,17 +62,13 @@ export function VerifyCodeForm({ onSuccess }: { onSuccess: () => void }) {
return (
<form onSubmit={handleSubmit(onSubmit)} className="space-y-6">
<p className="text-sm font-medium text-neutral-700">
- We sent a 6-digit code to both emails. Didn’t receive them? Resend
+ We sent a 6-digit code to both emails. Didn't receive them? Resend
codes.
</p>
<div className="flex flex-col gap-6">
- <div className="rounded-xl border border-solid border-neutral-200 bg-neutral-100 p-1 pt-0">
- <h3 className="px-1.5 py-2 text-xs font-medium leading-4 text-neutral-500">
- Source account
- </h3>
-
- <div className="flex flex-col gap-4 rounded-lg border border-solid border-neutral-200 bg-white p-3">
+ <AccountInputGroup title="Source account">
+ <div className="flex flex-col gap-4">
<div>
<label className="text-sm font-medium leading-5 text-neutral-900">
Email
@@ -123,14 +120,10 @@ export function VerifyCodeForm({ onSuccess }: { onSuccess: () => void }) {
</div>
</div>
</div>
- </div>
-
- <div className="rounded-xl border border-solid border-neutral-200 bg-neutral-100 p-1 pt-0">
- <h3 className="px-1.5 py-2 text-xs font-medium leading-4 text-neutral-500">
- Target account
- </h3>
+ </AccountInputGroup>
- <div className="flex flex-col gap-4 rounded-lg border border-solid border-neutral-200 bg-white p-3">
+ <AccountInputGroup title="Target account">
+ <div className="flex flex-col gap-4">
<div>
<label className="text-sm font-medium leading-5 text-neutral-900">
Email
@@ -182,7 +175,7 @@ export function VerifyCodeForm({ onSuccess }: { onSuccess: () => void }) {
</div>
</div>
</div>
- </div>
+ </AccountInputGroup>
</div>
<div className="flex items-center justify-end gap-2">