summaryrefslogtreecommitdiff
path: root/src/view/name.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/name.rs')
-rw-r--r--src/view/name.rs28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/view/name.rs b/src/view/name.rs
index 4976e7d..4b7089b 100644
--- a/src/view/name.rs
+++ b/src/view/name.rs
@@ -1,28 +1,28 @@
+use super::VCardPropertyInputComponent;
use crate::view::InputProps;
-use yew::prelude::*;
-use yewtil::NeqAssign;
-use crate::viewmodel::Error;
use crate::viewmodel::name::*;
+use crate::viewmodel::Error;
use crate::viewmodel::VCardPropertyInputObject;
-use super::VCardPropertyInputComponent;
+use yew::prelude::*;
+use yewtil::NeqAssign;
-type Props = InputProps<Name,NameView>;
+type Props = InputProps<Name, NameView>;
/// View Component for a `name` field
-///
+///
/// # Examples
-///
+///
/// ```compile_fail
/// let html = html!{
-/// <NameView weak_link=some_weak_component_link
+/// <NameView weak_link=some_weak_component_link
/// generated=self.link.callback(
-/// |n: Irc<Name>|
+/// |n: Irc<Name>|
/// Msg::GeneratedName(some_name)
/// )
/// />
/// };
/// ```
-#[derive(Clone,PartialEq)]
+#[derive(Clone, PartialEq)]
pub struct NameView {
props: Props,
value: Name,
@@ -71,17 +71,17 @@ impl Component for NameView {
Msg::UpdateSuffix(s) => self.value.suffix = s,
Msg::Generate => {
self.props.generated.emit(self.value.clone());
- },
+ }
};
true
}
- fn change(&mut self, props: <Self as yew::Component>::Properties) -> bool {
+ fn change(&mut self, props: <Self as yew::Component>::Properties) -> bool {
self.props.neq_assign(props)
}
fn view(&self) -> yew::virtual_dom::VNode {
let link = self.props.weak_link.borrow().clone().unwrap();
- html!{
+ html! {
<div class="box">
{ self.render_error() }
@@ -92,4 +92,4 @@ impl Component for NameView {
</div>
}
}
-} \ No newline at end of file
+}