All checks were successful
actionlint check / actionlint check (pull_request) Successful in 6s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 3s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 5s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 12s
GitLeaks check / GitLeaks check (pull_request) Successful in 11s
hadolint check / hadolint check (pull_request) Successful in 28s
markdownlint check / markdownlint check (pull_request) Successful in 52s
Prettier check / Prettier check (pull_request) Successful in 36s
htmlhint check / htmlhint check (pull_request) Successful in 55s
checkov check / checkov check (pull_request) Successful in 1m15s
Stylelint check / Stylelint check (pull_request) Successful in 31s
yamllint check / yamllint check (pull_request) Successful in 29s
ShellCheck check / ShellCheck check (pull_request) Successful in 1m9s
Rust check / Rust check (pull_request) Successful in 22m2s
76 lines
2.7 KiB
Rust
76 lines
2.7 KiB
Rust
use crate::components::navigation_item::NavigationItem;
|
|
use crate::route::Route;
|
|
use dioxus::prelude::*;
|
|
use dioxus_free_icons::Icon;
|
|
use dioxus_free_icons::icons::fa_regular_icons::FaLightbulb;
|
|
use dioxus_free_icons::icons::fa_solid_icons::{
|
|
FaBars, FaCalendarDay, FaCalendarDays, FaHourglassHalf, FaInbox, FaList, FaSignsPost,
|
|
FaTrashCan, FaVolcano,
|
|
};
|
|
|
|
#[component]
|
|
pub(crate) fn Navigation(is_expanded: Signal<bool>) -> Element {
|
|
rsx! {
|
|
div {
|
|
class: "grid grid-cols-5 justify-stretch",
|
|
button {
|
|
class: format!(
|
|
"py-2 flex flex-row justify-center items-center cursor-pointer",
|
|
),
|
|
onclick: move |_| is_expanded.set(!is_expanded()),
|
|
div {
|
|
class: format!("pt-2.5 px-4 {} transition-all duration-150",
|
|
if is_expanded() { "pb-2 mt-1 bg-gray-900 text-gray-400 rounded-xl drop-shadow-[0_calc(0px_-_var(--spacing))_0_var(--color-gray-950)]" }
|
|
else { "pb-3 bg-gray-800 rounded-xl drop-shadow-[0_0_0_var(--color-gray-950)] text-gray-600" }
|
|
),
|
|
Icon {
|
|
icon: FaBars,
|
|
height: 24,
|
|
width: 24
|
|
}
|
|
}
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategoryNextStepsPage,
|
|
icon: FaSignsPost
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategoryCalendarPage,
|
|
icon: FaCalendarDays
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategoryTodayPage,
|
|
icon: FaCalendarDay
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategoryInboxPage,
|
|
icon: FaInbox
|
|
},
|
|
{if is_expanded() {
|
|
rsx! {
|
|
NavigationItem {
|
|
route: Route::ProjectsPage,
|
|
icon: FaList
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategoryTrashPage,
|
|
icon: FaTrashCan
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategoryDonePage,
|
|
icon: FaVolcano
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategorySomedayMaybePage,
|
|
icon: FaLightbulb
|
|
},
|
|
NavigationItem {
|
|
route: Route::CategoryWaitingForPage,
|
|
icon: FaHourglassHalf
|
|
}
|
|
}
|
|
} else { VNode::empty() }}
|
|
}
|
|
}
|
|
}
|