Finished agent edit screen except for update functionality

This commit is contained in:
Franklin 2023-04-25 14:05:54 -04:00
parent c174123dc2
commit e06651f14c
1 changed files with 18 additions and 7 deletions

View File

@ -71,13 +71,25 @@ pub fn agent_fields(props: &AgentFieldsProps) -> Html {
<SingleMediaPicker value={profile_picture_url_handle} onchange={ontype_cb.clone()} item={jl_types::dto::item::Item::Agent}/> <SingleMediaPicker value={profile_picture_url_handle} onchange={ontype_cb.clone()} item={jl_types::dto::item::Item::Agent}/>
<TextField label={"Nombre Completo"} value={agent_name_handle} required={true} onchange={ontype_cb.clone()}/> <TextField label={"Nombre Completo"} value={agent_name_handle} required={true} onchange={ontype_cb.clone()}/>
{if (*credential_type).clone() == Some(CredentialType::PhoneNumber) { {if (*credential_type).clone().is_none() {
match props.edittype.clone() {
EditType::New => html! {
<div class={"textfield-container"}>
<div class={"textfield-label-required"}>{"Tipo de Credencial"}</div>
<DropDown<CredentialType> selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/>
</div>
},
EditType::Existing(_) => if *user_typed {
html! { html! {
<div class={"textfield-container"}> <div class={"textfield-container"}>
<div class={"textfield-label-required"}>{"Tipo de Credencial"}</div> <div class={"textfield-label-required"}>{"Tipo de Credencial"}</div>
<DropDown<CredentialType> selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/> <DropDown<CredentialType> selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/>
</div> </div>
} }
} else {
html! {}
}
}
} else { } else {
html! { html! {
<div class={"textfield-container"}> <div class={"textfield-container"}>
@ -85,7 +97,6 @@ pub fn agent_fields(props: &AgentFieldsProps) -> Html {
<DropDown<CredentialType> selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/> <DropDown<CredentialType> selected={credential_type} options={vec![CredentialType::Email, CredentialType::PhoneNumber]} onchange={onselect_cb}/>
</div> </div>
} }
}} }}
<TextField label={"Credencial"} value={credential_handle} required={true} onchange={ontype_cb.clone()}/> <TextField label={"Credencial"} value={credential_handle} required={true} onchange={ontype_cb.clone()}/>