docs: add explaining comments
This commit is contained in:
parent
50e375212c
commit
fb66a19a09
@ -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);
|
||||||
});
|
});
|
||||||
|
@ -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 {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user