2024-07-23 18:49:21 -05:00
|
|
|
|
"use client";
|
|
|
|
|
|
import {
|
|
|
|
|
|
Popover,
|
|
|
|
|
|
PopoverContent,
|
|
|
|
|
|
PopoverTrigger,
|
|
|
|
|
|
} from "@/components/ui/popover";
|
|
|
|
|
|
import { Button } from "../ui/button";
|
|
|
|
|
|
import { AtSign, LogIn, UserCog } from "lucide-react";
|
|
|
|
|
|
import { useState } from "react";
|
|
|
|
|
|
import { SignIn, useClerk } from "@clerk/nextjs";
|
|
|
|
|
|
|
|
|
|
|
|
export default function SignInPopoverButton({
|
|
|
|
|
|
className,
|
2024-08-03 09:51:45 -05:00
|
|
|
|
variant
|
2024-07-23 18:49:21 -05:00
|
|
|
|
}: {
|
|
|
|
|
|
className?: string;
|
2024-08-03 09:51:45 -05:00
|
|
|
|
variant?: "default" | "destructive" | "secondary" | "outline" | "ghost" | "link";
|
2024-07-23 18:49:21 -05:00
|
|
|
|
}) {
|
|
|
|
|
|
const clerk = useClerk();
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
<Popover>
|
|
|
|
|
|
<PopoverTrigger asChild>
|
2024-08-03 09:51:45 -05:00
|
|
|
|
<Button className={className} variant={variant}>Sign In</Button>
|
2024-07-23 18:49:21 -05:00
|
|
|
|
</PopoverTrigger>
|
|
|
|
|
|
<PopoverContent className="w-full">
|
|
|
|
|
|
<div className=" grid w-[200px]">
|
|
|
|
|
|
<strong className=" text-center">Login</strong>
|
|
|
|
|
|
<small className=" text-center">
|
|
|
|
|
|
Make comments about servers and favorite 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>
|
|
|
|
|
|
</PopoverContent>
|
|
|
|
|
|
</Popover>
|
|
|
|
|
|
);
|
|
|
|
|
|
}
|