Added Auth Context
implement login client code (todo: server login) Added aboa icon
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
use dioxus::prelude::*;
|
||||
|
||||
use crate::{components::Navbar, Route};
|
||||
use crate::{components::Navbar, contexts::AuthContext, layouts::BasicLayout, views::Login, Route};
|
||||
|
||||
#[component]
|
||||
pub fn MainLayout() -> Element {
|
||||
rsx! {
|
||||
let auth_context = use_context::<AuthContext>();
|
||||
|
||||
// if auth_context.jwt.cloned().is_none() {
|
||||
// return rsx! { Login { } };
|
||||
// }
|
||||
|
||||
return rsx! {
|
||||
Navbar {}
|
||||
Outlet::<Route> {}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user