|
@ -6,7 +6,7 @@ import { USER_PROFILE_PICTURE } from '../constants/orbit/UserDatabaseKeys'; |
|
|
|
|
|
|
|
|
const ProfileImage = (props) => { |
|
|
const ProfileImage = (props) => { |
|
|
const { |
|
|
const { |
|
|
topicAuthorAddress, topicAuthor, topicAuthorMeta, avatarUrl, size, link, |
|
|
profileAddress, profileUsername, topicAuthorMeta, avatarUrl, size, link, |
|
|
} = props; |
|
|
} = props; |
|
|
|
|
|
|
|
|
const stopClickPropagation = (event) => { |
|
|
const stopClickPropagation = (event) => { |
|
@ -20,30 +20,30 @@ const ProfileImage = (props) => { |
|
|
|
|
|
|
|
|
return ( |
|
|
return ( |
|
|
<Avatar |
|
|
<Avatar |
|
|
name={topicAuthor} |
|
|
name={profileUsername} |
|
|
size={size} |
|
|
size={size} |
|
|
round |
|
|
round |
|
|
src={profileImageUrl} |
|
|
src={profileImageUrl} |
|
|
/> |
|
|
/> |
|
|
); |
|
|
); |
|
|
}, [avatarUrl, size, topicAuthor, topicAuthorMeta]); |
|
|
}, [avatarUrl, size, profileUsername, topicAuthorMeta]); |
|
|
|
|
|
|
|
|
return useMemo(() => { |
|
|
return useMemo(() => { |
|
|
if (link && topicAuthorAddress) { |
|
|
if (link && profileAddress) { |
|
|
return ( |
|
|
return ( |
|
|
<Link to={`/users/${topicAuthorAddress}`} onClick={stopClickPropagation}> |
|
|
<Link to={`/users/${profileAddress}`} onClick={stopClickPropagation}> |
|
|
{authorAvatar} |
|
|
{authorAvatar} |
|
|
</Link> |
|
|
</Link> |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
return authorAvatar; |
|
|
return authorAvatar; |
|
|
}, [authorAvatar, link, topicAuthorAddress]); |
|
|
}, [authorAvatar, link, profileAddress]); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
ProfileImage.propTypes = { |
|
|
ProfileImage.propTypes = { |
|
|
topicAuthorAddress: PropTypes.string, |
|
|
profileAddress: PropTypes.string, |
|
|
topicAuthor: PropTypes.string, |
|
|
profileUsername: PropTypes.string, |
|
|
topicAuthorMeta: PropTypes.shape({ id: PropTypes.string, profile_picture: PropTypes.string }), |
|
|
profileUserMeta: PropTypes.shape({ id: PropTypes.string, profile_picture: PropTypes.string }), |
|
|
avatarUrl: PropTypes.string, |
|
|
avatarUrl: PropTypes.string, |
|
|
size: PropTypes.string, |
|
|
size: PropTypes.string, |
|
|
link: PropTypes.bool, |
|
|
link: PropTypes.bool, |
|
|