Display username in profile container when logged in
This commit is contained in:
parent
c2ebd8307f
commit
2d7b91413b
@ -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()
|
||||
|
@ -15,6 +15,20 @@
|
||||
border: 0.2rem solid rgba(89, 89, 89, 0.199);
|
||||
padding: 0.5rem;
|
||||
|
||||
.profile-name {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-left: 0.5rem;
|
||||
h1 {
|
||||
font-size: 1.2rem;
|
||||
margin: 0;
|
||||
}
|
||||
h2 {
|
||||
font-size: 1rem;
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.profile-icon {
|
||||
display: inline-flex;
|
||||
padding: 0.2rem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user