diff --git a/bun.lockb b/bun.lockb index 6358aca4..904b8e8e 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 62ef016d..e6f2c5e9 100644 --- a/package.json +++ b/package.json @@ -47,6 +47,7 @@ "dependencies": { "@radix-ui/colors": "^3.0.0", "@radix-ui/react-navigation-menu": "^1.1.4", + "@radix-ui/react-slot": "^1.0.2", "@t3-oss/env-nextjs": "^0.10.1", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", diff --git a/src/app/(marketing)/_components/navbar.tsx b/src/app/(marketing)/_components/navbar.tsx index b2bbf661..7c766477 100644 --- a/src/app/(marketing)/_components/navbar.tsx +++ b/src/app/(marketing)/_components/navbar.tsx @@ -17,6 +17,7 @@ import { import { constants } from '@/constants'; import { cn } from '@/lib/utils'; +import { Button } from '@/primitives/button'; import { NavigationMenu, NavigationMenuContent, @@ -213,7 +214,13 @@ export const Navbar = () => { -
{/* TODO: add log in / sign up buttons */}
+
+ +
); diff --git a/src/app/(marketing)/page.tsx b/src/app/(marketing)/page.tsx index 09ddc6b1..484659cf 100644 --- a/src/app/(marketing)/page.tsx +++ b/src/app/(marketing)/page.tsx @@ -1,6 +1,9 @@ -import { StarIcon } from 'lucide-react'; +import Link from 'next/link'; + +import { ChevronRightIcon, StarIcon } from 'lucide-react'; import { constants } from '@/constants'; +import { Button } from '@/primitives/button'; /** * The marketing home page. @@ -10,14 +13,17 @@ import { constants } from '@/constants'; export default function Home() { return (
- - Star us on GitHub{' '} - - -

+ +

{constants.tagline}

@@ -25,6 +31,11 @@ export default function Home() { made to streamline the process students conduct their studies and organize it.

+
); } diff --git a/src/constants.ts b/src/constants.ts index c2e787e4..a4181ca3 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -5,4 +5,5 @@ export const constants = { description: 'Noodle is a productivity platform including many tools students need to be productive and stay on top of their work such as note taking, task management, and more.', twitter_handle: '@noodle_run', + github_repo: 'https://github.com/noodle-run/noodle', }; diff --git a/src/primitives/button.tsx b/src/primitives/button.tsx new file mode 100644 index 00000000..235bbc20 --- /dev/null +++ b/src/primitives/button.tsx @@ -0,0 +1,57 @@ +import * as React from 'react'; + +import type { VariantProps } from 'class-variance-authority'; + +import { Slot } from '@radix-ui/react-slot'; +import { cva } from 'class-variance-authority'; + +import { cn } from '@/lib/utils'; + +const buttonVariants = cva( + 'inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-subtle-border focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', + { + variants: { + variant: { + default: + 'bg-gradient-to-br from-salmon to-pink text-black hover:opacity-90', + destructive: 'bg-red text-white hover:bg-red-solid-hover', + outline: + 'border border-gray-subtle-border bg-background text-foreground-muted hover:bg-gray-subtle hover:text-foreground', + ghost: 'hover:bg-gray-element', + link: 'relative bg-gradient-to-br from-salmon to-pink bg-clip-text text-transparent before:absolute before:bottom-0 before:h-px before:w-[calc(100%-24px)] before:rounded-full before:bg-gradient-to-br before:from-salmon before:to-pink hover:opacity-90', + }, + size: { + default: 'px-4 py-2', + sm: 'px-3 py-1.5', + lg: 'px-4 py-2 text-base', + icon: 'size-10', + }, + }, + defaultVariants: { + variant: 'default', + size: 'default', + }, + }, +); + +export interface ButtonProps + extends React.ButtonHTMLAttributes, + VariantProps { + asChild?: boolean; +} + +const Button = React.forwardRef( + ({ className, variant, size, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : 'button'; + return ( + + ); + }, +); +Button.displayName = 'Button'; + +export { Button, buttonVariants }; diff --git a/tailwind.config.ts b/tailwind.config.ts index 99bf8688..2495cee2 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -6,7 +6,7 @@ import formsPlugin from '@tailwindcss/forms'; import typographyPlugin from '@tailwindcss/typography'; import tailwindAnimate from 'tailwindcss-animate'; -type Scale = 'gray' | 'pink' | 'salmon' | 'indigo'; +type Scale = 'gray' | 'pink' | 'salmon' | 'indigo' | 'red'; const generateColorScale = (scale: Scale) => ({ DEFAULT: `hsl(var(--${scale}-9))`, @@ -56,6 +56,7 @@ const config: Config = { pink: generateColorScale('pink'), salmon: generateColorScale('salmon'), indigo: generateColorScale('indigo'), + red: generateColorScale('red'), }, fontFamily: { sans: ['var(--font-geist-sans)'],