Some checks failed
actionlint check / actionlint check (pull_request) Successful in 5s
checkov check / checkov check (pull_request) Successful in 52s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 4s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 2s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 5s
GitLeaks check / GitLeaks check (pull_request) Successful in 6s
hadolint check / hadolint check (pull_request) Successful in 7s
htmlhint check / htmlhint check (pull_request) Successful in 9s
markdownlint check / markdownlint check (pull_request) Successful in 9s
Prettier check / Prettier check (pull_request) Successful in 10s
Rust check / Rust check (pull_request) Failing after 6m20s
ShellCheck check / ShellCheck check (pull_request) Successful in 12s
Stylelint check / Stylelint check (pull_request) Successful in 11s
yamllint check / yamllint check (pull_request) Successful in 13s
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 {} {}",
|
|
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 {} {}",
|
|
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 {} {}",
|
|
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 {} {}",
|
|
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"
|
|
}
|
|
}
|
|
}
|
|
}
|