click avatar in nav to see the owen profile view

This commit is contained in:
Anton Tranelis 2024-07-15 19:36:30 +02:00
parent a5d08d97a5
commit 0a7661980e

View File

@ -86,12 +86,14 @@ export default function NavBar({ appName, userType}: { appName: string, userType
{isAuthenticated ? {isAuthenticated ?
<div className="tw-flex-none"> <div className="tw-flex-none">
{ userProfile?.image? <div className="tw-avatar"> <Link to={`${userProfile.id && "/item/"+userProfile.id}`} className="tw-flex tw-items-center">
{ userProfile?.image && <div className="tw-avatar">
<div className="tw-w-10 tw-rounded-full"> <div className="tw-w-10 tw-rounded-full">
<img src={"https://api.utopia-lab.org/assets/" + userProfile.image} /> <img src={"https://api.utopia-lab.org/assets/" + userProfile.image} />
</div> </div>
</div> : <></>} </div>}
<div className='tw-ml-2 tw-mr-2'>{userProfile.name||user?.first_name}</div> <div className='tw-ml-2 tw-mr-2'>{userProfile.name||user?.first_name}</div>
</Link>
<div className="tw-dropdown tw-dropdown-end"> <div className="tw-dropdown tw-dropdown-end">
<label tabIndex={0} className="tw-btn tw-btn-ghost tw-btn-square"> <label tabIndex={0} className="tw-btn tw-btn-ghost tw-btn-square">
<svg xmlns="http://www.w3.org/2000/svg" className="tw-h-5 tw-w-5" viewBox="0 0 20 20" fill="currentColor"> <svg xmlns="http://www.w3.org/2000/svg" className="tw-h-5 tw-w-5" viewBox="0 0 20 20" fill="currentColor">