diff --git a/package-lock.json b/package-lock.json index 589a4fa..e8785db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,15 +8,19 @@ "name": "cohortgate", "version": "0.0.0", "dependencies": { + "@hookform/resolvers": "^5.0.1", "@tailwindcss/vite": "^4.0.12", "bootstrap": "^5.3.3", "firebase": "^11.4.0", "react": "^19.0.0", "react-bootstrap": "^2.10.9", "react-dom": "^19.0.0", + "react-hook-form": "^7.55.0", + "react-icons": "^5.5.0", "react-router": "^7.3.0", "react-router-dom": "^7.3.0", - "tailwindcss": "^4.0.12" + "tailwindcss": "^4.0.12", + "zod": "^3.24.2" }, "devDependencies": { "@eslint/js": "^9.21.0", @@ -1425,6 +1429,18 @@ "node": ">=6" } }, + "node_modules/@hookform/resolvers": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-5.0.1.tgz", + "integrity": "sha512-u/+Jp83luQNx9AdyW2fIPGY6Y7NG68eN2ZW8FOJYL+M0i4s49+refdJdOp/A9n9HFQtQs3HIDHQvX3ZET2o7YA==", + "license": "MIT", + "dependencies": { + "@standard-schema/utils": "^0.3.0" + }, + "peerDependencies": { + "react-hook-form": "^7.55.0" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -1889,6 +1905,12 @@ "win32" ] }, + "node_modules/@standard-schema/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", + "license": "MIT" + }, "node_modules/@swc/helpers": { "version": "0.5.15", "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", @@ -3672,6 +3694,31 @@ "react": "^19.0.0" } }, + "node_modules/react-hook-form": { + "version": "7.55.0", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.55.0.tgz", + "integrity": "sha512-XRnjsH3GVMQz1moZTW53MxfoWN7aDpUg/GpVNc4A3eXRVNdGXfbzJ4vM4aLQ8g6XCUh1nIbx70aaNCl7kxnjog==", + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-hook-form" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17 || ^18 || ^19" + } + }, + "node_modules/react-icons": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.5.0.tgz", + "integrity": "sha512-MEFcXdkP3dLo8uumGI5xN3lDFNsRtrjbOEKDLD7yv76v4wpnEq2Lt2qeHaQOr34I/wPN3s3+N08WkQ+CW37Xiw==", + "license": "MIT", + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", @@ -4206,6 +4253,15 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.24.2", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz", + "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index f6c203a..619bcc0 100644 --- a/package.json +++ b/package.json @@ -10,15 +10,19 @@ "preview": "vite preview" }, "dependencies": { + "@hookform/resolvers": "^5.0.1", "@tailwindcss/vite": "^4.0.12", "bootstrap": "^5.3.3", "firebase": "^11.4.0", "react": "^19.0.0", "react-bootstrap": "^2.10.9", "react-dom": "^19.0.0", + "react-hook-form": "^7.55.0", + "react-icons": "^5.5.0", "react-router": "^7.3.0", "react-router-dom": "^7.3.0", - "tailwindcss": "^4.0.12" + "tailwindcss": "^4.0.12", + "zod": "^3.24.2" }, "devDependencies": { "@eslint/js": "^9.21.0", diff --git a/src/components/Form/Form.jsx b/src/components/Form/Form.jsx index 5fbd65a..df916b7 100644 --- a/src/components/Form/Form.jsx +++ b/src/components/Form/Form.jsx @@ -1,7 +1,215 @@ -import React from "react"; +import React, { useState,useRef,useEffect } from "react"; +import { useForm } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { z } from "zod"; +import { FaSpinner } from "react-icons/fa"; -function Form() { - return
{successMessage}
+ )} + + +