summaryrefslogtreecommitdiff
path: root/src/view/main.rs
diff options
context:
space:
mode:
authorjelemux <jeremias.weber@protonmail.com>2021-02-17 17:06:48 +0100
committerjelemux <jeremias.weber@protonmail.com>2021-02-17 17:06:48 +0100
commitcb310a66e94db4e0c4f7d0373a670156b012412a (patch)
tree501fd4ed17d892d693d4123fffaca8d942144e3b /src/view/main.rs
parentbe3367dd2921eb30ae7970d233b83ac3af861952 (diff)
parent0660151a8b641fa0a23dde2598132029970f7ae4 (diff)
downloadwasm-card-cb310a66e94db4e0c4f7d0373a670156b012412a.tar.gz
wasm-card-cb310a66e94db4e0c4f7d0373a670156b012412a.tar.bz2
Merge branch 'main' of codeberg.org:jelemux/wasm-card
Diffstat (limited to 'src/view/main.rs')
-rw-r--r--src/view/main.rs42
1 files changed, 22 insertions, 20 deletions
diff --git a/src/view/main.rs b/src/view/main.rs
index 196afa0..d35fb59 100644
--- a/src/view/main.rs
+++ b/src/view/main.rs
@@ -1,18 +1,14 @@
-use super::address::{self, AddressView};
-use super::dates::{self, DatesView};
-use super::name::{self, NameView};
-use super::WeakComponentLink;
-use crate::view::organizational::{self, OrganizationalView};
-use crate::view::telephone::{self, TelephoneView};
-use crate::viewmodel::address::Address;
-use crate::viewmodel::dates::Dates;
-use crate::viewmodel::name::Name;
-use crate::viewmodel::organizational::Organizational;
-use crate::viewmodel::telephone::Telephone;
-use crate::viewmodel::utility::*;
-use crate::viewmodel::vcard::VCardData;
-use crate::viewmodel::Error;
-use crate::viewmodel::VCardPropertyInputObject;
+use crate::view::property_group::PropertyGroupInputComponent;
+use crate::view::weak_links::WeakComponentLink;
+use crate::model::address::*;
+use crate::model::dates::*;
+use crate::model::name::*;
+use crate::model::organizational::*;
+use crate::model::telephone::*;
+use crate::model::utility::*;
+use crate::model::vcard::VCardData;
+use crate::model::Error;
+use crate::model::VCardPropertyInputObject;
use boolinator::Boolinator;
use chrono::prelude::*;
use genpdf::Element as _;
@@ -25,6 +21,12 @@ use yew::prelude::*;
use yew::services::ConsoleService;
use yewtil::ptr::Mrc;
+type NameView = PropertyGroupInputComponent<Name, NameMsg>;
+type AddressView = PropertyGroupInputComponent<Address, AddressMsg>;
+type DatesView = PropertyGroupInputComponent<Dates, DatesMsg>;
+type OrganizationalView = PropertyGroupInputComponent<Organizational, OrganizationalMsg>;
+type TelephoneView = PropertyGroupInputComponent<Telephone, TelephoneMsg>;
+
pub struct MainView {
link: ComponentLink<Self>,
error: Option<Error>,
@@ -117,27 +119,27 @@ impl Component for MainView {
{
for name_link in self.name_links.iter() {
let name_link = name_link.borrow().clone().unwrap();
- name_link.send_message(name::Msg::Generate);
+ name_link.send_message(NameMsg::Generate);
}
for address_link in self.address_links.iter() {
let address_link = address_link.borrow().clone().unwrap();
- address_link.send_message(address::Msg::Generate);
+ address_link.send_message(AddressMsg::Generate);
}
for telephone_link in self.telephone_links.iter() {
let telephone_link = telephone_link.borrow().clone().unwrap();
- telephone_link.send_message(telephone::Msg::Generate);
+ telephone_link.send_message(TelephoneMsg::Generate);
}
for dates_link in self.dates_links.iter() {
let dates_link = dates_link.borrow().clone().unwrap();
- dates_link.send_message(dates::Msg::Generate)
+ dates_link.send_message(DatesMsg::Generate)
}
for organizational_links in self.organizational_links.iter() {
let organizational_link = organizational_links.borrow().clone().unwrap();
- organizational_link.send_message(organizational::Msg::Generate)
+ organizational_link.send_message(OrganizationalMsg::Generate)
}
}
/*