-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathbutton.tsx
More file actions
48 lines (46 loc) · 1.88 KB
/
button.tsx
File metadata and controls
48 lines (46 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
"use client";
import React from "react";
import { useRouter } from "next/navigation";
const TailwindConnectButton = ({ children = null, ...props }: React.PropsWithChildren<Record<string, unknown>>) => {
const router = useRouter();
const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
console.log('TailwindConnectButton clicked');
e.preventDefault();
router.push('/dashboard');
};
return (
<button
className="bg-slate-800 no-underline group cursor-pointer relative shadow-2xl shadow-zinc-900 rounded-full p-1 text-sm font-semibold leading-6 text-white inline-block"
onClick={handleClick}
{...props}
>
<span className="absolute inset-0 overflow-hidden rounded-full">
<span className="absolute inset-0 rounded-full bg-[image:radial-gradient(75%_100%_at_50%_0%,rgba(56,189,248,0.6)_0%,rgba(56,189,248,0)_75%)] opacity-0 transition-opacity duration-500 group-hover:opacity-100" />
</span>
<div className="relative flex space-x-2 items-center z-10 rounded-full bg-zinc-950 py-2 px-5 ring-1 ring-white/10 ">
{children || (
<>
<span>Get started</span>
<svg
fill="none"
height="16"
viewBox="0 0 24 24"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M10.75 8.75L14.25 12L10.75 15.25"
stroke="currentColor"
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="1.5"
/>
</svg>
</>
)}
</div>
<span className="absolute -bottom-0 left-[1.125rem] h-px w-[calc(100%-2.25rem)] bg-gradient-to-r from-emerald-400/0 via-emerald-400/90 to-emerald-400/0 transition-opacity duration-500 group-hover:opacity-40" />
</button>
);
};
export default TailwindConnectButton;