This commit is contained in:
Florian RICHER 2023-10-09 19:56:06 +02:00
parent f1ae831b09
commit 8e4800ae8c
6 changed files with 38 additions and 13 deletions

View file

@ -1,4 +1,6 @@
use leptos::*;
use leptos_icons::FaIcon::FaCaretDownSolid;
use leptos_icons::*;
#[component]
pub fn Timeline(
@ -6,9 +8,29 @@ pub fn Timeline(
) -> impl IntoView {
view! {
<div class="w-full px-5">
<ul class="list-none py-5 px-0 relative w-full max-w-5xl mx-auto before:top-0 before:bottom-0 before:left-0 before:md:left-1/2 before:absolute before:content-[""] before:w-2 before:bg-primary/10 before:dark:bg-dark_primary/10 before:shadow-md before:shadow-primary/5 before:dark:shadow-dark_primary/5">
<ul class="list-none py-5 px-0 relative w-full max-w-5xl mx-auto before:top-0 before:bottom-0 before:left-0 before:md:left-1/2 before:absolute before:content-[\"\"] before:w-2 before:bg-primary/10 before:dark:bg-dark_primary/10 before:shadow-md before:shadow-primary/5 before:dark:shadow-dark_primary/5">
{ children() }
</ul>
</div>
}
}
#[component]
pub fn TimelineCard<F, IV>(
titles: F,
children: Children,
) -> impl IntoView
where
F: Fn() -> IV,
IV: IntoView,
{
view! {
<details>
<summary>
{ titles() }
<i><Icon icon=Icon::from(FaCaretDownSolid) /></i>
</summary>
<div>{ children() }</div>
</details>
}
}