From d1c0fa539bb297733037f595288dd82eeeb46ab3 Mon Sep 17 00:00:00 2001 From: Spencer Wohlers <4006420+seidior@users.noreply.github.com> Date: Fri, 10 Jun 2022 00:00:18 -0700 Subject: [PATCH] #356: Revert changes to webapp This reverts commit 59f2f44740520216ccef3d605257b8718bb98f14 to ensure this branch only contains changes to the api/ subdirectory and not any changes to the webapp/ subdirectory. The changes from that commit will be migrated over to the appropriate branch. --- webapp/src/components/Profile.tsx | 30 ++++++++---------------------- webapp/src/types/api.d.ts | 24 ------------------------ 2 files changed, 8 insertions(+), 46 deletions(-) diff --git a/webapp/src/components/Profile.tsx b/webapp/src/components/Profile.tsx index 10f45432..0a2365a8 100644 --- a/webapp/src/components/Profile.tsx +++ b/webapp/src/components/Profile.tsx @@ -1,8 +1,5 @@ -import React, { useContext, useState } from 'react'; +import React from 'react'; import { getGreeting } from '../helpers/greeting'; -import useApiData from '../helpers/useApiData'; -import { EntityId, Profile as APIProfile } from '../types/api'; -import SessionContext from './SessionContext'; import { Container, @@ -41,16 +38,6 @@ const user = { }; const Profile = () => { - const { principalId} = useContext(SessionContext); - console.log({id: principalId}) - const [changedUserDataIds, setChangedUserDataIds] = useState([]); - const { data: userData, error } = useApiData({ - deps: [changedUserDataIds], - path: `/profile/${principalId}`, - sendCredentials: true, - }); - - console.log( 'id', userData && userData[0].github_accounts[0].avatar_url ); const greeting = getGreeting(user.name); return ( @@ -97,7 +84,7 @@ const Profile = () => { border: '3px solid #fff', outline: '2px solid #1976d2', }} - src={userData && userData[0].github_accounts[0].avatar_url || undefined} + src={user.avatar} > { flexDirection="column" > - {userData && userData[0].full_name ? userData[0].full_name : userData && userData[0].github_accounts[0].full_name ? userData[0].github_accounts[0].full_name : 'no name found!!'}'s Profile + {user.name}'s Profile - {/* should we add "|| null" ? */} - {userData && userData[0].email_address || 'no email found!!'} + {user.email} { > - + - + - + @@ -155,7 +141,7 @@ const Profile = () => { Summary - {userData && userData[0].bio ? userData[0].bio : userData && userData[0].github_accounts[0].bio ? userData[0].github_accounts[0].bio : 'no bio found!!'} + {user.summary}