From 4c79df1d88790604c8db2b637aa224b5ce29dc04 Mon Sep 17 00:00:00 2001 From: John Lewis Date: Sat, 21 Dec 2024 11:11:18 -0600 Subject: [PATCH] feat(site): bootstrapped profile page --- crates/site-app/src/components/header.rs | 2 +- crates/site-app/src/lib.rs | 1 + crates/site-app/src/pages/login_page.rs | 2 +- crates/site-app/src/pages/mod.rs | 3 ++- crates/site-app/src/pages/profile_page.rs | 18 ++++++++++++++++++ crates/site-app/src/pages/signup_page.rs | 2 +- 6 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 crates/site-app/src/pages/profile_page.rs diff --git a/crates/site-app/src/components/header.rs b/crates/site-app/src/components/header.rs index 5b3e524..ab4b9d7 100644 --- a/crates/site-app/src/components/header.rs +++ b/crates/site-app/src/components/header.rs @@ -56,7 +56,7 @@ fn LoggedInUserAuthActions(user: PublicUser) -> impl IntoView { view! { "Welcome, " - + { user.name.to_string() } diff --git a/crates/site-app/src/lib.rs b/crates/site-app/src/lib.rs index 57d37f0..f87191a 100644 --- a/crates/site-app/src/lib.rs +++ b/crates/site-app/src/lib.rs @@ -63,6 +63,7 @@ pub fn App() -> impl IntoView { + diff --git a/crates/site-app/src/pages/login_page.rs b/crates/site-app/src/pages/login_page.rs index 6e678b8..b38060b 100644 --- a/crates/site-app/src/pages/login_page.rs +++ b/crates/site-app/src/pages/login_page.rs @@ -31,7 +31,7 @@ pub fn LoginPage() -> impl IntoView { Effect::new(move |_| { if matches!(action_value(), Some(Ok(true))) { - crate::utils::navigation::navigate_to("/"); + crate::utils::navigation::navigate_to("/profile"); } }); diff --git a/crates/site-app/src/pages/mod.rs b/crates/site-app/src/pages/mod.rs index d0cb1c5..2bbe430 100644 --- a/crates/site-app/src/pages/mod.rs +++ b/crates/site-app/src/pages/mod.rs @@ -2,9 +2,10 @@ mod home_page; mod login_page; mod logout_page; mod not_found_page; +mod profile_page; mod signup_page; pub use self::{ home_page::*, login_page::*, logout_page::*, not_found_page::*, - signup_page::*, + profile_page::*, signup_page::*, }; diff --git a/crates/site-app/src/pages/profile_page.rs b/crates/site-app/src/pages/profile_page.rs new file mode 100644 index 0000000..7677ac1 --- /dev/null +++ b/crates/site-app/src/pages/profile_page.rs @@ -0,0 +1,18 @@ +use leptos::prelude::*; + +use crate::components::Section; + +#[component] +pub fn ProfilePage() -> impl IntoView { + view! { +
+

+ "User Profile" +

+
+
+

+      
+
+ } +} diff --git a/crates/site-app/src/pages/signup_page.rs b/crates/site-app/src/pages/signup_page.rs index e18827d..decd529 100644 --- a/crates/site-app/src/pages/signup_page.rs +++ b/crates/site-app/src/pages/signup_page.rs @@ -126,7 +126,7 @@ pub fn SignupPage() -> impl IntoView { Effect::new(move |_| { if action_succeeded() { - crate::utils::navigation::navigate_to("/"); + crate::utils::navigation::navigate_to("/profile"); } });