From 0e7a45306d20d52e06288eefd4e462ec6ae1d23e Mon Sep 17 00:00:00 2001 From: Felix Ableitner Date: Tue, 12 Nov 2024 23:40:17 +0100 Subject: [PATCH] format --- src/frontend/components/nav.rs | 7 ++++++- src/frontend/pages/notifications.rs | 25 +++++++++++++++++-------- src/frontend/pages/user_profile.rs | 4 +++- 3 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/frontend/components/nav.rs b/src/frontend/components/nav.rs index ab08dcb..ee69596 100644 --- a/src/frontend/components/nav.rs +++ b/src/frontend/components/nav.rs @@ -66,7 +66,12 @@ pub fn Nav() -> impl IntoView { "Create Article"
  • - "Notifications "{notification_count} + + "Notifications " + + {notification_count} + +
  • diff --git a/src/frontend/pages/notifications.rs b/src/frontend/pages/notifications.rs index 63cdabf..dd5884c 100644 --- a/src/frontend/pages/notifications.rs +++ b/src/frontend/pages/notifications.rs @@ -28,16 +28,25 @@ pub fn Notifications() -> impl IntoView { .map(|n| { use Notification::*; let (link, title) = match n { - EditConflict(c) => (format!( - "{}/edit/{}", - article_link(&c.article), - c.id.0) - , format!("Conflict: {} - {}", article_title(&c.article), c.summary)), - ArticleApprovalRequired(a) => (article_link(&a), format!("Approval required: {}", a.title)), - + EditConflict(c) => { + ( + format!("{}/edit/{}", article_link(&c.article), c.id.0), + format!( + "Conflict: {} - {}", + article_title(&c.article), + c.summary, + ), + ) + } + ArticleApprovalRequired(a) => { + ( + article_link(&a), + format!("Approval required: {}", a.title), + ) + } }; - // TODO: need buttons to approve/reject new article, also makes sense to discard edit conflict view! { + // TODO: need buttons to approve/reject new article, also makes sense to discard edit conflict
  • {title} diff --git a/src/frontend/pages/user_profile.rs b/src/frontend/pages/user_profile.rs index b9c24eb..0efc079 100644 --- a/src/frontend/pages/user_profile.rs +++ b/src/frontend/pages/user_profile.rs @@ -38,7 +38,9 @@ pub fn UserProfile() -> impl IntoView { .get() .map(|person: DbPerson| { view! { -

    {user_title(&person)}

    +

    + {user_title(&person)} +

    TODO: create actual user profile

    } })