From 11a742b6da1c1ab812efe6b48250ad272e38b44f Mon Sep 17 00:00:00 2001 From: Kavya Rambhia <161142013+kavya-r30@users.noreply.github.com> Date: Thu, 23 Jan 2025 22:47:23 +0530 Subject: [PATCH 1/2] Added Forms --- package-lock.json | 72 +++++++++++- package.json | 5 +- src/App.jsx | 2 + src/Components/ProposalFields.jsx | 10 ++ src/Components/ProposalForm.jsx | 176 +++++++++++++++++++++++++++++ src/Components/ProposalPreview.jsx | 57 ++++++++++ 6 files changed, 320 insertions(+), 2 deletions(-) create mode 100644 src/Components/ProposalFields.jsx create mode 100644 src/Components/ProposalForm.jsx create mode 100644 src/Components/ProposalPreview.jsx diff --git a/package-lock.json b/package-lock.json index 1bc508ef8..53c21cd65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "name": "dbms", "version": "0.0.0", "dependencies": { + "@hookform/resolvers": "^3.10.0", "axios": "^1.6.8", "framer-motion": "^11.1.7", "gsap": "^3.12.5", @@ -16,6 +17,7 @@ "react-chrono": "^2.6.1", "react-d3-cloud": "^1.0.6", "react-dom": "^18.2.0", + "react-hook-form": "^7.54.2", "react-icon-cloud": "^1.1.3", "react-icons": "^5.2.1", "react-router-dom": "^6.23.0", @@ -24,7 +26,8 @@ "simple-icons": "^5.24.0", "stats.js": "^0.17.0", "three": "^0.165.0", - "uuid": "^8.3.2" + "uuid": "^8.3.2", + "yup": "^1.6.1" }, "devDependencies": { "@types/react": "^18.2.66", @@ -2714,6 +2717,15 @@ "@hapi/hoek": "^9.0.0" } }, + "node_modules/@hookform/resolvers": { + "version": "3.10.0", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.10.0.tgz", + "integrity": "sha512-79Dv+3mDF7i+2ajj7SkypSKHhl1cbln1OGavqrsF7p6mbUv11xpqpacPsGDCTRvCSjEEIez2ef1NveSVL3b0Ag==", + "license": "MIT", + "peerDependencies": { + "react-hook-form": "^7.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.14", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.14.tgz", @@ -9808,6 +9820,12 @@ "react-is": "^16.13.1" } }, + "node_modules/property-expr": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/property-expr/-/property-expr-2.0.6.tgz", + "integrity": "sha512-SVtmxhRE/CGkn3eZY1T6pC8Nln6Fr/lu1mKSgRud0eC73whjGfoAogbn78LkD8aFL0zz3bAFerKSnOl7NlErBA==", + "license": "MIT" + }, "node_modules/proxy-from-env": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", @@ -9985,6 +10003,22 @@ "react": "*" } }, + "node_modules/react-hook-form": { + "version": "7.54.2", + "resolved": "https://registry.npmjs.org/react-hook-form/-/react-hook-form-7.54.2.tgz", + "integrity": "sha512-eHpAUgUjWbZocoQYUHposymRb4ZP6d0uwUnooL2uOybA9/3tPUvoAKqEWK1WaSiTxxOfTpffNZP7QwlnM3/gEg==", + "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-hooks-visible": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/react-hooks-visible/-/react-hooks-visible-1.1.1.tgz", @@ -11712,6 +11746,12 @@ "safe-buffer": "~5.1.0" } }, + "node_modules/tiny-case": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tiny-case/-/tiny-case-1.0.3.tgz", + "integrity": "sha512-Eet/eeMhkO6TX8mnUteS9zgPbUMQa4I6Kkp5ORiBD5476/m+PIRiumP5tmh5ioJpH7k51Kehawy2UDfsnxxY8Q==", + "license": "MIT" + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -11747,6 +11787,12 @@ "node": ">=0.6" } }, + "node_modules/toposort": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/toposort/-/toposort-2.0.2.tgz", + "integrity": "sha512-0a5EOkAUp8D4moMi2W8ZF8jcga7BgZd91O/yabJCFY8az+XSzeGyTKs0Aoo897iV1Nj6guFq8orWDS96z91oGg==", + "license": "MIT" + }, "node_modules/tr46": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", @@ -12480,6 +12526,30 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/yup": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/yup/-/yup-1.6.1.tgz", + "integrity": "sha512-JED8pB50qbA4FOkDol0bYF/p60qSEDQqBD0/qeIrUCG1KbPBIQ776fCUNb9ldbPcSTxA69g/47XTo4TqWiuXOA==", + "license": "MIT", + "dependencies": { + "property-expr": "^2.0.5", + "tiny-case": "^1.0.3", + "toposort": "^2.0.2", + "type-fest": "^2.19.0" + } + }, + "node_modules/yup/node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/zdog": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/zdog/-/zdog-1.1.3.tgz", diff --git a/package.json b/package.json index d555ef09d..40b84865c 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@hookform/resolvers": "^3.10.0", "axios": "^1.6.8", "framer-motion": "^11.1.7", "gsap": "^3.12.5", @@ -18,6 +19,7 @@ "react-chrono": "^2.6.1", "react-d3-cloud": "^1.0.6", "react-dom": "^18.2.0", + "react-hook-form": "^7.54.2", "react-icon-cloud": "^1.1.3", "react-icons": "^5.2.1", "react-router-dom": "^6.23.0", @@ -26,7 +28,8 @@ "simple-icons": "^5.24.0", "stats.js": "^0.17.0", "three": "^0.165.0", - "uuid": "^8.3.2" + "uuid": "^8.3.2", + "yup": "^1.6.1" }, "devDependencies": { "@types/react": "^18.2.66", diff --git a/src/App.jsx b/src/App.jsx index 99d8d90b1..ce5035316 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -15,6 +15,7 @@ import VerticalTimeline from './Components/Timeline'; import Carousel from './Components/Carousel'; import Hero from './Components/Hero'; import Footer from "./Components/Footer" +import ProposalForm from './Components/ProposalForm'; const Homepage = () => { @@ -54,6 +55,7 @@ function App() { {/* } /> */} {/* } /> */} + } />