Skip to content

Commit

Permalink
feat(site): bootstrapped profile page
Browse files Browse the repository at this point in the history
  • Loading branch information
johnbchron committed Dec 21, 2024
1 parent ddbd310 commit 4c79df1
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/site-app/src/components/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn LoggedInUserAuthActions(user: PublicUser) -> impl IntoView {
view! {
<span class="text-sm text-base-dim">
"Welcome, "
<Link size=LinkSize::Small underline={LinkUnderline::Always} {..} href="/account">
<Link size=LinkSize::Small underline={LinkUnderline::Always} {..} href="/profile">
{ user.name.to_string() }
</Link>
</span>
Expand Down
1 change: 1 addition & 0 deletions crates/site-app/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ pub fn App() -> impl IntoView {
<Route path=path!("/sign-up") view=SignupPage/>
<Route path=path!("/log-in") view=LoginPage />
<Route path=path!("/log-out") view=LogoutPage/>
<Route path=path!("/profile") view=ProfilePage/>
<Route path=path!("/component-testing/link") view=lsc::link::LinkMatrixTestPage/>
<Route path=path!("/component-testing/button") view=lsc::button::ButtonMatrixTestPage/>
<Route path=path!("/component-testing/field") view=lsc::field::FieldMatrixTestPage/>
Expand Down
2 changes: 1 addition & 1 deletion crates/site-app/src/pages/login_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
});

Expand Down
3 changes: 2 additions & 1 deletion crates/site-app/src/pages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*,
};
18 changes: 18 additions & 0 deletions crates/site-app/src/pages/profile_page.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use leptos::prelude::*;

use crate::components::Section;

#[component]
pub fn ProfilePage() -> impl IntoView {
view! {
<Section>
<p class="text-6xl font-serif font-light tracking-tight mb-4">
"User Profile"
</p>
</Section>
<Section>
<pre><code>
</code></pre>
</Section>
}
}
2 changes: 1 addition & 1 deletion crates/site-app/src/pages/signup_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
});

Expand Down

0 comments on commit 4c79df1

Please sign in to comment.