front: add link to user's profile

This commit is contained in:
AdrienLSH 2024-01-18 13:35:47 +01:00
parent c831a019b2
commit a7b0051d47
2 changed files with 4 additions and 1 deletions

View File

@ -112,12 +112,14 @@ class Client
await this.me.init();
document.getElementById('navbarLoggedOut').classList.add('d-none');
document.getElementById('navbarLoggedIn').classList.remove('d-none');
document.getElementById('myProfileLink').href = '/profiles/' + this.me.username;
}
else
{
this.me = undefined;
document.getElementById('navbarLoggedOut').classList.remove('d-none');
document.getElementById('navbarLoggedIn').classList.add('d-none');
document.getElementById('myProfileLink').href = '';
}
this._logged = state;
}

View File

@ -25,7 +25,8 @@
Me
</a>
<div class='dropdown-menu dropdown-menu-end position-absolute text-end px-2' style='min-width: 100px'>
<a href="/me" class="dropdow-item nav-link" data-link>My Profile</a>
<a id='myProfileLink' href='' class="dropdow-item nav-link" data-link>My Profile</a>
<a href="/me" class="dropdow-item nav-link" data-link>Settings</a>
<hr class='dropdown-separator my-auto'></hr>
<a href="/logout" class="dropdow-item nav-link" data-link>Logout</a>
</div>