fix(web): actor header with flexbox

bye bye table jank, hello properly sized header which stays the same on
all display sizes and name lengths yayyyy
This commit is contained in:
əlemi 2024-12-26 21:57:12 +01:00
parent 64a05aae0c
commit d2477339e7
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -64,36 +64,20 @@ pub fn ActorHeader() -> impl IntoView {
<div style="height: 10em"></div> // TODO bad way to have it fixed height ewwww <div style="height: 10em"></div> // TODO bad way to have it fixed height ewwww
</div> </div>
<div class="overlap"> <div class="overlap">
<table class="pl-2 pr-2 align w-100" style="table-layout: fixed"> <div class="pl-1 pr-1" style="display: flex">
<tr> <img class="avatar avatar-border mr-s" src={avatar_url} style="height: 7em; width: 7em" onerror={format!("this.onerror=null; this.src='{FALLBACK_IMAGE_URL}';")} />
<td rowspan=4 style="width: 8em">
<img class="avatar avatar-border mr-s" src={avatar_url} style="height: 7em; width: 7em" onerror={format!("this.onerror=null; this.src='{FALLBACK_IMAGE_URL}';")} /> <div class="ma-s pt-3">
</td> <b class="big">{name}</b>{actor_type_tag}<br/>
<td rowspan=2 class="bottom"> <small><a class="clean hover" href={uid.clone()} target="_blank">{username.clone()}@{domain}</a></small><br/>
<b class="big">{name}</b>{actor_type_tag} <DateTime t=created />
</td> </div>
<td rowspan=2 class="bottom rev" title="statuses"> <div class="ma-s pt-3 rev" style="flex-grow: 1; white-space: nowrap;">
<a class="clean" href={web_path.clone()}>{actor.statuses_count().want()}" "<span class="emoji">"\u{1f582}"</span></a> {actor.statuses_count().unwrap_or_default()}" "<span class="emoji">"\u{1f582}"</span><br/>
</td> {actor.following_count().unwrap_or_default()}" "<span class="emoji">"👥"</span><br/>
</tr> {actor.followers_count().unwrap_or_default()}" "<span class="emoji">"📢"</span>
<tr></tr> </div>
<tr> </div>
<td class="top">
<small><a class="clean hover" href={uid.clone()} target="_blank">{username.clone()}@{domain}</a></small>
</td>
<td class="rev" title="following">
<a class="clean" href={format!("{web_path}/following")}>{actor.following_count().want()}" "<span class="emoji">"👥"</span></a>
</td>
</tr>
<tr>
<td>
<DateTime t=created />
</td>
<td class="rev" title="followers">
<a class="clean" href={format!("{web_path}/followers")}>{actor.followers_count().want()}" "<span class="emoji">"📢"</span></a>
</td>
</tr>
</table>
<div class="rev mr-1" class:hidden=move || !auth.present() || auth.user_id() == uid> <div class="rev mr-1" class:hidden=move || !auth.present() || auth.user_id() == uid>
{if following_me { {if following_me {
Some(view! { <code class="mr-1 color">follows you</code> }) Some(view! { <code class="mr-1 color">follows you</code> })