Login Implementation

This commit is contained in:
2025-05-17 16:55:51 -04:00
parent bb740cbefc
commit d40c379216
15 changed files with 201 additions and 25 deletions

View File

@@ -1,10 +0,0 @@
use dioxus::prelude::*;
use crate::route::Route;
#[component]
pub fn BasicLayout() -> Element {
rsx! {
Outlet::<Route> {}
}
}

View File

@@ -1,14 +1,14 @@
use dioxus::prelude::*;
use crate::{components::Navbar, contexts::AuthContext, layouts::BasicLayout, views::Login, Route};
use crate::{components::Navbar, contexts::AuthContext, views::Login, Route};
#[component]
pub fn MainLayout() -> Element {
let auth_context = use_context::<AuthContext>();
// if auth_context.jwt.cloned().is_none() {
// return rsx! { Login { } };
// }
if auth_context.jwt.cloned().is_none() {
return rsx! { Login { } };
}
return rsx! {
Navbar {}

View File

@@ -1,4 +1,2 @@
mod basic_layout;
mod main_layout;
pub use basic_layout::*;
pub use main_layout::*;