Some checks failed
actionlint check / actionlint check (pull_request) Successful in 7s
conventional pull request title check / conventional pull request title check (pull_request) Successful in 3s
conventional commit messages check / conventional commit messages check (pull_request) Successful in 7s
dotenv-linter check / dotenv-linter check (pull_request) Successful in 7s
GitLeaks check / GitLeaks check (pull_request) Successful in 10s
hadolint check / hadolint check (pull_request) Successful in 10s
htmlhint check / htmlhint check (pull_request) Successful in 28s
markdownlint check / markdownlint check (pull_request) Successful in 30s
Prettier check / Prettier check (pull_request) Failing after 27s
checkov check / checkov check (pull_request) Successful in 1m22s
Stylelint check / Stylelint check (pull_request) Failing after 34s
ShellCheck check / ShellCheck check (pull_request) Successful in 37s
yamllint check / yamllint check (pull_request) Successful in 22s
Rust check / Rust check (pull_request) Has been cancelled
32 lines
1023 B
Rust
32 lines
1023 B
Rust
use crate::components::project_form::PROJECT_BEING_EDITED;
|
|
use crate::components::{button_primary::ButtonPrimary, task_form::TASK_BEING_EDITED};
|
|
use crate::route::Route;
|
|
use dioxus::prelude::*;
|
|
use dioxus_free_icons::{Icon, icons::fa_solid_icons::FaGavel};
|
|
|
|
#[component]
|
|
pub(crate) fn CreateButton() -> Element {
|
|
let navigator = use_navigator();
|
|
let current_route = use_route();
|
|
rsx! {
|
|
ButtonPrimary {
|
|
class: "pointer-events-auto m-4 self-end *:rounded-full! *:p-4",
|
|
onclick: move |_| {
|
|
*TASK_BEING_EDITED.write() = None;
|
|
*PROJECT_BEING_EDITED.write() = None;
|
|
navigator.push(
|
|
match current_route {
|
|
Route::ProjectsPage => Route::ProjectFormPage,
|
|
_ => Route::TaskFormPage,
|
|
}
|
|
);
|
|
},
|
|
Icon {
|
|
icon: FaGavel,
|
|
height: 24,
|
|
width: 24
|
|
}
|
|
}
|
|
}
|
|
}
|