diff options
author | jelemux <jeremias.weber@protonmail.com> | 2020-11-24 21:58:51 +0100 |
---|---|---|
committer | jelemux <jeremias.weber@protonmail.com> | 2020-11-24 21:58:51 +0100 |
commit | 5a03734b6767fed04c0913384584d8f59dc597ea (patch) | |
tree | 62ef0a0afc0ab56dd36da1a662db768fd8c22eda /src/util.rs | |
parent | 49588f22f7d20193f899226107c9e323a82c6951 (diff) | |
download | wasm-card-5a03734b6767fed04c0913384584d8f59dc597ea.tar.gz wasm-card-5a03734b6767fed04c0913384584d8f59dc597ea.tar.bz2 |
add traits for viewmodel and view
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/src/util.rs b/src/util.rs deleted file mode 100644 index 3d8f231..0000000 --- a/src/util.rs +++ /dev/null @@ -1,39 +0,0 @@ -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 |