From ecfecee208872de4a67181c7940b431f55c7d0a1 Mon Sep 17 00:00:00 2001 From: TechBuilderTeam Date: Fri, 7 Jun 2024 17:45:29 +0600 Subject: [PATCH] one to one chat bug fixed --- public/document (2).pdf | Bin 0 -> 8564 bytes src/components/Home/banner.jsx | 2 +- src/components/Pages/Chat/ChatOnetoOne.jsx | 8 +- src/components/User/DynamicProfile.jsx | 111 +++++++++++++-------- src/components/User/Profile.jsx | 1 + src/pages/shared/Navbar.jsx | 2 +- 6 files changed, 74 insertions(+), 50 deletions(-) create mode 100644 public/document (2).pdf diff --git a/public/document (2).pdf b/public/document (2).pdf new file mode 100644 index 0000000000000000000000000000000000000000..ae97d28e38daf88e80e9bd572e5d4badeb118166 GIT binary patch literal 8564 zcmdUVS^K(5lIH#YQ@F4xJBZ?jqJX%ts3>lzAm9!PI#o3n^95$^=6*iw@HU4Ea zchB4nkB^W+WCZzUM3R{=peZRhO;mn?|MP$R_y3if1+O^yOk6KF2%;cyKY^diG;)4? z`aXl`le>IAuLeo}=}&(mlHYV6u1B2W=Px=(X#t= z3L^hU;pfipiaj?ClsGd>s=?#G1fT24&5?3+iv4SJ&XM*t5~K9`4}tDJgUl$MBj;c5 z^Osjvu(JQG{Bz3gWVZg`>c{oJ;|lM^5C1>okNHpftNg)VKYNr6urycyX@8E?0{`mv z;y>rMS((alb&gT8DiYgu|zM4tjq(_y2Yt=9~G|=NHyZ8~Mzk~kQIO@9}_Yt4}fJf~Q zHpK7e5+^ytjpFDp&-j~`a%4XV+|M=B#RIKdkX&Vy!?bhmQ}al^vNOL zD18N|Yj_R(%%yexJhE1OqtDO9Z<54)y|S@^RNP1U$GG{4-G9VQRwEk;$niCM_HFJb zJ!ZL|$eR5``(L5{4gEg={gW=g8&Ix~Pu7Yo%*A`|E-W&ngr4L zbIDa1miw`kezMMZ{u+1%5({7F!`wvZz#DCf@T3Av2({-|cpfZ}d&;m40n@?QnRyS3mDVmpzNq8A(4`JiO3UbWNM@Zg+#; ziZ0LT=Uv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/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);