diff --git a/public/document (2).pdf b/public/document (2).pdf new file mode 100644 index 0000000..ae97d28 Binary files /dev/null and b/public/document (2).pdf differ diff --git a/src/components/Home/banner.jsx b/src/components/Home/banner.jsx index 63d4bd8..e6b926c 100644 --- a/src/components/Home/banner.jsx +++ b/src/components/Home/banner.jsx @@ -8,7 +8,7 @@ const Banner = () => { const { user } = useContext(AuthContext); return (
-
+

diff --git a/src/components/Pages/Chat/ChatOnetoOne.jsx b/src/components/Pages/Chat/ChatOnetoOne.jsx index 3d95294..bac0f1c 100644 --- a/src/components/Pages/Chat/ChatOnetoOne.jsx +++ b/src/components/Pages/Chat/ChatOnetoOne.jsx @@ -80,7 +80,7 @@ const ChatOnetoOne = ({user, profile}) => { return (
- {showChat && ( @@ -88,12 +88,12 @@ const ChatOnetoOne = ({user, profile}) => {
{profile.first_name} - {profile.first_name} + {profile?.get_full_name}
- - + + //
//

//
@@ -249,12 +249,13 @@ import ProjectSlider from "./ProjectSlider"; import { Element, ScrollLink } from "react-scroll"; import axios from "axios"; import { useParams } from "react-router-dom"; +import { toast } from "react-toastify"; const DynamicProfile = () => { const { user } = useContext(AuthContext); const { pId } = useParams(); const [profile, setProfile] = useState(null); - const [loading, setLoading ] = useState(true); + const [loading, setLoading] = useState(true); const [reload, setReload] = useState(false); const [showComponent, setShowComponent] = useState("Info"); @@ -264,24 +265,46 @@ const DynamicProfile = () => { document.getElementById("UserEdit").close(); }; - + const handleAddUserEdit = async (e) => { + + e.preventDefault(); + const updateDesignation = { + designation: e.target.designation.value, + user: user?.userId + } + console.log({ updateDesignation }); + + try { + const result = await axios.post(`https://projectsyncifyapi.onrender.com/api/v1/profile/designation/`, updateDesignation) + console.log({ result }) + handleCloseModal(); + toast.success("Designation updated successfully") + + setReload(!reload) + } + catch (error) { + console.log(error) + } + + + }; useEffect(() => { - - const getProfileData = async() => { + + const getProfileData = async () => { setLoading(true) - try{ + try { const result = await axios.get(`https://projectsyncifyapi.onrender.com/api/v1/profile/${pId}/`) - console.log({result}) + console.log({ result }) setProfile(result.data) setLoading(false) } - catch(error){ + catch (error) { console.log(error) setLoading(false) } } - if(user && user.userId){ + if (user && user.userId) { getProfileData(); } }, [user, reload]); @@ -300,7 +323,7 @@ const DynamicProfile = () => { alt={profile && profile.get_full_name} className="w-28 md:w-40 h-28 md:h-40 rounded-full border-4 border-sky-900 dark:border-sky-300" /> - +

@@ -309,7 +332,7 @@ const DynamicProfile = () => {

{" "} - {profile && profile?.designation?.designation } + {profile && profile?.designation?.designation}

{/*

{user && user.email}

*/}
@@ -319,18 +342,16 @@ const DynamicProfile = () => {
- + @@ -358,7 +379,7 @@ const DynamicProfile = () => { Edit
-
+ {/*
+
*/}
@@ -405,42 +426,44 @@ const DynamicProfile = () => { {showComponent === "Info" ? ( ) : // ) : showComponent === "Work" ? ( - // - // ) : showComponent === "Education" ? ( - // - showComponent === "Contact" ? ( - - ) : null} + // + // ) : showComponent === "Education" ? ( + // + showComponent === "Contact" ? ( + + ) : null}
{/* profile banner end */} {/* add the chatting component here */} -
- -
- + +
- {loading &&
Profile loading ...
} + {loading &&
Profile loading ...
}
{profile && <> - + +
+ +
+ {/* about section start */} - + + + {/* portfolio section start */} + - {/* portfolio section start */} - + {/* skill section start */} + - {/* skill section start */} - + {/* education section start */} - {/* education section start */} + - + {/* work section start */} + - {/* work section start */} - - } {/* project in slider start */} diff --git a/src/components/User/Profile.jsx b/src/components/User/Profile.jsx index e159ae5..8ba6561 100644 --- a/src/components/User/Profile.jsx +++ b/src/components/User/Profile.jsx @@ -70,6 +70,7 @@ const Profile = () => {

{" "} {user && user?.name} + {}

{/*

{user && user.email}

*/}
diff --git a/src/pages/shared/Navbar.jsx b/src/pages/shared/Navbar.jsx index cb71aad..d2c4583 100644 --- a/src/pages/shared/Navbar.jsx +++ b/src/pages/shared/Navbar.jsx @@ -90,7 +90,7 @@ const Navbar = ({ handleThemeChange }) => { const handleProfile = () => { console.log("profile button clicked"); - navigate("/profile"); + navigate(`/profile/${user?.userId}`); }; const [menuVisible, setMenuVisible] = useState(false);