feat(web): better follow/following/follows tags

still lot to do but better than previous misaligned bs!
This commit is contained in:
əlemi 2024-12-27 02:04:30 +01:00
parent 7befb83dcd
commit 43de8334e2
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -81,19 +81,37 @@ pub fn ActorHeader() -> impl IntoView {
<div class="ma-s pt-3 rev" style="flex-grow: 1; white-space: nowrap;"> <div class="ma-s pt-3 rev" style="flex-grow: 1; white-space: nowrap;">
</div> </div>
</div> </div>
<div class="rev mr-1" class:hidden=move || !auth.present() || auth.user_id() == uid> <div class="mr-1 ml-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! {
<a class="clean dim" href="#remove" on:click=move |_| tracing::error!("not yet implemented")>
<span class="border-button ml-s" title="remove follower (not yet implemented)">
<code class="color mr-s">"!"</code>
<small class="mr-s">follows you</small>
</span>
</a>
})
} else { } else {
None None
}} }}
{if followed_by_me { {if followed_by_me {
view! { view! {
<code class="color">"following"</code> <a class="clean dim" href="#unfollow" on:click=move |_| unfollow(_uid.clone())>
<input type="submit" value="x" on:click=move |_| unfollow(_uid.clone()) /> <span class="border-button ml-s" title="undo follow">
<code class="color mr-s">x</code>
<small class="mr-s">following</small>
</span>
</a>
}.into_view() }.into_view()
} else { } else {
view! { <input type="submit" value="follow" on:click=move |_| send_follow_request(_uid.clone()) /> }.into_view() view! {
<a class="clean dim" href="#follow" on:click=move |_| send_follow_request(_uid.clone())>
<span class="border-button ml-s" title="send follow request">
<code class="color mr-s">+</code>
<small class="mr-s">follow</small>
</span>
</a>
}.into_view()
}} }}
</div> </div>
</div> </div>