Silence warnings, run cargo fmt
This commit is contained in:
parent
fe1c1d3655
commit
af1c767f5f
77 changed files with 1904 additions and 903 deletions
|
|
@ -110,8 +110,7 @@ pub fn use_auth_context() -> LocalResource<Option<AuthContextResponse>> {
|
|||
#[component]
|
||||
pub fn AuthenticatedLayout(
|
||||
current_page: &'static str,
|
||||
#[prop(default = "/admin")]
|
||||
base_path: &'static str,
|
||||
#[prop(default = "/admin")] base_path: &'static str,
|
||||
children: ChildrenFn,
|
||||
) -> impl IntoView {
|
||||
let auth_context = use_auth_context();
|
||||
|
|
@ -165,10 +164,8 @@ pub fn AuthenticatedLayout(
|
|||
fn Sidebar(
|
||||
current_page: &'static str,
|
||||
base_path: &'static str,
|
||||
#[prop(default = false)]
|
||||
is_server_staff: bool,
|
||||
#[prop(default = vec![])]
|
||||
managed_realms: Vec<(String, String)>,
|
||||
#[prop(default = false)] is_server_staff: bool,
|
||||
#[prop(default = vec![])] managed_realms: Vec<(String, String)>,
|
||||
) -> impl IntoView {
|
||||
// Build hrefs with base path
|
||||
let dashboard_href = base_path.to_string();
|
||||
|
|
@ -319,13 +316,22 @@ fn NavItem(
|
|||
label: &'static str,
|
||||
#[prop(default = false)] active: bool,
|
||||
/// Whether this is a sub-item (indented)
|
||||
#[prop(default = false)] sub: bool,
|
||||
#[prop(default = false)]
|
||||
sub: bool,
|
||||
) -> impl IntoView {
|
||||
let link_class = match (active, sub) {
|
||||
(true, false) => "block w-full px-6 py-2 bg-violet-600 text-white transition-all duration-150",
|
||||
(false, false) => "block w-full px-6 py-2 text-gray-400 hover:bg-slate-700 hover:text-white transition-all duration-150",
|
||||
(true, true) => "block w-full pl-10 pr-6 py-2 text-sm bg-violet-600 text-white transition-all duration-150",
|
||||
(false, true) => "block w-full pl-10 pr-6 py-2 text-sm text-gray-400 hover:bg-slate-700 hover:text-white transition-all duration-150",
|
||||
(true, false) => {
|
||||
"block w-full px-6 py-2 bg-violet-600 text-white transition-all duration-150"
|
||||
}
|
||||
(false, false) => {
|
||||
"block w-full px-6 py-2 text-gray-400 hover:bg-slate-700 hover:text-white transition-all duration-150"
|
||||
}
|
||||
(true, true) => {
|
||||
"block w-full pl-10 pr-6 py-2 text-sm bg-violet-600 text-white transition-all duration-150"
|
||||
}
|
||||
(false, true) => {
|
||||
"block w-full pl-10 pr-6 py-2 text-sm text-gray-400 hover:bg-slate-700 hover:text-white transition-all duration-150"
|
||||
}
|
||||
};
|
||||
|
||||
view! {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue