diff --git a/web/src/lib.rs b/web/src/lib.rs index d4e7f17..d331231 100644 --- a/web/src/lib.rs +++ b/web/src/lib.rs @@ -92,7 +92,7 @@ pub fn LoginBox( } #[component] -pub fn TimelineNavigation() -> impl IntoView { +pub fn Navigator() -> impl IntoView { let auth = use_context::>>().expect("missing auth context"); view! { @@ -111,6 +111,14 @@ pub fn TimelineNavigation() -> impl IntoView { value="server timeline" /> + + + } } @@ -250,7 +258,7 @@ pub fn UserPage() -> impl IntoView { view! {
view::user
-
+
{move || match actor.get() { None => view! {

loading...

}.into_view(), Some(None) => view! {

error loading

}.into_view(), @@ -306,7 +314,7 @@ pub fn ObjectPage() -> impl IntoView { view! {
view::object
-
+
{move || match object.get() { Some(Some(o)) => view!{ }.into_view(), Some(None) => view! {

loading failed

}.into_view(), @@ -418,9 +426,9 @@ pub fn InlineActivity(activity: serde_json::Value) -> impl IntoView { pub fn About() -> impl IntoView { view! {
-
landing
-
- nothing to see here! pick a timeline to start browsing +
about
+
+

μpub" is a micro social network powered by "ActivityPub

} @@ -435,7 +443,7 @@ pub fn TimelinePage(name: &'static str, tl: Timeline) -> impl IntoView { view! {
{name}
-
+
diff --git a/web/src/main.rs b/web/src/main.rs index 804407f..15ad5e4 100644 --- a/web/src/main.rs +++ b/web/src/main.rs @@ -4,15 +4,15 @@ use leptos_router::*; use leptos_use::{use_cookie, utils::FromToStringCodec}; use upub_web::{ URL_BASE, context::Timeline, About, LoginBox, MaybeToken, ObjectPage, PostBox, - TimelinePage, TimelineNavigation, UserPage + TimelinePage, Navigator, UserPage }; fn main() { _ = console_log::init_with_level(log::Level::Info); console_error_panic_hook::set_once(); - let (cookie, set_cookie) = use_cookie::("token"); + let (token, set_token) = use_cookie::("token"); let (username, set_username) = use_cookie::("username"); - provide_context(cookie); + provide_context(token); let home_tl = Timeline::new(format!("{URL_BASE}/users/{}/inbox/page", username.get().unwrap_or_default())); let server_tl = Timeline::new(format!("{URL_BASE}/inbox/page")); @@ -20,14 +20,14 @@ fn main() { let (menu, set_menu) = create_signal(false); spawn_local(async move { - if let Err(e) = server_tl.more(cookie).await { + if let Err(e) = server_tl.more(token).await { console_error(&format!("error populating timeline: {e}")); } }); - if cookie.get().is_some() { + if token.get().is_some() { spawn_local(async move { - if let Err(e) = home_tl.more(cookie).await { + if let Err(e) = home_tl.more(token).await { console_error(&format!("error populating timeline: {e}")); } }); @@ -36,7 +36,7 @@ fn main() { mount_to_body( move || view! {