-
- }
- >
-
-
+
+ // This will render the child route components
+
diff --git a/src/components/sidebar.rs b/src/components/sidebar.rs
index 805fa4e..0621704 100644
--- a/src/components/sidebar.rs
+++ b/src/components/sidebar.rs
@@ -3,28 +3,30 @@ use leptos::*;
use leptos_icons::*;
#[component]
-pub fn Sidebar(setter: WriteSignal, active: ReadSignal) -> impl IntoView {
- let open_dashboard = move |_| {
- setter.update(|value| *value = true);
- log!("open dashboard");
- };
- let open_search = move |_| {
- setter.update(|value| *value = false);
- log!("open search");
- };
+pub fn Sidebar() -> impl IntoView {
+ use leptos_router::use_location;
+ let location = use_location();
+
+ let on_dashboard = Signal::derive(
+ move || location.pathname.get().starts_with("/dashboard") || location.pathname.get() == "/",
+ );
+
+ let on_search = Signal::derive(
+ move || location.pathname.get().starts_with("/search"),
+ );
view! {