From ccb09d5a2b84b0ca3a1a17b376b6ce50ed5b817b Mon Sep 17 00:00:00 2001 From: b-avb Date: Mon, 28 Oct 2024 09:54:24 -0500 Subject: [PATCH] change: add events for input --- src/components/molecules/actions/transfer.rs | 2 ++ src/components/molecules/actions/treasury.rs | 2 ++ src/components/molecules/actions/voting.rs | 1 + src/components/molecules/header.rs | 8 +++++--- src/components/molecules/initiative/info.rs | 3 ++- src/components/molecules/onboarding/basics.rs | 6 ++++-- src/components/molecules/sidebar.rs | 11 ++++++++--- 7 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/components/molecules/actions/transfer.rs b/src/components/molecules/actions/transfer.rs index 8b837fd..cd99a58 100644 --- a/src/components/molecules/actions/transfer.rs +++ b/src/components/molecules/actions/transfer.rs @@ -41,6 +41,7 @@ pub fn TransferAction(props: VotingProps) -> Element { }, on_keypress: move |_| {}, on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } Input { message: (transfer.value / KUSAMA_PRECISION_DECIMALS).to_string(), @@ -65,6 +66,7 @@ pub fn TransferAction(props: VotingProps) -> Element { }, on_keypress: move |_| {}, on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } } IconButton { diff --git a/src/components/molecules/actions/treasury.rs b/src/components/molecules/actions/treasury.rs index a3144d5..69ded2a 100644 --- a/src/components/molecules/actions/treasury.rs +++ b/src/components/molecules/actions/treasury.rs @@ -81,6 +81,7 @@ pub fn TreasuryAction(props: VotingProps) -> Element { }, on_keypress: move |_| {}, on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } if index_meta > 0 { Input { @@ -97,6 +98,7 @@ pub fn TreasuryAction(props: VotingProps) -> Element { }, on_keypress: move |_| {}, on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } } } diff --git a/src/components/molecules/actions/voting.rs b/src/components/molecules/actions/voting.rs index a357ebd..189c1dd 100644 --- a/src/components/molecules/actions/voting.rs +++ b/src/components/molecules/actions/voting.rs @@ -44,6 +44,7 @@ pub fn VotingAction(props: VotingProps) -> Element { }, on_keypress: move |_| {}, on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } } div { diff --git a/src/components/molecules/header.rs b/src/components/molecules/header.rs index f070adf..d8b88a7 100644 --- a/src/components/molecules/header.rs +++ b/src/components/molecules/header.rs @@ -109,9 +109,11 @@ pub fn Header() -> Element { for account in accounts.get().into_iter() { let address = account.address(); - items.push(rsx!( - AccountButton { title: account.name(), description: address.clone(), on_click: move |_| {} } - )) + items.push(rsx!(AccountButton { + title: account.name(), + description: address.clone(), + on_click: move |_| { log::info!("click") } + })) } let on_handle_account = use_coroutine(move |mut rx: UnboundedReceiver| async move { diff --git a/src/components/molecules/initiative/info.rs b/src/components/molecules/initiative/info.rs index 8b42210..5db4fc3 100644 --- a/src/components/molecules/initiative/info.rs +++ b/src/components/molecules/initiative/info.rs @@ -57,7 +57,8 @@ pub fn InitiativeInfo(error: bool) -> Element { } }, on_keypress: move |_| {}, - on_click: move |_| {} + on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } } hr { class: "form__divider" } diff --git a/src/components/molecules/onboarding/basics.rs b/src/components/molecules/onboarding/basics.rs index d220239..2265719 100644 --- a/src/components/molecules/onboarding/basics.rs +++ b/src/components/molecules/onboarding/basics.rs @@ -65,7 +65,8 @@ pub fn OnboardingBasics(error: bool) -> Element { } }, on_keypress: move |_| {}, - on_click: move |_| {} + on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } TextareaInput { value: onboard.get_basics().description, @@ -94,7 +95,8 @@ pub fn OnboardingBasics(error: bool) -> Element { onboard.basics_mut().with_mut(|basics| basics.industry = event.value()); }, on_keypress: move |_| {}, - on_click: move |_| {} + on_click: move |_| {}, + on_focus: move |_| {}, on_blur: move |_| {} } } ) diff --git a/src/components/molecules/sidebar.rs b/src/components/molecules/sidebar.rs index 56feb0c..e1677ab 100644 --- a/src/components/molecules/sidebar.rs +++ b/src/components/molecules/sidebar.rs @@ -7,8 +7,11 @@ use crate::{ Icon, IconButton, OnOff, Star, }, hooks::{ - use_accounts::use_accounts, use_communities::use_communities, - use_our_navigator::use_our_navigator, use_tooltip::use_tooltip, + use_accounts::use_accounts, + use_communities::use_communities, + use_our_navigator::use_our_navigator, + use_tabs::{use_tabs, Tab}, + use_tooltip::use_tooltip, }, }; #[component] @@ -18,6 +21,7 @@ pub fn Sidebar() -> Element { let nav = use_our_navigator(); let mut tooltip = use_tooltip(); let accounts = use_accounts(); + let mut tabs = use_tabs(); let mut is_active = use_signal(|| false); @@ -133,7 +137,8 @@ pub fn Sidebar() -> Element { class: if active_community.id == community.id { "sidebar__item--active" }, onclick: move |_| { if let Ok(_) = communities.set_community(community_id) { - let path = format!("/dao/{}/initiatives", community_id); + let path = format!("/dao/{}/plugins", community_id); + tabs.push(Tab { name: "Home".to_string(), path: path.clone() }); nav.push(vec![], &path); }; },