summaryrefslogtreecommitdiff
path: root/src/util.rs
diff options
context:
space:
mode:
authorjelemux <jeremias.weber@protonmail.com>2020-11-19 07:37:20 +0100
committerjelemux <jeremias.weber@protonmail.com>2020-11-19 07:37:20 +0100
commit49588f22f7d20193f899226107c9e323a82c6951 (patch)
tree7f7bb739336f87aa2c950038f7d5a7e154f09dbd /src/util.rs
parent104f70b0968d7138d6cf944da98d95a405b1a049 (diff)
downloadwasm-card-49588f22f7d20193f899226107c9e323a82c6951.tar.gz
wasm-card-49588f22f7d20193f899226107c9e323a82c6951.tar.bz2
added telephone, but causes problems
Diffstat (limited to 'src/util.rs')
-rw-r--r--src/util.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/util.rs b/src/util.rs
new file mode 100644
index 0000000..3d8f231
--- /dev/null
+++ b/src/util.rs
@@ -0,0 +1,39 @@
+use yew::prelude::*;
+
+pub fn text_field_input(label: &str, id: &str, placeholder: Option<&str>, oninput: Callback<InputData>) -> Html {
+ html!{
+ <div class="field column
+ is-one-fifth-widescreen
+ is-one-quarter-desktop
+ is-one-third-tablet
+ is-half-mobile" >
+ <label class="label">{ label }</label>
+ <div class="control">
+ <input id=id
+ type="text"
+ placeholder=placeholder.unwrap_or("")
+ oninput=oninput
+ />
+ </div>
+ </div>
+ }
+}
+
+pub fn checkbox_field_input(label: &str, id: &str, checked: bool, onclick: Callback<MouseEvent>) -> Html {
+ html!{
+ <div class="field column
+ is-one-fifth-widescreen
+ is-one-quarter-desktop
+ is-one-third-tablet
+ is-half-mobile" >
+ <label class="checkbox">
+ <input id=id
+ type="checkbox"
+ checked=checked
+ onclick=onclick
+ />
+ { label }
+ </label>
+ </div>
+ }
+} \ No newline at end of file