From bb05dad34ef390168c7ad13197d68fa47e1dffc2 Mon Sep 17 00:00:00 2001 From: Ishaan Dey Date: Mon, 15 Apr 2024 23:25:14 -0400 Subject: [PATCH] add custom button --- app/globals.css | 12 +++++++++ app/page.tsx | 20 ++++++++++----- assets/logo.svg | 39 +++++++++++----------------- components/ui/customButton.tsx | 47 ++++++++++++++++++++++++++++++++++ 4 files changed, 88 insertions(+), 30 deletions(-) create mode 100644 components/ui/customButton.tsx diff --git a/app/globals.css b/app/globals.css index 52a8d2d..69939b8 100644 --- a/app/globals.css +++ b/app/globals.css @@ -73,4 +73,16 @@ body { @apply bg-background text-foreground; } +} + +.gradient-button-bg { + background: radial-gradient(circle at top, #a5b4fc, #3730a3); /* violet 300 -> 800 */ +} + +.gradient-button { + background: radial-gradient(circle at bottom, #312e81 0%, hsl(0 0% 3.9%) 100%); /* violet 900 -> bg */ +} + +.gradient-button-bg > div:hover { + background: radial-gradient(circle at bottom, #312e81 0%, hsl(0 0% 3.9%) 150%); /* violet 900 -> bg */ } \ No newline at end of file diff --git a/app/page.tsx b/app/page.tsx index 755f76a..c7327ff 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,15 +1,23 @@ import Image from "next/image" import Logo from "@/assets/logo.svg" import XLogo from "@/assets/x.svg" -import { Button } from "@/components/ui/button" +import Button from "@/components/ui/customButton" import { ChevronRight } from "lucide-react" import Link from "next/link" +import { currentUser } from "@clerk/nextjs" +import { redirect } from "next/navigation" + +export default async function Home() { + const user = await currentUser() + + if (user) { + redirect("/dashboard") + } -export default function Home() { return (
- {/*
+
*/} -

+

+

A Collaborative, AI-Powered, Auto-Scaling Code Editor

diff --git a/assets/logo.svg b/assets/logo.svg index 3fec864..b5c4b5e 100644 --- a/assets/logo.svg +++ b/assets/logo.svg @@ -1,27 +1,18 @@ - - - - - - - - - + + + + + + + - - - - - - - - - - - - - - - + + + + + + + + diff --git a/components/ui/customButton.tsx b/components/ui/customButton.tsx new file mode 100644 index 0000000..55368cb --- /dev/null +++ b/components/ui/customButton.tsx @@ -0,0 +1,47 @@ +import * as React from "react" +import { Slot } from "@radix-ui/react-slot" +import { cva, type VariantProps } from "class-variance-authority" + +import { cn } from "@/lib/utils" + +const buttonVariants = cva( + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50", + { + variants: { + variant: { + default: + "bg-primary text-primary-foreground shadow hover:bg-primary/90", + destructive: + "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90", + outline: + "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", + secondary: + "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: "h-9 px-4 py-2", + sm: "h-8 rounded-md px-3 text-xs", + lg: "h-10 rounded-md px-8", + icon: "h-9 w-9", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + } +) + +const Button = ({ children }: { children: React.ReactNode }) => { + return ( +
+ Go To App +
+ + ) +} + +export default Button