diff --git a/frontend/src/app.rs b/frontend/src/app.rs index 228246d..b1ed5df 100644 --- a/frontend/src/app.rs +++ b/frontend/src/app.rs @@ -1,4 +1,4 @@ -use crate::components::layout::protected::Protected; +use crate::components::layout::protected::ProtectedLayout; use crate::components::ui::skeleton::Skeleton; use crate::components::torrent::table::TorrentTable; use crate::components::auth::login::Login; @@ -50,13 +50,11 @@ fn InnerApp() -> impl IntoView { Effect::new(move |_| { spawn_local(async move { log::info!("App initialization started..."); - gloo_console::log!("APP INIT: Checking setup status..."); - + // Check if setup is needed via Server Function match shared::server_fns::auth::get_setup_status().await { Ok(status) => { if !status.completed { - log::info!("Setup not completed"); needs_setup.1.set(true); is_loading.1.set(false); return; @@ -68,7 +66,6 @@ fn InnerApp() -> impl IntoView { // Check authentication via GetUser Server Function match shared::server_fns::auth::get_user().await { Ok(Some(user_info)) => { - log::info!("Authenticated as {}", user_info.username); if let Some(s) = store { s.user.set(Some(user_info.username)); } @@ -83,7 +80,6 @@ fn InnerApp() -> impl IntoView { } is_loading.1.set(false); - crate::store::toast_success("VibeTorrent'e Hoşgeldiniz"); }); }); @@ -99,11 +95,14 @@ fn InnerApp() -> impl IntoView { } }); + let is_loading_val = move || is_loading.0.get(); + let authenticated_val = move || is_authenticated.0.get(); + view! {
"404 Not Found"
}> impl IntoView { let navigate = use_navigate(); navigate("/setup", Default::default()); } else if authenticated { - log::info!("Already authenticated, redirecting to home"); let navigate = use_navigate(); navigate("/", Default::default()); } @@ -121,7 +119,7 @@ fn InnerApp() -> impl IntoView { } /> impl IntoView { - // Sidebar skeleton
- - -
- // Main content skeleton
- -
- - - - -
-
-
- }.into_any() + } }> - - + +
-
+
- }.into_any() + } }/> impl IntoView { }); view! { - - - + + +
"Settings Page (Coming Soon)"
-
+
} diff --git a/frontend/src/components/layout/protected.rs b/frontend/src/components/layout/protected.rs index c4d37c7..65a4e82 100644 --- a/frontend/src/components/layout/protected.rs +++ b/frontend/src/components/layout/protected.rs @@ -1,29 +1,22 @@ use leptos::prelude::*; use crate::components::layout::sidebar::Sidebar; use crate::components::layout::toolbar::Toolbar; -use crate::components::layout::footer::Footer; -use crate::components::ui::sidenav::{SidenavWrapper, Sidenav, SidenavInset}; +use crate::components::ui::sidenav::{SidenavWrapper, Sidenav, SidenavInset, SidenavState}; #[component] -pub fn Protected(children: Children) -> impl IntoView { +pub fn ProtectedLayout(children: Children) -> impl IntoView { + let sidenav_state = RwSignal::new(SidenavState::Expanded); + view! { - // Masaüstü Sidenav - + - - // İçerik Alanı + - // Toolbar (Üst Bar) - - - // Ana İçerik -
-
- {children()} -
-