Skip to content

Commit

Permalink
Merge pull request #2 from gmchaturvedi1/gm/dev
Browse files Browse the repository at this point in the history
Updates in signout confirmation
  • Loading branch information
gmchaturvedi1 authored Aug 27, 2024
2 parents af5686c + 16b9b8e commit bf32591
Showing 1 changed file with 22 additions and 23 deletions.
45 changes: 22 additions & 23 deletions src/modules/Dashboard/Components/user-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
AlertDialogDescription,
AlertDialogHeader,
AlertDialogTitle,
AlertDialogTrigger,
} from "@/components/ui/alert-dialog";

export function UserNav() {
Expand Down Expand Up @@ -108,27 +107,27 @@ const SignoutConfirmation = () => {
};

return (
<AlertDialog open={open} onOpenChange={setOpen}>
<AlertDialogTrigger
className="px-2 py-1.5 text-sm text-muted-foreground outline-none"
asChild
>
<button>Sign out</button>
</AlertDialogTrigger>
<AlertDialogContent className="max-w-xs">
<AlertDialogHeader>
<AlertDialogTitle className="text-center">Sign out from {APP_TITLE}?</AlertDialogTitle>
<AlertDialogDescription>You will be redirected to the home page.</AlertDialogDescription>
</AlertDialogHeader>
<div className="flex flex-col-reverse gap-2 sm:flex-row sm:justify-center">
<Button variant="outline" onClick={() => setOpen(false)}>
Cancel
</Button>
<LoadingButton loading={isLoading} onClick={handleSignout}>
Continue
</LoadingButton>
</div>
</AlertDialogContent>
</AlertDialog>
<>
{" "}
<Button onClick={() => setOpen(true)}>Sign out</Button>
<AlertDialog open={open} onOpenChange={setOpen}>
<AlertDialogContent className="max-w-xs">
<AlertDialogHeader>
<AlertDialogTitle className="text-center">Sign out from {APP_TITLE}?</AlertDialogTitle>
<AlertDialogDescription>
You will be redirected to the home page.
</AlertDialogDescription>
</AlertDialogHeader>
<div className="flex flex-col-reverse gap-2 sm:flex-row sm:justify-center">
<Button variant="outline" onClick={() => setOpen(false)}>
Cancel
</Button>
<LoadingButton loading={isLoading} onClick={handleSignout}>
Continue
</LoadingButton>
</div>
</AlertDialogContent>
</AlertDialog>
</>
);
};

0 comments on commit bf32591

Please sign in to comment.