diff --git a/web/app/(splash)/GetStarted/GetStarted.tsx b/web/app/(splash)/GetStarted/GetStarted.tsx index ce6246ff..1c1da1e7 100644 --- a/web/app/(splash)/GetStarted/GetStarted.tsx +++ b/web/app/(splash)/GetStarted/GetStarted.tsx @@ -31,7 +31,7 @@ export const GetStarted = () => {
+ )} + + + + + ) +} diff --git a/web/app/hacker/layout.tsx b/web/app/hacker/layout.tsx new file mode 100644 index 00000000..0373c309 --- /dev/null +++ b/web/app/hacker/layout.tsx @@ -0,0 +1,64 @@ +import { Button } from "@/components/ui/button"; +import Image from "next/image"; +import Link from "next/link"; +import { ReactNode } from "react"; + +export default function SplashPageLayout({ + children, +}: { + children: ReactNode; +}) { + return ( +
+
+ +
+
{children}
+
+
+ Built with ❤️ at{" "} + HackTheNorth2024. + Powered by Convex,{" "} + Next.js and{" "} + shadcn/ui. +
+
+
+ ); +} + +function FooterLink({ href, children }: { href: string; children: ReactNode }) { + return ( + + {children} + + ); +} + +function SplashPageNav() { + return ( + <> + + + + + + ); +} diff --git a/web/app/hacker/page.tsx b/web/app/hacker/page.tsx new file mode 100644 index 00000000..e0a6e718 --- /dev/null +++ b/web/app/hacker/page.tsx @@ -0,0 +1,5 @@ +import SurveyForm from "./HackerForm/HackathonProfileForm"; + +export default function HomePage() { + return ; +} \ No newline at end of file diff --git a/web/app/layout.tsx b/web/app/layout.tsx index 3e31abe6..25c306d8 100644 --- a/web/app/layout.tsx +++ b/web/app/layout.tsx @@ -7,8 +7,8 @@ import { ConvexAuthNextjsServerProvider } from "@convex-dev/auth/nextjs/server"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: "Convex + Next.js + Convex Auth", - description: "Generated by npm create convex", + title: "Hackd", + description: "Find your next big team with Hackd.", icons: { icon: "/convex.svg", }, diff --git a/web/components/ui/button.tsx b/web/components/ui/button.tsx index 225e1138..0270f644 100644 --- a/web/components/ui/button.tsx +++ b/web/components/ui/button.tsx @@ -1,8 +1,8 @@ -import * as React from "react"; -import { Slot } from "@radix-ui/react-slot"; -import { cva, type VariantProps } from "class-variance-authority"; +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"; +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", @@ -31,27 +31,27 @@ const buttonVariants = cva( variant: "default", size: "default", }, - }, -); + } +) export interface ButtonProps extends React.ButtonHTMLAttributes, VariantProps { - asChild?: boolean; + asChild?: boolean } const Button = React.forwardRef( ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button"; + const Comp = asChild ? Slot : "button" return ( - ); - }, -); -Button.displayName = "Button"; + ) + } +) +Button.displayName = "Button" -export { Button, buttonVariants }; +export { Button, buttonVariants } diff --git a/web/components/ui/form.tsx b/web/components/ui/form.tsx new file mode 100644 index 00000000..b6daa654 --- /dev/null +++ b/web/components/ui/form.tsx @@ -0,0 +1,178 @@ +"use client" + +import * as React from "react" +import * as LabelPrimitive from "@radix-ui/react-label" +import { Slot } from "@radix-ui/react-slot" +import { + Controller, + ControllerProps, + FieldPath, + FieldValues, + FormProvider, + useFormContext, +} from "react-hook-form" + +import { cn } from "@/lib/utils" +import { Label } from "@/components/ui/label" + +const Form = FormProvider + +type FormFieldContextValue< + TFieldValues extends FieldValues = FieldValues, + TName extends FieldPath = FieldPath +> = { + name: TName +} + +const FormFieldContext = React.createContext( + {} as FormFieldContextValue +) + +const FormField = < + TFieldValues extends FieldValues = FieldValues, + TName extends FieldPath = FieldPath +>({ + ...props +}: ControllerProps) => { + return ( + + + + ) +} + +const useFormField = () => { + const fieldContext = React.useContext(FormFieldContext) + const itemContext = React.useContext(FormItemContext) + const { getFieldState, formState } = useFormContext() + + const fieldState = getFieldState(fieldContext.name, formState) + + if (!fieldContext) { + throw new Error("useFormField should be used within ") + } + + const { id } = itemContext + + return { + id, + name: fieldContext.name, + formItemId: `${id}-form-item`, + formDescriptionId: `${id}-form-item-description`, + formMessageId: `${id}-form-item-message`, + ...fieldState, + } +} + +type FormItemContextValue = { + id: string +} + +const FormItemContext = React.createContext( + {} as FormItemContextValue +) + +const FormItem = React.forwardRef< + HTMLDivElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => { + const id = React.useId() + + return ( + +
+ + ) +}) +FormItem.displayName = "FormItem" + +const FormLabel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => { + const { error, formItemId } = useFormField() + + return ( +