This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn modal(content: Node<Msg>) -> Node<Msg> { | |
div![ | |
div![ | |
div![ | |
s() | |
.position_absolute() | |
.width(pc(100)) | |
.height(pc(100)) | |
.bg_color(rgba(30,30.,30.,0.5)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Default, Validate,Clone)] | |
struct Form { | |
#[validate(length(min = 1))] | |
name: String, | |
#[validate(length(min = 1))] | |
color: String, | |
#[validate(range(min = 18, max = 45))] | |
age: i32 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Default, Validate,Clone)] | |
struct Form { | |
#[validate(length(min = 1))] | |
name: String, | |
#[validate(length(min = 1))] | |
color: String, | |
#[validate(range(min = 18, max = 45))] | |
age: i32 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use seed_hooks::*; | |
use seed::{prelude::*,*}; | |
use crate::Msg; | |
use seed_style::*; | |
use seed_style::px; | |
// Struct to refer to the form data as a whole | |
// Could also include configuraiton or options | |
#[derive(Clone,Debug)] | |
struct FormData { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(track_caller)] | |
// use rand::seq::SliceRandom; | |
use seed::prelude::*; | |
use seed::*; | |
use seed_hooks::*; | |
use seed_style::px; | |
use seed_style::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(track_caller)] | |
// use rand::seq::SliceRandom; | |
use seed::prelude::*; | |
use seed::*; | |
use seed_hooks::*; | |
use seed_style::px; | |
use seed_style::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[atom] | |
fn hsl_widget_status() ->Atom<HslWidgetStatus> { | |
HslWidgetStatus::Unpicked | |
} | |
#[derive(Clone)] | |
pub enum HslWidgetStatus{ | |
Unpicked, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn view() -> Node<Msg> { | |
let next_id = loaded_users_ids().get().len() + 1; | |
Column![ | |
Item![ | |
align = ColumnAlign::TopCenter, | |
h1!["Multi Fetch Example"], | |
], | |
Item![ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ... | |
// Regular Seed app/init/model/msg stuff here.. | |
// ... | |
// | |
#[wasm_bindgen(start)] | |
pub fn start() { | |
let app = App::start("app", init, update, view); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Debug, Default, Validate, Deserialize,Clone)] | |
struct SignupData { | |
#[validate(email)] | |
mail: String, | |
#[validate(phone)] | |
phone: String, | |
#[validate(url)] | |
site: String, | |
#[validate(length(min = 1), custom = "validate_unique_username")] |
NewerOlder