diff --git a/PROJECT_STRUCTURE.md b/PROJECT_STRUCTURE.md index c35e9da..dc45355 100644 --- a/PROJECT_STRUCTURE.md +++ b/PROJECT_STRUCTURE.md @@ -22,6 +22,11 @@ │ ├── Newsletter.png │ ├── avatar.png │ ├── avatar1.png +│ ├── certi 1.svg +│ ├── certi 2.svg +│ ├── certi 3.svg +│ ├── certi 4.png +│ ├── certi 5.png │ ├── dev1.jpeg │ ├── dev2.jpeg │ ├── dev3.jpeg @@ -66,6 +71,8 @@ │ │ │ │ └── page.jsx │ │ │ ├── AddHackathon/ │ │ │ │ └── page.jsx +│ │ │ ├── Certifications/ +│ │ │ │ └── page.jsx │ │ │ ├── Chapters/ │ │ │ │ └── page.jsx │ │ │ ├── Events/ @@ -133,8 +140,6 @@ │ │ │ │ │ └── page.jsx │ │ │ │ ├── opportunities.js │ │ │ │ └── page.jsx -│ │ │ ├── certifications/ -│ │ │ │ └── page.jsx │ │ │ ├── devStudent/ │ │ │ │ └── page.jsx │ │ │ ├── devprod/ diff --git a/data.json b/data.json index a943593..bb8ee2e 100644 --- a/data.json +++ b/data.json @@ -639,8 +639,7 @@ "youtubeLink": "https://www.youtube.com/watch?v=3N1Cg7nM3Bg" } ], - "events": { - "finished": [ + "events": [ { "id": "1", "title": "Tech for Good Hackathon", @@ -676,9 +675,7 @@ "status": "finished", "organizers": ["GDSC RCCIIT"], "participants": 50 - } - ], - "ongoing": [ + }, { "id": "3", "title": "AI & ML Workshop", @@ -691,9 +688,7 @@ "status": "ongoing", "organizers": ["GDSC RCCIIT"], "participants": 80 - } - ], - "upcoming": [ + }, { "id": "4", "title": "Cloud Computing Seminar", @@ -723,5 +718,4 @@ "participants": 0 } ] - } } \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7d8af26..5644b80 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,11 @@ "dependencies": { "@emotion/react": "^11.13.3", "@emotion/styled": "^11.13.0", + + + "@google/generative-ai": "^0.21.0", + "@hookform/resolvers": "^3.9.1", + "@mui/icons-material": "^6.1.5", "@mui/material": "^6.1.5", "@radix-ui/react-aspect-ratio": "^1.1.0", "@radix-ui/react-collapsible": "^1.1.1", @@ -44,10 +49,10 @@ "react-toastify": "^10.0.6", "sonner": "^1.5.0", "styled-components": "^6.1.13", - "styled-components": "^6.1.13", "tailwind-merge": "^2.5.3", "tailwindcss-animate": "^1.0.7", - "vaul": "^1.0.0" + "vaul": "^1.0.0", + "zod": "^3.23.8" }, "devDependencies": { "postcss": "^8", @@ -383,6 +388,14 @@ "integrity": "sha512-kym7SodPp8/wloecOpcmSnWJsK7M0E5Wg8UcFA+uO4B9s5d0ywXOEro/8HM9x0rW+TljRzul/14UYz3TleT3ig==", "license": "MIT" }, + "node_modules/@hookform/resolvers": { + "version": "3.9.1", + "resolved": "https://registry.npmjs.org/@hookform/resolvers/-/resolvers-3.9.1.tgz", + "integrity": "sha512-ud2HqmGBM0P0IABqoskKWI6PEf6ZDDBZkFqe2Vnl+mTHCEHzr3ISjjZyCwTjC/qpL25JC9aIDkloQejvMeq0ug==", + "peerDependencies": { + "react-hook-form": "^7.0.0" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1959,11 +1972,6 @@ "@types/react": "*" } }, - "node_modules/@types/stylis": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", - "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==" - }, "node_modules/@types/stylis": { "version": "4.2.5", "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", @@ -2114,14 +2122,6 @@ "node": ">= 6" } }, - "node_modules/camelize": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", - "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/camelize": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", @@ -2664,24 +2664,6 @@ "node": ">= 8" } }, - "node_modules/css-color-keywords": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", - "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", - "engines": { - "node": ">=4" - } - }, - "node_modules/css-to-react-native": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", - "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", - "dependencies": { - "camelize": "^1.0.0", - "css-color-keywords": "^1.0.0", - "postcss-value-parser": "^4.0.2" - } - }, "node_modules/css-color-keywords": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", @@ -3992,11 +3974,6 @@ "loose-envify": "^1.1.0" } }, - "node_modules/shallowequal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==" - }, "node_modules/shallowequal": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", @@ -4168,88 +4145,6 @@ "node": ">=8" } }, - "node_modules/styled-components": { - "version": "6.1.13", - "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.13.tgz", - "integrity": "sha512-M0+N2xSnAtwcVAQeFEsGWFFxXDftHUD7XrKla06QbpUMmbmtFBMMTcKWvFXtWxuD5qQkB8iU5gk6QASlx2ZRMw==", - "dependencies": { - "@emotion/is-prop-valid": "1.2.2", - "@emotion/unitless": "0.8.1", - "@types/stylis": "4.2.5", - "css-to-react-native": "3.2.0", - "csstype": "3.1.3", - "postcss": "8.4.38", - "shallowequal": "1.1.0", - "stylis": "4.3.2", - "tslib": "2.6.2" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/styled-components" - }, - "peerDependencies": { - "react": ">= 16.8.0", - "react-dom": ">= 16.8.0" - } - }, - "node_modules/styled-components/node_modules/@emotion/is-prop-valid": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", - "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", - "dependencies": { - "@emotion/memoize": "^0.8.1" - } - }, - "node_modules/styled-components/node_modules/@emotion/memoize": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", - "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==" - }, - "node_modules/styled-components/node_modules/@emotion/unitless": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", - "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==" - }, - "node_modules/styled-components/node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/styled-components/node_modules/stylis": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", - "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==" - }, - "node_modules/styled-components/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" - }, "node_modules/styled-components": { "version": "6.1.13", "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.13.tgz", @@ -4679,6 +4574,14 @@ "engines": { "node": ">= 6" } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/package.json b/package.json index 26c1009..60671c6 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@emotion/styled": "^11.13.0", "@google/generative-ai": "^0.21.0", + "@hookform/resolvers": "^3.9.1", "@mui/icons-material": "^6.1.5", "@mui/material": "^6.1.5", @@ -55,7 +56,8 @@ "styled-components": "^6.1.13", "tailwind-merge": "^2.5.3", "tailwindcss-animate": "^1.0.7", - "vaul": "^1.0.0" + "vaul": "^1.0.0", + "zod": "^3.23.8" }, "devDependencies": { "postcss": "^8", diff --git a/repo_structure.txt b/repo_structure.txt index f1c42a9..0f67f3d 100644 --- a/repo_structure.txt +++ b/repo_structure.txt @@ -18,6 +18,11 @@ │ ├── Newsletter.png │ ├── avatar.png │ ├── avatar1.png +│ ├── certi 1.svg +│ ├── certi 2.svg +│ ├── certi 3.svg +│ ├── certi 4.png +│ ├── certi 5.png │ ├── dev1.jpeg │ ├── dev2.jpeg │ ├── dev3.jpeg @@ -62,6 +67,8 @@ │ │ │ │ └── page.jsx │ │ │ ├── AddHackathon/ │ │ │ │ └── page.jsx +│ │ │ ├── Certifications/ +│ │ │ │ └── page.jsx │ │ │ ├── Chapters/ │ │ │ │ └── page.jsx │ │ │ ├── Events/ @@ -129,8 +136,6 @@ │ │ │ │ │ └── page.jsx │ │ │ │ ├── opportunities.js │ │ │ │ └── page.jsx -│ │ │ ├── certifications/ -│ │ │ │ └── page.jsx │ │ │ ├── devStudent/ │ │ │ │ └── page.jsx │ │ │ ├── devprod/ diff --git a/src/app/(pages)/AddEvent/page.jsx b/src/app/(pages)/AddEvent/page.jsx new file mode 100644 index 0000000..d969f97 --- /dev/null +++ b/src/app/(pages)/AddEvent/page.jsx @@ -0,0 +1,136 @@ +'use client' +import AddEventForm from "@/components/Global/AddEventForm"; +import { Card } from "@/components/ui/card"; +import { motion } from "framer-motion"; +import { useState, useEffect } from "react"; + +const AddEventSkeleton = () => ( +
+
+ + {/* Skeleton floating circles */} +
+
+
+
+ + {/* Skeleton for text content */} +
+
+
+
+
+ + {/* Skeleton for buttons */} +
+
+
+
+
+
+); + +const AddEvent = () => { + const [loading, setLoading] = useState(true); + + // Simulate loading delay + useEffect(() => { + const timer = setTimeout(() => setLoading(false), 2000); // Adjust duration as needed + return () => clearTimeout(timer); + }, []); + + if (loading) { + return ; + } + + return ( +
+ + {/* Floating Circles with subtle scaling and hovering animation */} + + + + + + + + + + + + {/* Centered White Box */} +
+
+
+ + Events Form + + + + Add a new event so our community can become bigger and better! + +
+ + {/* Your form content goes here */} + +
+
+ ); +}; + +export default AddEvent; diff --git a/src/app/(pages)/AddProjects/page.jsx b/src/app/(pages)/AddProjects/page.jsx new file mode 100644 index 0000000..f68afc1 --- /dev/null +++ b/src/app/(pages)/AddProjects/page.jsx @@ -0,0 +1,137 @@ +'use client' +import AddHackathonForm from "@/components/Global/AddHackathonForm"; +import ProjectForm from "@/components/Global/AddProjectsForm"; +import { Card } from "@/components/ui/card"; +import { motion } from "framer-motion"; +import { useState, useEffect } from "react"; + +const AddProjectSkeleton = () => ( +
+
+ + {/* Skeleton floating circles */} +
+
+
+
+ + {/* Skeleton for text content */} +
+
+
+
+
+ + {/* Skeleton for buttons */} +
+
+
+
+
+
+); + +const AddProject = () => { + const [loading, setLoading] = useState(true); + + // Simulate loading delay + useEffect(() => { + const timer = setTimeout(() => setLoading(false), 2000); // Adjust duration as needed + return () => clearTimeout(timer); + }, []); + + if (loading) { + return ; + } + + return ( +
+ + {/* Floating Circles with subtle scaling and hovering animation */} + + + + + + + + + + + + {/* Centered White Box */} +
+
+
+ + Projects Form + + + + Add a new Project that the GDSC developers have built right now! + +
+ + {/* Your form content goes here */} + +
+
+ ); +}; + +export default AddProject; diff --git a/src/app/(pages)/TechToolkits/page.jsx b/src/app/(pages)/TechToolkits/page.jsx index c7a1de9..5f58736 100644 --- a/src/app/(pages)/TechToolkits/page.jsx +++ b/src/app/(pages)/TechToolkits/page.jsx @@ -1,161 +1,248 @@ "use client"; -import React from 'react'; +import React from "react"; import { - Card, - CardContent, - CardHeader, - Grid, - Typography, - IconButton, - Container, - Button, - Box, -} from '@mui/material'; + Card, + CardContent, + CardHeader, + Grid, + Typography, + IconButton, + Container, + Button, + Box, +} from "@mui/material"; +import { motion } from "framer-motion"; -import techStacks from './techStacks'; +import techStacks from "./techStacks"; const TechToolkits = () => { - return ( - - - Tech Toolkits HUB - - - Explore the essential tools and technologies for web development, programming, and cloud platforms. - + return ( + <> + +
+ + Tech Toolkits HUB + - - {techStacks.map((stack, index) => ( - - - - - - {stack.icons.map((item, idx) => ( - - {item.icon} - - ))} - - - - - ))} - + + Explore the essential tools and technologies for web development, + programming, and cloud platforms. + +
- {/* Resources Section */} - - - Resources for Beginners - - - {[ - { name: 'FreeCodeCamp', link: 'https://www.freecodecamp.org/' }, - { name: 'Codecademy', link: 'https://www.codecademy.com/' }, - { name: 'MDN Web Docs', link: 'https://developer.mozilla.org/en-US/' }, - { name: 'W3Schools', link: 'https://www.w3schools.com/' }, - ].map((resource, idx) => ( - - - - ))} + + {techStacks.map((stack, index) => ( + + + + + + {stack.icons.map((item, idx) => ( + + + {item.icon} + + + {item.name} + + + ))} - + + + + ))} + - {/* Tips Section */} - - - Tips for Getting Started - -
    - {['Start with the basics: Choose a programming language and master the fundamentals.', - 'Practice coding every day: Regular practice helps reinforce learning.', - 'Build projects: Apply what you learn by creating your own projects.', - 'Join coding communities: Engage with others to ask questions and share knowledge.' - ].map((tip, idx) => ( -
  • - - {tip} - -
  • - ))} -
-
+ {/* Resources Section */} + + + Resources for Beginners + + + {[ + { name: "FreeCodeCamp", link: "https://www.freecodecamp.org/" }, + { name: "Codecademy", link: "https://www.codecademy.com/" }, + { + name: "MDN Web Docs", + link: "https://developer.mozilla.org/en-US/", + }, + { name: "W3Schools", link: "https://www.w3schools.com/" }, + ].map((resource, idx) => ( + + + + ))} + + - {/* Community Section */} - - - Join Our Community - - - {[ - { name: 'Stack Overflow', link: 'https://stackoverflow.com/' }, - { name: 'r/learnprogramming', link: 'https://www.reddit.com/r/learnprogramming/' }, - { name: 'Dev.to', link: 'https://dev.to/' }, - ].map((community, idx) => ( - - - - ))} - - -
- ); + {/* Tips Section */} + + + Tips for Getting Started + +
+
    + {[ + "Start with the basics: Choose a programming language and master the fundamentals.", + "Practice coding every day: Regular practice helps reinforce learning.", + "Build projects: Apply what you learn by creating your own projects.", + "Join coding communities: Engage with others to ask questions and share knowledge.", + ].map((tip, idx) => ( +
  • +
    + + + +
    +

    {tip}

    +
  • + ))} +
+
+
+
+ +
+
+ + + +
+
+
+

+ Join Our Community +

+

+ Join us on this exciting adventure of learning and grabbing new opportunities every time you meet a person. + Each of us is here to learn, network and grow. So what's stopping you!!! Come on in !!! +

+ + {[ + { name: "Stack Overflow", link: "https://stackoverflow.com/" }, + { + name: "r/learnprogramming", + link: "https://www.reddit.com/r/learnprogramming/", + }, + { name: "Dev.to", link: "https://dev.to/" }, + ].map((community, idx) => ( + + + + ))} + + +
+
+
+ + ); }; export default TechToolkits; - diff --git a/src/app/(pages)/TechToolkits/techStacks.js b/src/app/(pages)/TechToolkits/techStacks.js index d63029f..9b0126e 100644 --- a/src/app/(pages)/TechToolkits/techStacks.js +++ b/src/app/(pages)/TechToolkits/techStacks.js @@ -23,57 +23,57 @@ const techStacks = [ { title: 'MERN Stack', icons: [ - { icon: , link: 'https://www.mongodb.com/docs/' }, - { icon: , link: 'https://nodejs.org/en/docs/' }, - { icon: , link: 'https://reactjs.org/docs/getting-started.html' }, - { icon: , link: 'https://expressjs.com/en/starter/installing.html' }, + { icon: , name: 'MongoDB', link: 'https://www.mongodb.com/docs/' }, + { icon: , name: 'Node.js', link: 'https://nodejs.org/en/docs/' }, + { icon: , name: 'React', link: 'https://reactjs.org/docs/getting-started.html' }, + { icon: , name: 'Express', link: 'https://expressjs.com/en/starter/installing.html' }, ], }, { title: 'MEAN Stack', icons: [ - { icon: , link: 'https://www.mongodb.com/docs/' }, - { icon: , link: 'https://expressjs.com/en/starter/installing.html' }, - { icon: , link: 'https://angular.io/docs' }, - { icon: , link: 'https://nodejs.org/en/docs/' }, + { icon: , name: 'MongoDB', link: 'https://www.mongodb.com/docs/' }, + { icon: , name: 'Express', link: 'https://expressjs.com/en/starter/installing.html' }, + { icon: , name: 'Angular', link: 'https://angular.io/docs' }, + { icon: , name: 'Node.js', link: 'https://nodejs.org/en/docs/' }, ], }, { title: 'LAMP Stack', icons: [ - { icon: , link: 'https://www.linux.org/pages/download/' }, - { icon: , link: 'https://httpd.apache.org/docs/' }, - { icon: , link: 'https://dev.mysql.com/doc/' }, - { icon: , link: 'https://www.php.net/docs.php' }, + { icon: , name: 'Linux', link: 'https://www.linux.org/pages/download/' }, + { icon: , name: 'Apache', link: 'https://httpd.apache.org/docs/' }, + { icon: , name: 'MySQL', link: 'https://dev.mysql.com/doc/' }, + { icon: , name: 'PHP', link: 'https://www.php.net/docs.php' }, ], }, { title: 'DevOps Tools', icons: [ - { icon: , link: 'https://docs.docker.com/' }, - { icon: , link: 'https://gitforwindows.org/' }, + { icon: , name: 'Docker', link: 'https://docs.docker.com/' }, + { icon: , name: 'Git for Windows', link: 'https://gitforwindows.org/' }, ], }, { title: 'Cloud Platforms', icons: [ - { icon: , link: 'https://aws.amazon.com/documentation/' }, - { icon: , link: 'https://docs.microsoft.com/en-us/azure/' }, + { icon: , name: 'AWS Amplify', link: 'https://aws.amazon.com/documentation/' }, + { icon: , name: 'Azure DevOps', link: 'https://docs.microsoft.com/en-us/azure/' }, ], }, { title: 'Code Editors', icons: [ - { icon: , link: 'https://code.visualstudio.com/docs' }, - { icon: , link: 'https://www.sublimetext.com/docs/' }, - { icon: , link: 'https://www.jetbrains.com/pycharm/docs/' }, + { icon: , name: 'Visual Studio Code', link: 'https://code.visualstudio.com/docs' }, + { icon: , name: 'Sublime Text', link: 'https://www.sublimetext.com/docs/' }, + { icon: , name: 'PyCharm', link: 'https://www.jetbrains.com/pycharm/docs/' }, ], }, { title: 'Programming Languages', icons: [ - { icon: , link: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript' }, - { icon: , link: 'https://www.python.org/doc/' }, + { icon: , name: 'JavaScript', link: 'https://developer.mozilla.org/en-US/docs/Web/JavaScript' }, + { icon: , name: 'Python', link: 'https://www.python.org/doc/' }, ], }, ]; diff --git a/src/components/Global/AddEventForm.jsx b/src/components/Global/AddEventForm.jsx new file mode 100644 index 0000000..cf6173d --- /dev/null +++ b/src/components/Global/AddEventForm.jsx @@ -0,0 +1,162 @@ +'use client' +import axios from 'axios'; +import React, { useEffect, useState } from 'react'; +import { useForm, useFieldArray } from 'react-hook-form'; +import { Input } from "@/components/ui/input"; +import { Textarea } from "@/components/ui/textarea"; +import { Button } from "@/components/ui/button"; +import { Card } from "@/components/ui/card"; +import { Label } from "@/components/ui/label"; +import { + Select, + SelectTrigger, + SelectContent, + SelectItem, +} from "@/components/ui/select"; + +export default function AddEventForm() { + const { register, handleSubmit, control } = useForm(); + const [nextId, setNextId] = useState(null); + + useEffect(() => { + // Fetch current count of hackathons for unique ID assignment + axios + .get("http://localhost:5000/events") + .then((response) => { + setNextId(response.data.length + 1); + console.log("id that was fetched ", response.data.length); + }) + .catch((error) => + console.error("Error fetching hackathons count:", error) + ); + }, []); + + + const onSubmit = (data) => { + console.log("Submitted Data:", data); + const eventsData = { + id: nextId.toString(), + title: data.title, + description: data.description, + date: { + start: data.startDate, + end: data.endDate, + }, + location: data.location, + status: data.status, + registrationLink: data.registrationLink, + organizers: data.organizers.split(", "), + participants: data.participants, + }; + console.log("eventsData",eventsData); + }; + + return ( +
+
+ + + + +