summaryrefslogtreecommitdiff
path: root/src/view/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/mod.rs')
-rw-r--r--src/view/mod.rs25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/view/mod.rs b/src/view/mod.rs
index 0751c53..cbff0fd 100644
--- a/src/view/mod.rs
+++ b/src/view/mod.rs
@@ -1,27 +1,30 @@
-use yew::prelude::*;
+use crate::viewmodel::*;
use std::cell::RefCell;
use std::ops::Deref;
use std::rc::Rc;
-use crate::viewmodel::*;
+use yew::prelude::*;
-pub mod main;
-pub mod name;
pub mod address;
-pub mod telephone;
pub mod dates;
+pub mod main;
+pub mod name;
pub mod organizational;
+pub mod telephone;
#[derive(Clone, PartialEq, Properties)]
-pub struct InputProps<O, C>
- where O: VCardPropertyInputObject<C> + Clone,
- C: VCardPropertyInputComponent<O> + Clone
+pub struct InputProps<O, C>
+where
+ O: VCardPropertyInputObject<C> + Clone,
+ C: VCardPropertyInputComponent<O> + Clone,
{
pub generated: Callback<O>,
pub weak_link: WeakComponentLink<C>,
}
/// Trait for types that represent an input component for a vcard property.
-pub trait VCardPropertyInputComponent<T: VCardPropertyInputObject<Self>>: Component + Clone + PartialEq {
+pub trait VCardPropertyInputComponent<T: VCardPropertyInputObject<Self>>:
+ Component + Clone + PartialEq
+{
/// Returns the object containing the input data.
fn get_input_object(&self) -> T;
/// Getter function for the title of the component
@@ -30,7 +33,7 @@ pub trait VCardPropertyInputComponent<T: VCardPropertyInputObject<Self>>: Compon
fn get_error(&self) -> Option<Error>;
/// Returns the error as `Html`
fn render_error(&self) -> Html {
- html!{
+ html! {
<>
{
if self.get_error().is_some() {
@@ -75,4 +78,4 @@ impl<COMP: Component> PartialEq for WeakComponentLink<COMP> {
fn eq(&self, other: &Self) -> bool {
Rc::ptr_eq(&self.0, &other.0)
}
-} \ No newline at end of file
+}