docs: add explaining comments

This commit is contained in:
Matouš Volf 2024-09-06 07:39:12 +02:00
parent 50e375212c
commit fb66a19a09
2 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,7 @@ use crate::route::Route;
#[component] #[component]
pub(crate) fn BottomPanel(display_form: Signal<bool>) -> Element { pub(crate) fn BottomPanel(display_form: Signal<bool>) -> Element {
// A signal for delaying the application of styles.
#[allow(clippy::redundant_closure)] #[allow(clippy::redundant_closure)]
let mut expanded = use_signal(|| display_form()); let mut expanded = use_signal(|| display_form());
let navigation_expanded = use_signal(|| false); let navigation_expanded = use_signal(|| false);
@ -16,6 +17,7 @@ pub(crate) fn BottomPanel(display_form: Signal<bool>) -> Element {
expanded.set(true); expanded.set(true);
} else { } else {
spawn(async move { spawn(async move {
// Necessary for a smooth not instant height transition.
async_std::task::sleep(std::time::Duration::from_millis(500)).await; async_std::task::sleep(std::time::Duration::from_millis(500)).await;
expanded.set(false); expanded.set(false);
}); });

View File

@ -12,6 +12,8 @@ use crate::components::pages::not_found_page::NotFoundPage;
use crate::components::layout::Layout; use crate::components::layout::Layout;
use dioxus::prelude::*; use dioxus::prelude::*;
// All variants have the same postfix because they have to match the component names.
#[allow(clippy::enum_variant_names)]
#[derive(Clone, Routable, Debug, PartialEq)] #[derive(Clone, Routable, Debug, PartialEq)]
#[rustfmt::skip] #[rustfmt::skip]
pub(crate) enum Route { pub(crate) enum Route {