Display username in profile container when logged in

This commit is contained in:
2024-10-18 19:31:20 -04:00
parent c2ebd8307f
commit 2d7b91413b
2 changed files with 23 additions and 0 deletions

View File

@ -35,6 +35,15 @@ pub fn Profile() -> impl IntoView {
view! {
<div class="profile-container">
<div class="profile-name">
<Show
when=move || logged_in.get().unwrap_or_default()
fallback=|| view!{
<h1>Not Logged In</h1>
}>
<h1>{move || user.get().map(|user| user.map(|user| user.username).unwrap_or_default())}</h1>
</Show>
</div>
<div class="profile-icon" on:click=open_dropdown>
<Show
when=move || logged_in.get().unwrap_or_default()