feat: UI overhaul
Some checks failed
actionlint check / actionlint check (pull_request) Successful in 6s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 6s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 8s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 10s
GitLeaks check / GitLeaks check (pull_request) Successful in 13s
hadolint check / hadolint check (pull_request) Successful in 18s
Prettier check / Prettier check (pull_request) Successful in 41s
htmlhint check / htmlhint check (pull_request) Successful in 57s
markdownlint check / markdownlint check (pull_request) Successful in 50s
checkov check / checkov check (pull_request) Successful in 1m38s
ShellCheck check / ShellCheck check (pull_request) Successful in 32s
Stylelint check / Stylelint check (pull_request) Successful in 32s
yamllint check / yamllint check (pull_request) Successful in 31s
Rust check / Rust check (pull_request) Has been cancelled

This commit is contained in:
2026-01-28 19:36:00 +01:00
parent be1a21b746
commit eb6f7e7a1c
41 changed files with 839 additions and 994 deletions

View File

@@ -1,78 +1,22 @@
use crate::components::error_boundary_message::ErrorBoundaryMessage;
use crate::components::navigation::Navigation;
use crate::components::project_form::ProjectForm;
use crate::components::task_form::TaskForm;
use crate::models::project::Project;
use crate::models::task::Task;
use crate::route::Route;
use dioxus::prelude::*;
#[component]
pub(crate) fn BottomPanel(display_form: Signal<bool>) -> Element {
// A signal for delaying the application of styles.
#[allow(clippy::redundant_closure)]
let mut expanded = use_signal(|| display_form());
pub(crate) fn BottomPanel() -> Element {
let navigation_expanded = use_signal(|| false);
let current_route = use_route();
let mut project_being_edited = use_context::<Signal<Option<Project>>>();
let mut task_being_edited = use_context::<Signal<Option<Task>>>();
use_effect(use_reactive(&display_form, move |display_form| {
if display_form() {
expanded.set(true);
} else {
spawn(async move {
// Necessary for a smooth not instant height transition.
#[cfg(not(feature = "server"))]
async_std::task::sleep(std::time::Duration::from_millis(500)).await;
/* The check is necessary for the situation when the user expands the panel while
it is being closed. */
if !display_form() {
expanded.set(false);
}
});
}
}));
rsx! {
div {
class: format!(
"flex flex-col pointer-events-auto bg-zinc-700/50 rounded-t-xl border-t-zinc-600 border-t backdrop-blur drop-shadow-[0_-5px_10px_rgba(0,0,0,0.2)] transition-[height] duration-[500ms] ease-[cubic-bezier(0.79,0.14,0.15,0.86)] overflow-y-scroll {}",
match (display_form(), current_route, navigation_expanded()) {
(false, _, false) => "h-[64px]",
(false, _, true) => "h-[130px]",
(true, Route::ProjectsPage, _) => "h-[130px]",
(true, _, _) => "h-[506px]",
"flex flex-col pointer-events-auto bg-gray-800 transition-[height] duration-[500ms] ease-[cubic-bezier(0.79,0.14,0.15,0.86)] overflow-y-scroll {}",
if navigation_expanded() {
"h-[130px]"
} else {
"h-[66px]"
}
),
if expanded() {
ErrorBoundaryMessage {
match current_route {
Route::ProjectsPage => rsx! {
ProjectForm {
project: project_being_edited(),
on_successful_submit: move |_| {
display_form.set(false);
project_being_edited.set(None);
}
}
},
_ => rsx! {
TaskForm {
task: task_being_edited(),
on_successful_submit: move |_| {
display_form.set(false);
task_being_edited.set(None);
}
}
}
}
}
} else {
Navigation {
expanded: navigation_expanded,
}
Navigation {
is_expanded: navigation_expanded,
}
}
}