feat: create sidebar tabs list
This commit is contained in:
1 parent
9e418dddf5
commit
4a2a5ca9ff
12 files changed
+158
-7
No files matched your search
@@ -0,0 +1,2 @@
|
||||
mod shell;
|
||||
pub use shell::*;
|
||||
@@ -0,0 +1,49 @@
|
||||
use leptos::prelude::*;
|
||||
use crate::common::TabInfo;
|
||||
use crate::components::{Banner, TabSidebarList};
|
||||
use crate::components::login::AdminLoginContext;
|
||||
|
||||
/// # Admin Shell Component
|
||||
///
|
||||
/// This shell should keep track of pretty much everything that changes across the admin page. It
|
||||
/// will provide the login context, the banner, and the tabs.
|
||||
#[component]
|
||||
pub fn AdminShell() -> impl IntoView {
|
||||
// Create login context
|
||||
view! {
|
||||
<AdminLoginContext>
|
||||
<Banner title="R15 Scholarships Admin" logo="/PHS_Stacked_Acronym.png" />
|
||||
// We'll put the tabs here.
|
||||
<TabSidebarList
|
||||
tabs=vec![
|
||||
TabInfo {
|
||||
name: "Home".to_string(),
|
||||
path: "/admin/home".to_string(),
|
||||
},
|
||||
TabInfo {
|
||||
name: "Test".to_string(),
|
||||
path: "/admin/testing".to_string(),
|
||||
}
|
||||
]
|
||||
/>
|
||||
</AdminLoginContext>
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn AdminFallback() -> impl IntoView {
|
||||
view! {
|
||||
<div>
|
||||
<p class="mx-auto">"This is a fallback page"</p>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn AdminTesting() -> impl IntoView {
|
||||
view! {
|
||||
<div>
|
||||
<p class="mx-auto">"This is a testing page"</p>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -10,9 +10,10 @@ mod unauthenticated_page;
|
||||
mod provider_contact;
|
||||
mod auth_callback;
|
||||
mod provider_applicants;
|
||||
mod admin;
|
||||
|
||||
pub use self::{
|
||||
about_page::*, comparison_test::*, home_page::*, loaner_page::*, provider_portal::*,
|
||||
test_page::*, unauthenticated_page::*, scholarship_info::*, provider_contact::*,
|
||||
auth_callback::*, provider_applicants::*
|
||||
auth_callback::*, provider_applicants::*, admin::*
|
||||
};
|
||||
Reference in new issue
Block a user