- {notifications?.data?.length && notifications?.data?.map((item, idx) =>
- {
- if(idx < 5){
- return (
- -
-
-
-
})
-
-
-
- {item?.title}
- {/*
+ {notifications?.data?.length &&
+ notifications?.data?.map((item, idx) => {
+ if (idx < 5) {
+ return (
+ -
+
+
+
})
+
+
+
+ {item?.title}
+ {/*
successfully done
*/}
-
-
-
-
-
-
-
- )
- }
- })
- }
+
+
+
+
+
+
+
+ );
+ }
+ })}
@@ -351,9 +348,9 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
{/* profile-image */}
@@ -375,7 +372,7 @@ export default function Header({ logoutModalHandler, sidebarHandler }) {
diff --git a/src/components/Settings/Tabs/PersonalInfoTab.jsx b/src/components/Settings/Tabs/PersonalInfoTab.jsx
index 3b19373..096f277 100644
--- a/src/components/Settings/Tabs/PersonalInfoTab.jsx
+++ b/src/components/Settings/Tabs/PersonalInfoTab.jsx
@@ -68,6 +68,7 @@ export default function PersonalInfoTab({
state: userDetails?.state,
city: userDetails?.city,
email: userDetails?.email,
+ profile: userDetails?.profile_pic,
};
let [profile, setProfile] = useState({
@@ -86,6 +87,9 @@ export default function PersonalInfoTab({
const handleUpdateUser = (values, helpers) => {
setRequestState({ message: "", loading: true, status: false });
+ // there is no profile accommodation on the payload
+ delete values?.profile;
+
apiCall
.updateProfile(values)
.then((res) => {
@@ -336,8 +340,8 @@ export default function PersonalInfoTab({
-
@@ -392,7 +397,7 @@ export default function PersonalInfoTab({
{" "}
Cancel
-
+ */}
{requestStatus.loading ? (
diff --git a/src/components/Settings/index.jsx b/src/components/Settings/index.jsx
index 012ee71..bffcdf5 100644
--- a/src/components/Settings/index.jsx
+++ b/src/components/Settings/index.jsx
@@ -5,8 +5,9 @@ import React, {
useRef,
useState,
} from "react";
+import { useSelector } from "react-redux";
import cover from "../../assets/images/profile-info-cover.png";
-import profile from "../../assets/images/profile-info-profile.png";
+import profile from "../../assets/images/profile.jpg";
import usersService from "../../services/UsersService";
import Icons from "../Helpers/Icons";
import Layout from "../Partials/Layout";
@@ -23,15 +24,19 @@ import {
import RecipientAccountTab from "./Tabs/RecipientAccountTab";
export default function Settings({ faq }) {
- const [profileImg, setProfileImg] = useState(profile);
+ const { userDetails } = useSelector((state) => state?.userDetails);
+ const [profileImg, setProfileImg] = useState(
+ userDetails?.profile_pic_url ? userDetails.profile_pic_url : profile
+ );
const [coverImg, setCoverImg] = useState(cover);
- const [reloadCardList, setReloadCardList] = useState(false) // STATE TO DETERMINE WHEN CARD LIST RELOADS. EG: WHEN USER DELETES A CARD
-
+ const [reloadCardList, setReloadCardList] = useState(false); // STATE TO DETERMINE WHEN CARD LIST RELOADS. EG: WHEN USER DELETES A CARD
+
// profile img
const profileImgInput = useRef(null);
const browseProfileImg = () => {
profileImgInput.current.click();
};
+
const profileImgChangHandler = (e) => {
if (e.target.value !== "") {
const imgReader = new FileReader();