diff --git a/Frontend-team/package-lock.json b/Frontend-team/package-lock.json index c3bb9ab9..57685206 100644 --- a/Frontend-team/package-lock.json +++ b/Frontend-team/package-lock.json @@ -8,6 +8,7 @@ "name": "frontend-team", "version": "0.0.0", "dependencies": { + "@hookform/resolvers": "^3.9.1", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-tabs": "^1.1.1", "@reduxjs/toolkit": "^2.3.0", @@ -21,13 +22,15 @@ "octokit": "^4.0.3", "react": "^18.3.1", "react-dom": "^18.3.1", + "react-hook-form": "^7.54.2", "react-redux": "^9.1.2", "react-router-dom": "^6.28.0", "react-tag-autocomplete": "^7.4.0", "react-tag-maker": "^1.1.0", "tailwind-merge": "^2.5.4", "tailwind-scrollbar": "^3.1.0", - "tailwindcss-animate": "^1.0.7" + "tailwindcss-animate": "^1.0.7", + "zod": "^3.24.1" }, "devDependencies": { "@eslint/js": "^9.13.0", @@ -1225,6 +1228,15 @@ "node": ">=6" } }, + "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==", + "license": "MIT", + "peerDependencies": { + "react-hook-form": "^7.0.0" + } + }, "node_modules/@humanfs/core": { "version": "0.19.1", "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz", @@ -4811,6 +4823,22 @@ "react": "^18.3.1" } }, + "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-icons": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/react-icons/-/react-icons-5.2.1.tgz", @@ -5888,6 +5916,15 @@ "funding": { "url": "https://github.com/sponsors/sindresorhus" } + }, + "node_modules/zod": { + "version": "3.24.1", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", + "integrity": "sha512-muH7gBL9sI1nciMZV67X5fTKKBLtwpZ5VBp1vsOQzj1MhrBZ4wlVCm3gedKZWLp0Oyel8sIGfeiz54Su+OVT+A==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } } } } diff --git a/Frontend-team/package.json b/Frontend-team/package.json index 8b5271fe..5e721820 100644 --- a/Frontend-team/package.json +++ b/Frontend-team/package.json @@ -10,6 +10,7 @@ "preview": "vite preview" }, "dependencies": { + "@hookform/resolvers": "^3.9.1", "@radix-ui/react-slot": "^1.1.0", "@radix-ui/react-tabs": "^1.1.1", "@reduxjs/toolkit": "^2.3.0", @@ -23,13 +24,15 @@ "octokit": "^4.0.3", "react": "^18.3.1", "react-dom": "^18.3.1", + "react-hook-form": "^7.54.2", "react-redux": "^9.1.2", "react-router-dom": "^6.28.0", "react-tag-autocomplete": "^7.4.0", "react-tag-maker": "^1.1.0", "tailwind-merge": "^2.5.4", "tailwind-scrollbar": "^3.1.0", - "tailwindcss-animate": "^1.0.7" + "tailwindcss-animate": "^1.0.7", + "zod": "^3.24.1" }, "devDependencies": { "@eslint/js": "^9.13.0", diff --git a/Frontend-team/src/App.tsx b/Frontend-team/src/App.tsx index 10543982..f827b137 100644 --- a/Frontend-team/src/App.tsx +++ b/Frontend-team/src/App.tsx @@ -90,4 +90,4 @@ function App() { ); } -export default App; +export default App; \ No newline at end of file diff --git a/Frontend-team/src/components/Github.tsx b/Frontend-team/src/components/Github.tsx index bf50f02c..f67949f3 100644 --- a/Frontend-team/src/components/Github.tsx +++ b/Frontend-team/src/components/Github.tsx @@ -54,9 +54,9 @@ const GitHubAuth: React.FC = () => { } }, []); - const handleLogin = () => { - window.location.href = "https://ethopensource.onrender.com/auth/github"; - }; + // const handleLogin = () => { + // window.location.href = "https://ethopensource.onrender.com/auth/github"; + // }; return (
diff --git a/Frontend-team/src/components/Layout/Navbar.tsx b/Frontend-team/src/components/Layout/Navbar.tsx index 4a948bb4..0ca28275 100644 --- a/Frontend-team/src/components/Layout/Navbar.tsx +++ b/Frontend-team/src/components/Layout/Navbar.tsx @@ -2,25 +2,24 @@ import { Navbar } from 'flowbite-react'; import { useState } from 'react'; import CustomBtn from '../Common/CustomBtn'; import { Link, useNavigate } from 'react-router-dom'; -import { useDispatch, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import { RootState } from '@/store'; // import { DarkThemeToggle } from 'flowbite-react'; import notificationIcon from "../../assets/icons/notificationIcon.svg" -import { - // loginWithGitHub, - // loginWithGoogle, - // loginWithEmailPassword, loginWithGitHub, loginWithGoogle, - logout } from '@/store/actions/auth'; -import git from "../../assets/icons/gith.svg"; +import githubIcon from "../../assets/icons/githubIcon.png"; + +// import git from "../../assets/icons/gith.svg"; // import { Button } from '../ui/button'; -import { setLoginType } from '@/store/actions/onboardState'; +// import { setLoginType } from '@/store/actions/onboardState'; +import { redirectToGitHubAuth } from '@/services/api'; export default function Navigation() { const [activeLink, setActiveLink] = useState('Home'); // Initial active link const { user } = useSelector((state: RootState) => state.auth); // const { loginType:isLogin } = useSelector((state: RootState) => state.onboardState); const [isProfile, setIsProfile] = useState(false); // const [isDroped, setIsDroped] = useState(false); - const dispatch = useDispatch(); + // const dispatch = useAppDispatch(); + // const { role, loginType } = useSelector((state: RootState) => state.onboardState); @@ -30,16 +29,16 @@ export default function Navigation() { // // { title: "Login with Google", icon: google, type:"google" }, // ] - const handleLogin = (logintype:string,) => { - dispatch(setLoginType(logintype)) - if(logintype === "github"){ - navigate("/onboarding") + // const handleLogin = (logintype:string,) => { + // dispatch(setLoginType(logintype)) + // if(logintype === "github"){ + // navigate("/onboarding") - } else if(logintype === "google"){ - // dispatch(loginWithGoogle()) - navigate("/onboarding") - } - } + // } else if(logintype === "google"){ + // // dispatch(loginWithGoogle()) + // navigate("/onboarding") + // } + // } // const DropdownLogin = () => { // return (
//

Choose Login Type

@@ -59,7 +58,7 @@ export default function Navigation() { //
) // } - +// console.log(user) return ( @@ -69,16 +68,16 @@ export default function Navigation() { {user ?
{ navigate("/notifications") }} /> - setIsProfile(!isProfile)} /> + setIsProfile(!isProfile)} /> setIsProfile(!isProfile)} /> {isProfile && }
:
- handleLogin("github")} /> + redirectToGitHubAuth()} />
} {/* */} diff --git a/Frontend-team/src/components/Specific/exploreProjects/ExploreProjec.tsx b/Frontend-team/src/components/Specific/exploreProjects/ExploreProjec.tsx index 3653c07b..134663dc 100644 --- a/Frontend-team/src/components/Specific/exploreProjects/ExploreProjec.tsx +++ b/Frontend-team/src/components/Specific/exploreProjects/ExploreProjec.tsx @@ -1,6 +1,6 @@ const ExploreProjec = () => { return ( -
+
void; + onSubmit: (formData: FormData) => void; +} + +const CreateProjectModal: React.FC = ({ isOpen, onClose }) => { + const [formValues, setFormValues] = useState({ + title: "", + description: "", + type: "", + rewards: "", + experienceLevel: "", + skillsRequired: "", + projectImage: null as File | null, + }); + + const handleInputChange = (e: React.ChangeEvent) => { + const { name, value } = e.target; + setFormValues({ ...formValues, [name]: value }); + // onSubmit("") + }; + + const handleFileChange = (e: React.ChangeEvent) => { + if (e.target.files) { + setFormValues({ ...formValues, projectImage: e.target.files[0] }); + } + }; + + // console.log(formValues) + + const handleSubmit = () => { + const formData = new FormData(); + // Object.entries(formValues).forEach(([key, value]) => { + // if (value) formData.append(key, value as any); + // }); + // onSubmit(formValues as any); + console.log(formData) + }; + + if (!isOpen) return null; + + return ( +
+
+

Create New Project

+
+ +