-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f8d792
commit 493ab28
Showing
1 changed file
with
3 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,18 +85,6 @@ const dummyActivities = [ | |
}, | ||
]; | ||
|
||
const user2 = { | ||
name: "Khalifan Muwonge", | ||
email: "[email protected]", | ||
organization: "Makerere", | ||
dateJoined: "12/04/2020", | ||
apps: 10, | ||
projects: 15, | ||
databases: 5, | ||
followingProjects: 7, | ||
followers: 12, | ||
isBeta: true, | ||
}; | ||
|
||
const tabNames = ["Overview", "Projects", "Activities"]; | ||
const UsersProfile = () => { | ||
|
@@ -112,8 +100,7 @@ const UsersProfile = () => { | |
const [loadingUserProjects, setLoadingUserProjects] = useState(false); | ||
const [loadingUserProjectsError, setUserProjectsError] = useState(false); | ||
const [projectFollowLoading, setProjectFollowLoading] = useState(""); | ||
const [userSummary, setUserSummary] = useState({}); | ||
const [userSummaryLoading, setUserSummaryLoading] = useState(false); | ||
|
||
|
||
const { userID } = useParams(); | ||
|
||
|
@@ -128,19 +115,6 @@ const UsersProfile = () => { | |
setLoadingUserDetails(false); | ||
}); | ||
}; | ||
const getUserSummary = useCallback(async () => { | ||
setUserSummaryLoading(true); | ||
handleGetRequest(`/users/profile_summary/${userID}`) | ||
.then((response) => { | ||
setUserSummary(response.data.data); | ||
setUserSummaryLoading(false); | ||
}) | ||
.catch((error) => { | ||
setLoadingUserError("Something went wrong, please refresh the page"); | ||
setUserSummaryLoading(false); | ||
}); | ||
}, [setUserSummaryLoading, setUserSummary, setLoadingUserError]); | ||
|
||
const getUserProjects = useCallback(async () => { | ||
setLoadingUserProjects(true); | ||
handleGetRequest(`users/${userID}/projects`) | ||
|
@@ -157,7 +131,6 @@ const UsersProfile = () => { | |
useEffect(() => { | ||
getUserDetails(); | ||
getUserProjects(); | ||
getUserSummary(); | ||
}, []); | ||
|
||
const toggleExpand = (id) => { | ||
|
@@ -259,12 +232,12 @@ const UsersProfile = () => { | |
<> | ||
<section className=""> | ||
<div className="SectionTitle">Analytics</div> | ||
{userSummaryLoading ? ( | ||
{loadingUserDetails ? ( | ||
<div className="NoResourcesMessage"> | ||
<Spinner /> | ||
</div> | ||
) : ( | ||
<ProfileAnalytics user={userSummary} /> | ||
<ProfileAnalytics user={userDetails} /> | ||
)} | ||
</section> | ||
<UserFeedProjects | ||
|