refactor: rename the project form component
This commit is contained in:
23
src/components/project_form.rs
Normal file
23
src/components/project_form.rs
Normal file
@@ -0,0 +1,23 @@
|
||||
use dioxus::core_macro::{component, rsx};
|
||||
use dioxus::dioxus_core::Element;
|
||||
use dioxus::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub(crate) fn ProjectForm(onsubmit: EventHandler<String>) -> Element {
|
||||
rsx! {
|
||||
form {
|
||||
onsubmit: move |event| {
|
||||
onsubmit(event.values().get("title").unwrap().as_value());
|
||||
},
|
||||
input {
|
||||
r#type: "text",
|
||||
name: "title",
|
||||
placeholder: "title"
|
||||
}
|
||||
button {
|
||||
r#type: "submit",
|
||||
"create"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user