All checks were successful
actionlint check / actionlint check (pull_request) Successful in 5s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 7s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 5s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 10s
hadolint check / hadolint check (pull_request) Successful in 16s
GitLeaks check / GitLeaks check (pull_request) Successful in 10s
htmlhint check / htmlhint check (pull_request) Successful in 35s
Prettier check / Prettier check (pull_request) Successful in 26s
markdownlint check / markdownlint check (pull_request) Successful in 31s
checkov check / checkov check (pull_request) Successful in 1m15s
ShellCheck check / ShellCheck check (pull_request) Successful in 30s
Stylelint check / Stylelint check (pull_request) Successful in 29s
yamllint check / yamllint check (pull_request) Successful in 27s
Rust check / Rust check (pull_request) Successful in 11m44s
77 lines
2.4 KiB
Rust
77 lines
2.4 KiB
Rust
use crate::models::category::ReoccurrenceInterval;
|
|
use dioxus::core_macro::rsx;
|
|
use dioxus::dioxus_core::Element;
|
|
use dioxus::prelude::*;
|
|
|
|
#[component]
|
|
pub(crate) fn ReoccurrenceIntervalInput(
|
|
reoccurrence_interval: Signal<Option<ReoccurrenceInterval>>,
|
|
class_buttons: Option<&'static str>,
|
|
) -> Element {
|
|
rsx! {
|
|
button {
|
|
r#type: "button",
|
|
class: format!(
|
|
"py-2 rounded-lg {} {} cursor-pointer",
|
|
class_buttons.unwrap_or(""),
|
|
if reoccurrence_interval().is_none() { "bg-zinc-500/50" }
|
|
else { "bg-zinc-800/50" }
|
|
),
|
|
onclick: move |_| {
|
|
reoccurrence_interval.set(None);
|
|
},
|
|
i {
|
|
class: "fa-solid fa-ban"
|
|
}
|
|
},
|
|
button {
|
|
r#type: "button",
|
|
class: format!(
|
|
"py-2 rounded-lg {} {} cursor-pointer",
|
|
class_buttons.unwrap_or(""),
|
|
if let Some(ReoccurrenceInterval::Day) = reoccurrence_interval()
|
|
{ "bg-zinc-500/50" }
|
|
else { "bg-zinc-800/50" }
|
|
),
|
|
onclick: move |_| {
|
|
reoccurrence_interval.set(Some(ReoccurrenceInterval::Day))
|
|
},
|
|
i {
|
|
class: "fa-solid fa-sun"
|
|
}
|
|
},
|
|
button {
|
|
r#type: "button",
|
|
class: format!(
|
|
"py-2 rounded-lg {} {} cursor-pointer",
|
|
class_buttons.unwrap_or(""),
|
|
if let Some(ReoccurrenceInterval::Month) = reoccurrence_interval()
|
|
{ "bg-zinc-500/50" }
|
|
else { "bg-zinc-800/50" }
|
|
),
|
|
onclick: move |_| {
|
|
reoccurrence_interval.set(Some(ReoccurrenceInterval::Month))
|
|
},
|
|
i {
|
|
class: "fa-solid fa-moon"
|
|
}
|
|
},
|
|
button {
|
|
r#type: "button",
|
|
class: format!(
|
|
"py-2 rounded-lg {} {} cursor-pointer",
|
|
class_buttons.unwrap_or(""),
|
|
if let Some(ReoccurrenceInterval::Year) = reoccurrence_interval()
|
|
{ "bg-zinc-500/50" }
|
|
else { "bg-zinc-800/50" }
|
|
),
|
|
onclick: move |_| {
|
|
reoccurrence_interval.set(Some(ReoccurrenceInterval::Year))
|
|
},
|
|
i {
|
|
class: "fa-solid fa-earth-europe"
|
|
}
|
|
}
|
|
}
|
|
}
|