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

View File

@ -71,12 +71,24 @@ pub fn agent_fields(props: &AgentFieldsProps) -> Html {
<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()}/>
{if (*credential_type).clone() == Some(CredentialType::PhoneNumber) {
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>
{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! {
<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>
}
} else {
html! {}
}
}
} else {
html! {
@ -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}/>
</div>
}
}}
<TextField label={"Credencial"} value={credential_handle} required={true} onchange={ontype_cb.clone()}/>