diff --git a/src/Components/ConfirmEmail/ConfirmEmail.js b/src/Components/ConfirmEmail/ConfirmEmail.js index 161a0623..ac375d98 100644 --- a/src/Components/ConfirmEmail/ConfirmEmail.js +++ b/src/Components/ConfirmEmail/ConfirmEmail.js @@ -1,4 +1,4 @@ -function ConfirmEmail({ request,status }) { +function ConfirmEmail({ request, status }) { return ( <>
@@ -18,7 +18,7 @@ function ConfirmEmail({ request,status }) { their team for the project{" "} @@ -39,9 +39,6 @@ function ConfirmEmail({ request,status }) {

-
-

Thank You

-

Regards

IEDC MEC Collab Team


diff --git a/src/Components/DescriptionDetails/DescriptionDetails.js b/src/Components/DescriptionDetails/DescriptionDetails.js index df670eb4..80db5edd 100644 --- a/src/Components/DescriptionDetails/DescriptionDetails.js +++ b/src/Components/DescriptionDetails/DescriptionDetails.js @@ -126,28 +126,47 @@ const DescriptionDetails = (props) => { ) : ( "" )} -
- - {props.selectedProject.contactNo} -
+ {currentUser ? ( +
+ + {props.selectedProject.contactNo} +
+ ) : ( + "" + )} +
- - - - - - + {currentUser ? ( + + + + ) : ( + "" + )} + + {currentUser ? ( + + + + ) : ( + "" + )} + {props.selectedProject.githubLink.length ? ( @@ -17,8 +16,9 @@ function Email({ request }) { join their team for the project{" "} {request.project} @@ -55,14 +55,12 @@ function Email({ request }) { https://iedc-collab-frontend.pages.dev

-
-

Thank You

-

Regards

IEDC MEC Collab Team


@@ -73,7 +71,9 @@ function Email({ request }) {

For any queries please visit{" "} - https://iedcmec.in + + https://iedcmec.in +

diff --git a/src/Components/NavigateBar/NavigateBar.jsx b/src/Components/NavigateBar/NavigateBar.jsx index e1d94fa1..40b2fb1e 100644 --- a/src/Components/NavigateBar/NavigateBar.jsx +++ b/src/Components/NavigateBar/NavigateBar.jsx @@ -16,8 +16,6 @@ const Navbar = () => { const [showProjectModal, setShowProjectModal] = useState(false); const { currentUser } = useContext(AuthContext); const { handleSearch, handleSearchDevelopers } = useContext(ProjectContext); - const [query, setQuery] = useState(""); - const [query1, setQuery1] = useState(""); const history = useHistory(); const [open1, setOpen1] = useState(false); const location = useLocation(); @@ -34,16 +32,6 @@ const Navbar = () => { alert("Please Login to Continue."); } }; - useEffect(() => { - const timeOutId = setTimeout(() => handleSearch(query), 500); - return () => clearTimeout(timeOutId); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [query]); - useEffect(() => { - const timeOutId = setTimeout(() => handleSearchDevelopers(query1), 500); - return () => clearTimeout(timeOutId); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [query1]); const [selectedUser, setSelectedUser] = useState(null); const getDev = async (id) => { if (id) { @@ -132,8 +120,10 @@ const Navbar = () => { > setQuery(e.target.value)} + onChange={(e) => { + e.preventDefault(); + handleSearch(e.target.value); + }} style={{ borderStyle: "none", outline: "none", width: "95%" }} > { > setQuery1(e1.target.value)} + onChange={(e1) => { + e1.preventDefault(); + handleSearchDevelopers(e1.target.value); + }} style={{ borderStyle: "none", outline: "none", width: "95%" }} > { > handleSearch(e.target.value)} + onChange={(e) => { + history.push(`/projects`); + handleSearch(e.target.value); + }} style={{ borderStyle: "none", outline: "none", width: "95%" }} > { +const RequirementDetails = (props) => { + const { fetchData } = useContext(ProjectContext); + const { currentUser } = useContext(AuthContext); + const [canModifyProject, setCanModifyProject] = useState(false); + const [showNewProjectModal, setShowNewProjectModal] = useState(false); + const [displayConfirmationModal, setDisplayConfirmationModal] = useState( + false + ); + const history = useHistory(); + const submitDelete = (id) => { + doDeleteProject(id, () => { + toast("Project deleted successfully"); + fetchData(); + }); + setDisplayConfirmationModal(false); + history.go(0); + }; + + const hideConfirmationModal = () => { + setDisplayConfirmationModal(false); + }; + useEffect(() => { + if (currentUser?.uid === props.selectedProject.leader_id) { + setCanModifyProject(true); + } else { + setCanModifyProject(false); + } + }, [currentUser?.uid, props.selectedProject.leader_id]); + function deleteProj() { + setDisplayConfirmationModal(true); + } return ( <>
+
+ {canModifyProject && ( + { + deleteProj(); + }} + alt="delete project" + /> + )} + {canModifyProject && ( + { + setShowNewProjectModal(true); + }} + /> + )} +
PROJECT REQUIREMENTS
- {selectedProject?.req || "No Details Entered..."} + {props.selectedProject?.req || "No Details Entered..."}
- {selectedProject?.hiring?.length === 0 || !selectedProject.hiring ? ( + {props.selectedProject?.hiring?.length === 0 || + !props.selectedProject.hiring ? ( "" ) : ( <>
HIRING
- {selectedProject?.hiring?.map((role, index) => { + {props.selectedProject?.hiring?.map((role, index) => { return (
o {role} @@ -33,26 +94,39 @@ const RequirementDetails = ({ selectedProject }) => { )}
- - - - - - - {selectedProject.githubLink.length ? ( + {currentUser ? ( + + + + ) : ( + "" + )} + {currentUser ? ( + + + + ) : ( + "" + )} + + {props.selectedProject.githubLink.length ? ( @@ -63,6 +137,19 @@ const RequirementDetails = ({ selectedProject }) => { )}
+ setShowNewProjectModal(false)} + project={props.selectedProject} + setVariable={props.setVariable} + variable={props.variable} + /> + ); }; diff --git a/src/Pages/DeveloperDetail/DeveloperDetails.js b/src/Pages/DeveloperDetail/DeveloperDetails.js index be72d34d..5b4e797d 100644 --- a/src/Pages/DeveloperDetail/DeveloperDetails.js +++ b/src/Pages/DeveloperDetail/DeveloperDetails.js @@ -14,6 +14,7 @@ import { FaGraduationCap, FaLinkedin, FaPhoneAlt } from "react-icons/fa"; import { TbNetwork } from "react-icons/tb"; import { GoMarkGithub } from "react-icons/go"; import { HiUserAdd } from "react-icons/hi"; +import { BsArrowLeftCircleFill } from "react-icons/bs"; function DeveloperDetails() { let { id } = useParams(); @@ -53,6 +54,15 @@ function DeveloperDetails() {
+ history.goBack()} + style={{ + cursor: "pointer", + }} + /> +
- - + {currentUser ? ( + selectedUser.contact ? ( + + + + ) : ( + "" + ) ) : ( - "" + null )} - {selectedUser.email ? ( - - - + {currentUser ? ( + selectedUser.email ? ( + + + + ) : ( + "" + ) ) : ( - "" + null )} + {selectedUser.linkedin ? (
+
{ - + const getLinkedinUsername = (url) => { + const urlArray = url.split("/"); + if (urlArray[urlArray.length - 1] === "") { + return urlArray[urlArray.length - 2]; + } + return urlArray[urlArray.length - 1]; + }; return (
{ } />
-
+

{user.name}

-
{user.email}
+
+ {user.linkedin ? "@" + getLinkedinUsername(user.linkedin) : null} +
); diff --git a/src/Pages/Developers/Developers.js b/src/Pages/Developers/Developers.js index 3f94b1ca..a36d5dbc 100644 --- a/src/Pages/Developers/Developers.js +++ b/src/Pages/Developers/Developers.js @@ -10,9 +10,7 @@ import SuspenseLoader from "../../Components/SuspenseLoader/SuspenseLoader"; import { ProjectContext } from "../../contexts/ProjectContext"; import { Pagination } from "@mui/material"; - - -let devs = [] +let devs = []; const Developers = () => { const [users, setUsers] = useState([]); @@ -20,8 +18,8 @@ const Developers = () => { ProjectContext ); const [selectedSkills, setSelectedSkills] = useState([]); - const [pages, setPages ] = useState(0) - const [page, setPage] = useState(0) + const [pages, setPages] = useState(0); + const [page, setPage] = useState(0); const [loading1, setLoading1] = useState(false); const [branch, setBranch] = useState([]); const [yop, setYop] = useState([]); @@ -29,8 +27,8 @@ const Developers = () => { const addYop = (selectedYop) => { let oldYop = yop; if (oldYop.find((s) => s === selectedYop)) { - if(oldYop.length==1)oldYop=[] - else oldYop = oldYop.filter((s) => s !== selectedYop); + if (oldYop.length === 1) oldYop = []; + else oldYop = oldYop.filter((s) => s !== selectedYop); } else { oldYop = [...oldYop, selectedYop]; } @@ -44,7 +42,6 @@ const Developers = () => { oldBranch = [...oldBranch, b]; } setBranch(oldBranch); - }; // const getDevs = async () => { // // await getDevelopers().then(async function (snapshot) { @@ -60,23 +57,21 @@ const Developers = () => { // }; useEffect(() => { devs = developers; - setPage(0) - setPages(Math.ceil(developers.length/10)) - setUsers(developers.slice(page*10,(page*10)+10)) - - - + setPage(0); + setPages(Math.ceil(developers.length / 10)); + setUsers(developers.slice(page * 10, page * 10 + 10)); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [developers]); const filterDevelopers = () => { -//if(branch.length==0 && yop.length==0 && selectedSkills.length==0 && developers.length == users.length){alert("hello");return;} - setLoading1(true) - // setAllUsers(developers); + //if(branch.length==0 && yop.length==0 && selectedSkills.length==0 && developers.length == users.length){alert("hello");return;} + setLoading1(true); + // setAllUsers(developers); let developers1 = developers; let skills = selectedSkills; - devs = [] - setPage(0) - if (skills.length === 0 ) { + devs = []; + setPage(0); + if (skills.length === 0) { devs = developers; } else { developers1.forEach((dev) => { @@ -87,63 +82,52 @@ const Developers = () => { } } }); - - - } - - if (branch.length > 0){ + if (branch.length > 0) { devs = devs.filter((d) => { if (branch.find((br) => br === d.branch)) { return true; } else return false; }); - } - if (yop.length > 0){ + if (yop.length > 0) { devs = devs.filter((d) => { if (yop.find((yp) => yp === d.year)) { return true; } else return false; }); - } - - if(devs) -{ - // setUsers([]) - // for(let i = 0; i < devs.length+10;i+=10){ - + + if (devs) { + // setUsers([]) + // for(let i = 0; i < devs.length+10;i+=10){ + //etTimeout(() => { - let count = 15 - setPages(Math.ceil(devs.length/10)); - setUsers(devs.slice(page*10,(page*10)+10)) + setPages(Math.ceil(devs.length / 10)); + setUsers(devs.slice(page * 10, page * 10 + 10)); //}, 100); } - - - setLoading1(false) + + setLoading1(false); }; - useEffect(()=>{ - setUsers(devs.slice(page*10, (page*10)+10)) - }, [page]) + useEffect(() => { + setUsers(devs.slice(page * 10, page * 10 + 10)); + }, [page]); useEffect(() => { console.log(branch); - + filterDevelopers(); // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedSkills, branch, yop]); - - const history = useHistory(); const handleClick = (u) => { history.push(`/developers/${u.id}`); }; - if (loading||loading1) { + if (loading || loading1) { return (
@@ -163,9 +147,11 @@ const Developers = () => { addYop={addYop} />
-

DEVELOPERS

+

+ {users.length === 0 ? "NOT FOUND" : "DEVELOPERS"} +

+
- {users?.map((user, index) => { return (
setSelectedDevelopers(user)}> @@ -174,12 +160,18 @@ const Developers = () => { ); })}
- {setPage(val-1)}} color="primary" sx={{ - paddingTop:"5rem", - }} /> + { + setPage(val - 1); + }} + color="primary" + sx={{ + paddingTop: "5rem", + }} + />
- -
diff --git a/src/Pages/Developers/Developers.scss b/src/Pages/Developers/Developers.scss index 5af083ad..8b91d4d0 100644 --- a/src/Pages/Developers/Developers.scss +++ b/src/Pages/Developers/Developers.scss @@ -71,13 +71,9 @@ color: #ffffff; } .developer-card-email { - width: 450px; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; font-style: normal; font-weight: 400; - font-size: 21px; + font-size: 20px; line-height: 29px; /* identical to box height */ diff --git a/src/Pages/MyProfile/EditProfileModal.js b/src/Pages/MyProfile/EditProfileModal.js index b5d149ab..54f0d2a4 100644 --- a/src/Pages/MyProfile/EditProfileModal.js +++ b/src/Pages/MyProfile/EditProfileModal.js @@ -160,6 +160,16 @@ const NewUserForm = ({ onClose, user }) => { const handleSubmit = (values, actions) => { // const { skills } = values; + const { github, linkedin } = values; + if (!linkedin.includes("https://www.linkedin.com/in/")) { + toast("Please enter a valid linkedin url"); + return; + } + if (!github.includes("https://github.com/")) { + toast("Please enter a valid github url"); + return; + } + const formValues = { ...values, projects: acValue, diff --git a/src/Pages/MyProfile/MyProfile.js b/src/Pages/MyProfile/MyProfile.js index c065d6f4..2042608b 100644 --- a/src/Pages/MyProfile/MyProfile.js +++ b/src/Pages/MyProfile/MyProfile.js @@ -192,7 +192,7 @@ const MyProfile = () => { target="_blank" rel="noreferrer" > - @ {getGithubUsername(profile.github)} + @{getGithubUsername(profile.github)}
) : (
{""}
@@ -208,7 +208,7 @@ const MyProfile = () => { target="_blank" rel="noreferrer" > - @ {getLinkedinUsername(profile.linkedin)} + @{getLinkedinUsername(profile.linkedin)} ) : (
{""}
diff --git a/src/Pages/MyProfile/MyProfile.scss b/src/Pages/MyProfile/MyProfile.scss index 51f022b3..9f170587 100644 --- a/src/Pages/MyProfile/MyProfile.scss +++ b/src/Pages/MyProfile/MyProfile.scss @@ -15,11 +15,22 @@ padding: 2.5rem; display: flex; color: #ffff; + position: fixed; flex-direction: column; gap: 2rem; min-height: 100vh; // background-image: url(../../assets/MyProfBg.svg); } +.edit__pro_box { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + gap: 1.25rem; + padding: 1rem; + margin-left: 25rem; +} .pro_image_container { display: flex; justify-content: center; @@ -86,15 +97,7 @@ font-size: 1.25rem; line-height: 29px; } -.edit__pro_box { - display: flex; - flex-direction: column; - justify-content: center; - align-items: center; - width: 100%; - gap: 1.25rem; - padding: 1rem; -} + .edit__pro_box_1 { display: flex; justify-content: center; @@ -393,12 +396,16 @@ @media screen and (max-width: 992px) { } -@media screen and (max-width: 800px) { +@media screen and (max-width: 860px) { .my_profile_container { flex-direction: column; } + .profile_board { + position: relative; + } .edit__pro_box { width: 100%; + margin-left: 0rem; justify-content: center; align-items: center; } diff --git a/src/Pages/ProjectDetail/ProjectDetail.js b/src/Pages/ProjectDetail/ProjectDetail.js index 43447f13..86687868 100644 --- a/src/Pages/ProjectDetail/ProjectDetail.js +++ b/src/Pages/ProjectDetail/ProjectDetail.js @@ -58,10 +58,18 @@ function ProjectDetail() { /> )} {toggle === 2 && ( - + )} {toggle === 3 && ( - + )}
diff --git a/src/Pages/Projects/Projects.js b/src/Pages/Projects/Projects.js index c64910f5..e540f1c7 100644 --- a/src/Pages/Projects/Projects.js +++ b/src/Pages/Projects/Projects.js @@ -1,16 +1,12 @@ -import React, { useContext, useEffect } from "react"; +import React, { useContext } from "react"; import "./Projects.scss"; import { Container } from "react-bootstrap"; -import Aos from "aos"; import { useHistory } from "react-router-dom"; import MainLayout from "../../Components/MainLayout/MainLayout"; // import { getProjects } from "../../Firebase/firebase"; import SuspenseLoader from "../../Components/SuspenseLoader/SuspenseLoader"; import { ProjectContext } from "../../contexts/ProjectContext"; const Projects = () => { - useEffect(() => { - Aos.init({ duration: 1100 }); - }, []); // const [projects, setProjects] = useState([]); const { projects, loading } = useContext(ProjectContext); // const [loading, setLoading] = useState(true); @@ -32,6 +28,7 @@ const Projects = () => { const handleClick = (p) => { history.push(`/projects/${p.id}`); }; + if (loading) { return (
@@ -46,9 +43,7 @@ const Projects = () => {

- {projects.length === 0 && projects.length !== 0 - ? "NOT FOUND" - : "PROJECTS"} + {projects.length === 0 ? "NOT FOUND" : "PROJECTS"}

{projects.map((project) => (