2024-07-23 18:49:21 -05:00
|
|
|
|
"use client";
|
|
|
|
|
|
import {
|
|
|
|
|
|
Popover,
|
|
|
|
|
|
PopoverContent,
|
|
|
|
|
|
PopoverTrigger,
|
|
|
|
|
|
} from "@/components/ui/popover";
|
|
|
|
|
|
import { Button } from "../ui/button";
|
2024-08-08 17:56:40 -05:00
|
|
|
|
import { AtSign, LogIn } from "lucide-react";
|
|
|
|
|
|
import { useClerk } from "@clerk/nextjs";
|
2024-07-23 18:49:21 -05:00
|
|
|
|
|
|
|
|
|
|
export default function SignInPopoverButton({
|
|
|
|
|
|
className,
|
2024-08-08 17:56:40 -05:00
|
|
|
|
variant,
|
2024-07-23 18:49:21 -05:00
|
|
|
|
}: {
|
|
|
|
|
|
className?: string;
|
2024-08-08 17:56:40 -05:00
|
|
|
|
variant?:
|
|
|
|
|
|
| "default"
|
|
|
|
|
|
| "destructive"
|
|
|
|
|
|
| "secondary"
|
|
|
|
|
|
| "outline"
|
|
|
|
|
|
| "ghost"
|
|
|
|
|
|
| "link";
|
2024-07-23 18:49:21 -05:00
|
|
|
|
}) {
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Popover>
|
|
|
|
|
|
<PopoverTrigger asChild>
|
2024-08-08 17:56:40 -05:00
|
|
|
|
<Button className={className} variant={variant}>
|
|
|
|
|
|
Sign In
|
|
|
|
|
|
</Button>
|
2024-07-23 18:49:21 -05:00
|
|
|
|
</PopoverTrigger>
|
|
|
|
|
|
<PopoverContent className="w-full">
|
2024-08-24 12:37:08 -05:00
|
|
|
|
<SignInPopover />
|
2024-07-23 18:49:21 -05:00
|
|
|
|
</PopoverContent>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|
2024-08-24 12:37:08 -05:00
|
|
|
|
|
|
|
|
|
|
export function SignInPopover() {
|
|
|
|
|
|
const clerk = useClerk();
|
|
|
|
|
|
return (
|
|
|
|
|
|
<div className=" grid w-[200px]">
|
|
|
|
|
|
<strong className="text-center">Login</strong>
|
|
|
|
|
|
<small className="text-center pb-6">
|
|
|
|
|
|
Customize your own servers and favorite other servers. Secured by Clerk
|
|
|
|
|
|
</small>
|
|
|
|
|
|
<br />
|
|
|
|
|
|
<Button variant={"ghost"} onClick={() => clerk.openSignIn()}>
|
|
|
|
|
|
<LogIn size={18} className="mr-2" />
|
|
|
|
|
|
Login
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
<Button variant={"ghost"} onClick={() => clerk.openSignUp()}>
|
|
|
|
|
|
<AtSign size={18} className="mr-2" />
|
|
|
|
|
|
Sign-up
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|