From 8e25e9b2a4d8f9f14933be7fdd92b835c47fb677 Mon Sep 17 00:00:00 2001 From: Valentin Tolmer Date: Fri, 25 Apr 2025 15:46:10 +0900 Subject: [PATCH] app: Add a create user/group button at the top --- app/src/components/app.rs | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/app/src/components/app.rs b/app/src/components/app.rs index 76f62ec..4244383 100644 --- a/app/src/components/app.rs +++ b/app/src/components/app.rs @@ -196,15 +196,21 @@ impl App { AppRoute::CreateUser => html! { }, - AppRoute::Index | AppRoute::ListUsers => html! { -
- + AppRoute::Index | AppRoute::ListUsers => { + let user_button = html! { {"Create a user"} -
- }, + }; + html! { +
+ { user_button.clone() } + + { user_button } +
+ } + } AppRoute::CreateGroup => html! { }, @@ -214,15 +220,23 @@ impl App { AppRoute::CreateGroupAttribute => html! { }, - AppRoute::ListGroups => html! { -
- + AppRoute::ListGroups => { + let group_button = html! { {"Create a group"} -
- }, + }; + // Note: There's a weird bug when switching from the users page to the groups page + // where the two groups buttons are at the bottom. I don't know why. + html! { +
+ { group_button.clone() } + + { group_button } +
+ } + } AppRoute::ListUserSchema => html! { },