mirror of
https://github.com/Nutomic/ibis.git
synced 2024-11-29 01:41:09 +00:00
add protected routes
This commit is contained in:
parent
7f1ecd3e5c
commit
59c0a3bf90
3 changed files with 12 additions and 8 deletions
|
@ -1,14 +1,17 @@
|
|||
use crate::frontend::components::protected_route::IbisProtectedRoute;
|
||||
use crate::{
|
||||
common::SiteView,
|
||||
frontend::{
|
||||
api::CLIENT,
|
||||
components::nav::Nav,
|
||||
components::{nav::Nav, protected_route::IbisProtectedRoute},
|
||||
dark_mode::DarkMode,
|
||||
pages::{
|
||||
article::{
|
||||
actions::ArticleActions, create::CreateArticle, edit::EditArticle,
|
||||
history::ArticleHistory, list::ListArticles, read::ReadArticle,
|
||||
actions::ArticleActions,
|
||||
create::CreateArticle,
|
||||
edit::EditArticle,
|
||||
history::ArticleHistory,
|
||||
list::ListArticles,
|
||||
read::ReadArticle,
|
||||
},
|
||||
diff::EditDiff,
|
||||
instance::{details::InstanceDetails, list::ListInstances},
|
||||
|
@ -59,7 +62,7 @@ impl<T: Default + Send + Sync> DefaultResource<T> for Resource<T> {
|
|||
}
|
||||
pub fn shell(options: LeptosOptions) -> impl IntoView {
|
||||
view! {
|
||||
<!DOCTYPE html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
|
|
|
@ -4,4 +4,4 @@ pub mod credentials;
|
|||
pub mod editor;
|
||||
pub mod instance_follow_button;
|
||||
pub mod nav;
|
||||
pub mod protected_route;
|
||||
pub mod protected_route;
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use crate::frontend::app::is_logged_in;
|
||||
use leptos::prelude::*;
|
||||
use leptos_router::{
|
||||
components::{ProtectedRoute, ProtectedRouteProps},
|
||||
NestedRoute, SsrMode,
|
||||
NestedRoute,
|
||||
SsrMode,
|
||||
};
|
||||
use crate::frontend::app::is_logged_in;
|
||||
|
||||
#[component(transparent)]
|
||||
pub fn IbisProtectedRoute<Segments, ViewFn, View>(
|
||||
|
|
Loading…
Reference in a new issue