@@ -9,7 +9,7 @@ import { useSubjectName } from 'hooks/useSubjectName';
99import { useSubjectVerifications } from 'hooks/useSubjectVerifications' ;
1010import useViewMode from 'hooks/useViewMode' ;
1111import moment from 'moment' ;
12- import { useContext , useMemo } from 'react' ;
12+ import { FC , useContext , useMemo } from 'react' ;
1313import { useSelector } from 'react-redux' ;
1414import { selectAuthData } from 'store/profile/selectors' ;
1515import { EvaluationCategory , ProfileTab } from 'types/dashboard' ;
@@ -21,17 +21,24 @@ import BrightIdProfilePicture from '../../BrightIdProfilePicture';
2121import { YourEvaluationInfo } from '../EvaluationInfo/YourEvaluationInfo' ;
2222import { HorizontalProgressBar } from '../HorizontalProgressBar' ;
2323import NewEvaluationCard from '@/app/routes/_app.subject.$id/components/new-evaluation-card' ;
24+ import GravatarProfilePicture from '@/components/GravatarPoriflePicture' ;
2425
25- export const ProfileInfo = ( {
26- isPerformance = false ,
27- subjectId,
28- setShowEvaluationFlow,
29- setSelectedTab,
30- } : {
26+ export interface ProfileInfoProps {
27+ injectedProfileImage ?: string ;
3128 isPerformance ?: boolean ;
3229 subjectId : string ;
3330 setShowEvaluationFlow : ( value : boolean ) => void ;
3431 setSelectedTab ?: ( value : ProfileTab ) => void ;
32+ injectedProfileName ?: string | null ;
33+ }
34+
35+ export const ProfileInfo : FC < ProfileInfoProps > = ( {
36+ isPerformance = false ,
37+ subjectId,
38+ setShowEvaluationFlow,
39+ setSelectedTab,
40+ injectedProfileImage,
41+ injectedProfileName,
3542} ) => {
3643 const { currentViewMode, currentEvaluationCategory, updateViewAs } =
3744 useViewMode ( ) ;
@@ -87,15 +94,33 @@ export const ProfileInfo = ({
8794 < div className = "card flex flex-col gap-3 border dark:bg-dark-primary" >
8895 < div className = "card--header flex w-full items-center justify-between" >
8996 < div className = "card--header__left flex gap-4" >
90- < BrightIdProfilePicture
91- key = { subjectId }
92- className = { `card--header__left__avatar rounded-full border-[3px] ${ getViewModeSubjectBorderColorClass (
93- currentViewMode ,
94- ) } h-[51px] w-[51px]`}
95- subjectId = { subjectId }
96- />
97+ { injectedProfileImage ? (
98+ < GravatarProfilePicture
99+ key = { injectedProfileImage }
100+ image = { injectedProfileImage }
101+ className = { `card--header__left__avatar rounded-full border-[3px] ${ getViewModeSubjectBorderColorClass (
102+ currentViewMode ,
103+ ) } h-[51px] w-[51px]`}
104+ />
105+ ) : (
106+ < BrightIdProfilePicture
107+ key = { subjectId }
108+ className = { `card--header__left__avatar rounded-full border-[3px] ${ getViewModeSubjectBorderColorClass (
109+ currentViewMode ,
110+ ) } h-[51px] w-[51px]`}
111+ subjectId = { subjectId }
112+ />
113+ ) }
97114 < div className = "card--header__left__info flex flex-col justify-center" >
98- < h3 className = "truncate text-lg font-medium leading-5" > { name } </ h3 >
115+ < h3 className = "truncate text-lg font-medium leading-5" >
116+ { injectedProfileName ? (
117+ < span >
118+ { injectedProfileName } < small > ({ name } )</ small >
119+ </ span >
120+ ) : (
121+ name
122+ ) }
123+ </ h3 >
99124 < div className = "flex gap-1" >
100125 < span className = "text-sm" >
101126 Level: < strong > { auraLevel } </ strong >
0 commit comments