diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1dfdc49..faf82fa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,4 +28,4 @@ jobs: run: | npm run dev & sleep 10 # Wait for the server to start - curl -f http://localhost:5173 # Change this to the actual port your Vite server runs on \ No newline at end of file + curl -f http://localhost:5173 \ No newline at end of file diff --git a/src/App.tsx b/src/App.tsx index ace645b..29f53c9 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -42,7 +42,7 @@ export default function App() { const showSuccessToast = () => { toast({ title: 'Success', - description: 'Your operation was successful!', + description: 'Registered Successfully!', }); }; diff --git a/src/SelectItems.tsx b/src/SelectItems.tsx index ad8a685..564433a 100644 --- a/src/SelectItems.tsx +++ b/src/SelectItems.tsx @@ -2,7 +2,7 @@ import { SelectItem } from '@/components/ui/select'; export const SelectItems = () => ( <> - Computer Science + Computer Science and Engineering Computer Science and Systems Engineering Computer Science and Communication Engineering Electronics and Telecommunication Engineering @@ -10,7 +10,7 @@ export const SelectItems = () => ( Electronics and Electrical Engineering Electronics and Computer Science Engineering Mechanical Engineering - Mechantronics Engineering + Mechatronics Engineering Civil Engineering Information Technology Aerospace Engineering diff --git a/src/components/ui/toast.tsx b/src/components/ui/toast.tsx index 58f4bb0..cea2588 100644 --- a/src/components/ui/toast.tsx +++ b/src/components/ui/toast.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; -import { Cross2Icon } from '@radix-ui/react-icons'; -import * as ToastPrimitives from '@radix-ui/react-toast'; -import { cva, type VariantProps } from 'class-variance-authority'; -import { cn } from '@/lib/utils'; +import * as React from "react"; +import { Cross2Icon } from "@radix-ui/react-icons"; +import * as ToastPrimitives from "@radix-ui/react-toast"; +import { cva, type VariantProps } from "class-variance-authority"; +import { cn } from "@/lib/utils"; const ToastProvider = ToastPrimitives.Provider; @@ -13,7 +13,7 @@ const ToastViewport = React.forwardRef< (({ className, ...props }, ref) => ( )); @@ -103,7 +103,7 @@ const ToastDescription = React.forwardRef< >(({ className, ...props }, ref) => ( )); @@ -123,4 +123,4 @@ export { ToastDescription, ToastClose, ToastAction, -}; \ No newline at end of file +}; diff --git a/src/components/ui/toaster.tsx b/src/components/ui/toaster.tsx index 1e9cdb4..4370aa2 100644 --- a/src/components/ui/toaster.tsx +++ b/src/components/ui/toaster.tsx @@ -1,4 +1,4 @@ -import { useToast } from '../../hooks/use-toast'; +import { useToast } from "../../hooks/use-toast"; import { Toast, ToastClose, @@ -6,7 +6,7 @@ import { ToastProvider, ToastTitle, ToastViewport, -} from './toast'; +} from "./toast"; export function Toaster() { const { toasts } = useToast(); @@ -15,7 +15,11 @@ export function Toaster() { {toasts.map(function ({ id, title, description, action, ...props }) { return ( - +
{title && {title}} {description && ( @@ -30,4 +34,4 @@ export function Toaster() { ); -} \ No newline at end of file +} diff --git a/src/lib/schema.ts b/src/lib/schema.ts index fc95b0d..8fa5065 100644 --- a/src/lib/schema.ts +++ b/src/lib/schema.ts @@ -1,17 +1,27 @@ -import * as z from 'zod'; +import * as z from "zod"; export const formSchema = z.object({ - teamName: z.string().min(2, 'Team name must be at least 2 characters'), - fullName: z.string().min(2, 'Name must be at least 2 characters'), - rollNo: z.string().min(1, 'Roll number is required'), - email: z.string().email('Invalid email address'), - branch: z.string().min(1, 'Branch is required'), - teamMembers: z.array( - z.object({ - fullName: z.string().min(2, 'Name must be at least 2 characters'), - rollNo: z.string().min(1, 'Roll number is required'), - email: z.string().email('Invalid email address'), - branch: z.string().min(1, 'Branch is required'), - }).optional() - ).max(2, "You can only have up to 2 team members"), -}); \ No newline at end of file + teamName: z.string().min(2, "Team name must be at least 2 characters"), + fullName: z.string().min(2, "Name must be at least 2 characters"), + rollNo: z + .string() + .min(1, "Roll number is required") + .regex(/^\d{6,}$/, "Roll number must be a number with 6 or more digits"), + email: z + .string() + .email("Invalid email address") + .regex(/@kiit\.ac\.in$/, "Email must end with @kiit.ac.in"), + branch: z.string().min(1, "Branch is required"), + teamMembers: z + .array( + z + .object({ + fullName: z.string().min(2, "Name must be at least 2 characters"), + rollNo: z.string().min(1, "Roll number is required"), + email: z.string().email("Invalid email address"), + branch: z.string().min(1, "Branch is required"), + }) + .optional() + ) + .max(2, "You can only have up to 2 team members"), +});