Compare commits
No commits in common. "a7bcea7653444c5c18a48135f81fdfc2423ad730" and "da1f2698507dc8ed9ec1ff2e61ff4fdd967b189a" have entirely different histories.
a7bcea7653
...
da1f269850
4 changed files with 37 additions and 58 deletions
|
@ -118,14 +118,9 @@
|
|||
background-color: var(--background);
|
||||
}
|
||||
div.border {
|
||||
padding: 1em;
|
||||
border: 1px dashed var(--accent);
|
||||
}
|
||||
div.border-solid {
|
||||
border: 1px solid var(--background-dim);
|
||||
}
|
||||
div.inline {
|
||||
display: inline;
|
||||
}
|
||||
@media screen and (max-width: 786px) {
|
||||
div.sticky {
|
||||
top: 1.75rem;
|
||||
|
|
|
@ -45,41 +45,39 @@ pub fn Item(
|
|||
let config = use_context::<Signal<crate::Config>>().expect("missing config context");
|
||||
let id = item.id().unwrap_or_default().to_string();
|
||||
let sep = if sep { Some(view! { <hr /> }) } else { None };
|
||||
move || {
|
||||
if !replies && !config.get().filters.visible(&item) {
|
||||
return None;
|
||||
}
|
||||
match item.object_type().unwrap_or(apb::ObjectType::Object) {
|
||||
// special case for placeholder activities
|
||||
apb::ObjectType::Note | apb::ObjectType::Document(_) =>
|
||||
Some(view! { <Object object=item.clone() />{sep.clone()} }.into_view()),
|
||||
// everything else
|
||||
apb::ObjectType::Activity(t) => {
|
||||
let object_id = item.object().id().str().unwrap_or_default();
|
||||
let object = match t {
|
||||
apb::ActivityType::Create | apb::ActivityType::Announce =>
|
||||
CACHE.get(&object_id).map(|obj| {
|
||||
view! { <Object object=obj /> }
|
||||
}.into_view()),
|
||||
apb::ActivityType::Follow =>
|
||||
CACHE.get(&object_id).map(|obj| {
|
||||
view! {
|
||||
<div class="ml-1">
|
||||
<ActorBanner object=obj />
|
||||
<FollowRequestButtons activity_id=id.clone() actor_id=object_id />
|
||||
</div>
|
||||
}
|
||||
}.into_view()),
|
||||
_ => None,
|
||||
};
|
||||
Some(view! {
|
||||
<ActivityLine activity=item.clone() />
|
||||
{object}
|
||||
{sep.clone()}
|
||||
}.into_view())
|
||||
},
|
||||
// should never happen
|
||||
t => Some(view! { <p><code>type not implemented : {t.as_ref().to_string()}</code></p> }.into_view()),
|
||||
}
|
||||
if !replies && !config.get().filters.visible(&item) {
|
||||
return None;
|
||||
}
|
||||
match item.object_type().unwrap_or(apb::ObjectType::Object) {
|
||||
// special case for placeholder activities
|
||||
apb::ObjectType::Note | apb::ObjectType::Document(_) =>
|
||||
Some(view! { <Object object=item.clone() />{sep.clone()} }.into_view()),
|
||||
// everything else
|
||||
apb::ObjectType::Activity(t) => {
|
||||
let object_id = item.object().id().str().unwrap_or_default();
|
||||
let object = match t {
|
||||
apb::ActivityType::Create | apb::ActivityType::Announce =>
|
||||
CACHE.get(&object_id).map(|obj| {
|
||||
view! { <Object object=obj /> }
|
||||
}.into_view()),
|
||||
apb::ActivityType::Follow =>
|
||||
CACHE.get(&object_id).map(|obj| {
|
||||
view! {
|
||||
<div class="ml-1">
|
||||
<ActorBanner object=obj />
|
||||
<FollowRequestButtons activity_id=id.clone() actor_id=object_id />
|
||||
</div>
|
||||
}
|
||||
}.into_view()),
|
||||
_ => None,
|
||||
};
|
||||
Some(view! {
|
||||
<ActivityLine activity=item.clone() />
|
||||
{object}
|
||||
{sep.clone()}
|
||||
}.into_view())
|
||||
},
|
||||
// should never happen
|
||||
t => Some(view! { <p><code>type not implemented : {t.as_ref().to_string()}</code></p> }.into_view()),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,19 +131,6 @@ pub fn Object(object: crate::Object) -> impl IntoView {
|
|||
} else {
|
||||
Some(view! { <div class="pb-1"></div> })
|
||||
};
|
||||
|
||||
let audience_badge = object.audience().id().str()
|
||||
.map(|x| view! {
|
||||
<div class="inline border-solid">
|
||||
<code class="color">@</code>
|
||||
<small>
|
||||
<a class="clean dim" href={x.clone()} target="_blank" rel="nofollow noreferrer">
|
||||
{Uri::pretty(&x)}
|
||||
</a>
|
||||
</small>
|
||||
</div>
|
||||
});
|
||||
|
||||
let post_inner = view! {
|
||||
<Summary summary=object.summary().ok().map(|x| x.to_string()) >
|
||||
<p inner_html={content}></p>
|
||||
|
@ -158,7 +145,7 @@ pub fn Object(object: crate::Object) -> impl IntoView {
|
|||
}.into_view(),
|
||||
// lemmy with Page, peertube with Video
|
||||
Ok(apb::ObjectType::Document(t)) => view! {
|
||||
<div class="border pa-1 ml-1 mr-1 mt-1">
|
||||
<div class="border ml-1 mr-1 mt-1">
|
||||
<b>{object.name().unwrap_or_default().to_string()}</b>
|
||||
<hr />
|
||||
{post_inner}
|
||||
|
@ -201,7 +188,6 @@ pub fn Object(object: crate::Object) -> impl IntoView {
|
|||
</table>
|
||||
{post}
|
||||
<div class="mt-s ml-1 rev">
|
||||
{audience_badge}
|
||||
<ReplyButton n=comments target=oid.clone() />
|
||||
<LikeButton n=likes liked=already_liked target=oid.clone() author=author_id private=!public />
|
||||
<RepostButton n=shares target=oid />
|
||||
|
|
|
@ -15,7 +15,7 @@ pub fn RegisterPage() -> impl IntoView {
|
|||
view! {
|
||||
<div class="two-col">
|
||||
<Breadcrumb>register</Breadcrumb>
|
||||
<div class="border ma-2 pa-1">
|
||||
<div class="border ma-2">
|
||||
<form on:submit=move|ev| {
|
||||
ev.prevent_default();
|
||||
logging::log!("registering new user...");
|
||||
|
|
Loading…
Reference in a new issue