From e823cafb1a659f4d35164eedb85d098271fca20a Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Sat, 24 May 2025 12:43:07 +0100 Subject: feat: settings panel with page tabbing --- src/lib.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 92c764d..189d050 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1073,7 +1073,7 @@ pub fn Modal(on_background_click: impl Fn(MouseEvent) + 'static, children: Child } } -#[derive(Clone, Copy, Debug)] +#[derive(Clone, Copy, Debug, PartialEq, Eq)] pub enum SettingsPage { Account, Chat, @@ -1096,17 +1096,17 @@ pub fn Settings() -> impl IntoView {
-
Account
-
Chat
-
Privacy
-
Profile
+
Account
+
Chat
+
Privacy
+
Profile
-
+
{move || if let Some(page) = show_settings.get() { match page { SettingsPage::Account => view! {
"account"
}.into_any(), SettingsPage::Chat => view! {
"chat"
}.into_any(), - SettingsPage::Profile => view! {
"profile"
}.into_any(), + SettingsPage::Profile => view! { }.into_any(), SettingsPage::Privacy => view! {
"privacy"
}.into_any(), } } else { @@ -1121,7 +1121,10 @@ pub fn Settings() -> impl IntoView { #[component] pub fn ProfileSettings() -> impl IntoView { - view! {} + view! { +
+
+ } } #[component] @@ -1796,8 +1799,6 @@ where { let store = self.inner.try_get_value().unwrap(); let mut store = store.store.write().unwrap(); - debug!("got store"); - debug!("got store 2"); if let Some((v, count)) = store.get_mut(&key) { *v = value.clone(); *count += 1; -- cgit