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 progress bar

Kiran K6cecde261d7b
diff --git a/apps/web/ui/partners/merge-accounts/merge-account-form.tsx b/apps/web/ui/partners/merge-accounts/merge-account-form.tsx
index 4310fde9d4..6ff0f8db82 100644
--- a/apps/web/ui/partners/merge-accounts/merge-account-form.tsx
+++ b/apps/web/ui/partners/merge-accounts/merge-account-form.tsx
@@ -5,6 +5,7 @@ import { useAction } from "next-safe-action/hooks";
import { toast } from "sonner";
import { AccountInputGroup } from "./account-input-group";
import { useMergePartnerAccountsForm } from "./form-context";
+import { StepProgressBar } from "./step-progress-bar";
export function MergeAccountForm({
onSuccess,
@@ -80,22 +81,26 @@ export function MergeAccountForm({
</AccountInputGroup>
</div>
- <div className="flex items-center justify-end gap-2">
- <Button
- variant="secondary"
- text="Cancel"
- className="h-8 w-fit px-3"
- disabled={isPending}
- onClick={onCancel}
- />
- <Button
- text="Merge accounts"
- className="h-8 w-fit px-3"
- type="button"
- onClick={onSubmit}
- disabled={isPending}
- loading={isPending}
- />
+ <div className="flex items-center justify-between gap-4">
+ <StepProgressBar step={3} />
+
+ <div className="flex items-center gap-2">
+ <Button
+ variant="secondary"
+ text="Cancel"
+ className="h-8 w-fit px-3"
+ disabled={isPending}
+ onClick={onCancel}
+ />
+ <Button
+ text="Merge accounts"
+ className="h-8 w-fit px-3"
+ type="button"
+ onClick={onSubmit}
+ disabled={isPending}
+ loading={isPending}
+ />
+ </div>
</div>
</form>
);
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 66130358fc..e53765a0ee 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
@@ -10,6 +10,7 @@ import { useAction } from "next-safe-action/hooks";
import { useEffect } from "react";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
+import { StepProgressBar } from "./step-progress-bar";
export function SendVerificationCodeForm({
onSuccess,
@@ -104,21 +105,25 @@ export function SendVerificationCodeForm({
</AccountInputGroup>
</div>
- <div className="flex items-center justify-end gap-2">
- <Button
- variant="secondary"
- text="Cancel"
- className="h-8 w-fit px-3"
- disabled={isPending || isSubmitting}
- onClick={onCancel}
- />
- <Button
- text="Send codes"
- className="h-8 w-fit px-3"
- type="submit"
- disabled={!sourceEmail || !targetEmail}
- loading={isPending || isSubmitting}
- />
+ <div className="flex items-center justify-between gap-4">
+ <StepProgressBar step={1} />
+
+ <div className="flex items-center gap-2">
+ <Button
+ variant="secondary"
+ text="Cancel"
+ className="h-8 w-fit px-3"
+ disabled={isPending || isSubmitting}
+ onClick={onCancel}
+ />
+ <Button
+ text="Send codes"
+ className="h-8 w-fit px-3"
+ type="submit"
+ disabled={!sourceEmail || !targetEmail}
+ loading={isPending || isSubmitting}
+ />
+ </div>
</div>
</form>
);
diff --git a/apps/web/ui/partners/merge-accounts/step-progress-bar.tsx b/apps/web/ui/partners/merge-accounts/step-progress-bar.tsx
new file mode 100644
index 0000000000..39af5a20ec
--- /dev/null
+++ b/apps/web/ui/partners/merge-accounts/step-progress-bar.tsx
@@ -0,0 +1,22 @@
+function getStepClassName(isActive: boolean): string {
+ return isActive ? "w-4 h-2 bg-neutral-400" : "size-2 bg-neutral-300";
+}
+
+export function StepProgressBar({ step }: { step: number }) {
+ const totalSteps = 3;
+
+ return (
+ <div className="flex items-center gap-1.5">
+ {Array.from({ length: totalSteps }).map((_, index) => {
+ const isActive = step === index + 1;
+
+ return (
+ <div
+ key={index}
+ className={`rounded-full ${getStepClassName(isActive)}`}
+ />
+ );
+ })}
+ </div>
+ );
+}
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 79063a5f5e..5ca5dc9e71 100644
--- a/apps/web/ui/partners/merge-accounts/verify-code-form.tsx
+++ b/apps/web/ui/partners/merge-accounts/verify-code-form.tsx
@@ -9,6 +9,7 @@ import { ArrowDown } from "lucide-react";
import { useAction } from "next-safe-action/hooks";
import { useForm } from "react-hook-form";
import { toast } from "sonner";
+import { StepProgressBar } from "./step-progress-bar";
export function VerifyCodeForm({
onSuccess,
@@ -128,21 +129,25 @@ export function VerifyCodeForm({
</AccountInputGroup>
</div>
- <div className="flex items-center justify-end gap-2">
- <Button
- variant="secondary"
- text="Cancel"
- className="h-8 w-fit px-3"
- disabled={isPending || isSubmitting}
- onClick={onCancel}
- />
- <Button
- text="Verify accounts"
- className="h-8 w-fit px-3"
- type="submit"
- disabled={sourceCode.length !== 6 || targetCode.length !== 6}
- loading={isPending || isSubmitting}
- />
+ <div className="flex items-center justify-between gap-4">
+ <StepProgressBar step={2} />
+
+ <div className="flex items-center gap-2">
+ <Button
+ variant="secondary"
+ text="Cancel"
+ className="h-8 w-fit px-3"
+ disabled={isPending || isSubmitting}
+ onClick={onCancel}
+ />
+ <Button
+ text="Verify accounts"
+ className="h-8 w-fit px-3"
+ type="submit"
+ disabled={sourceCode.length !== 6 || targetCode.length !== 6}
+ loading={isPending || isSubmitting}
+ />
+ </div>
</div>
</form>
);