Skip to content

Commit 904f179

Browse files
committed
Add account confirm dialog
1 parent 13e3013 commit 904f179

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

apps/web/app/(app)/accounts/AddAccount.tsx

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { Card, CardContent } from "@/components/ui/card";
66
import { Button } from "@/components/ui/button";
77
import { toastError } from "@/components/Toast";
88
import Image from "next/image";
9+
import { ConfirmDialog } from "@/components/ConfirmDialog";
910

1011
export function AddAccount() {
1112
const [isLoading, setIsLoading] = useState(false);
@@ -27,22 +28,28 @@ export function AddAccount() {
2728
return (
2829
<Card className="flex items-center justify-center">
2930
<CardContent className="flex flex-col items-center p-6">
30-
<Button
31-
onClick={handleConnectGoogle}
32-
disabled={isLoading}
33-
className="mt-auto"
34-
>
35-
<Image
36-
src="/images/google.svg"
37-
alt=""
38-
width={24}
39-
height={24}
40-
unoptimized
41-
/>
42-
<span className="ml-2">
43-
{isLoading ? "Connecting..." : "Add Google Account"}
44-
</span>
45-
</Button>
31+
<ConfirmDialog
32+
trigger={
33+
<Button disabled={isLoading} className="mt-auto">
34+
<Image
35+
src="/images/google.svg"
36+
alt=""
37+
width={24}
38+
height={24}
39+
unoptimized
40+
/>
41+
<span className="ml-2">
42+
{isLoading ? "Connecting..." : "Add Google Account"}
43+
</span>
44+
</Button>
45+
}
46+
title="Connect Account"
47+
description="Note: If your email address is already connected to another user, you will not be able to connect it to this user. We will offer a way to merge accounts in the near future."
48+
confirmText="Got it"
49+
onConfirm={async () => {
50+
handleConnectGoogle();
51+
}}
52+
/>
4653
</CardContent>
4754
</Card>
4855
);

0 commit comments

Comments
 (0)