feat: add toasts and reactive feedback to forms on submission
Users were not able to tell that they had submitted before this.
This commit is contained in:
1 parent
def5c8696b
commit
07fae5878f
10 files changed
+92
-10
No files matched your search
@@ -4,7 +4,7 @@ use crate::pages::student::form_setup::use_student_form;
|
||||
|
||||
#[component]
|
||||
pub fn StudentFamilyPage() -> impl IntoView {
|
||||
let controller = use_student_form("family");
|
||||
let controller = use_student_form("family", true);
|
||||
|
||||
view! {
|
||||
<Show when=move || controller.data_resource.get().is_some() fallback=Loading>
|
||||
@@ -14,10 +14,12 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
title="Family Information"
|
||||
description="General family information. You must fill out information about at least one parent."
|
||||
on_submit=controller.submit_action
|
||||
disabled=controller.submit_pending
|
||||
>
|
||||
// Inputs here.
|
||||
<OutlinedTextField
|
||||
label="Total number of children in family:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="num_children"
|
||||
placeholder="Any number..."
|
||||
@@ -26,6 +28,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Total number of children currently attending college:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="num_children_college"
|
||||
placeholder="Any number..."
|
||||
@@ -34,6 +37,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 1 Name:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_one_name"
|
||||
placeholder="John Smith"
|
||||
@@ -43,6 +47,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
// TODO Could this be a select dropdown?
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 1 Relationship:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_one_relationship"
|
||||
placeholder="Mother/Father"
|
||||
@@ -52,6 +57,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
// TODO Get a better example
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 1 Occupation:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_one_occupation"
|
||||
placeholder="Milkman"
|
||||
@@ -60,6 +66,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 1 Employer:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_one_employer"
|
||||
placeholder="Example Employer"
|
||||
@@ -69,6 +76,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 2 Name:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_two_name"
|
||||
placeholder="John Smith"
|
||||
@@ -77,6 +85,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 2 Relationship:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_two_relationship"
|
||||
placeholder="Mother/Father"
|
||||
@@ -85,6 +94,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 2 Occupation:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_two_occupation"
|
||||
placeholder="Milkman"
|
||||
@@ -93,6 +103,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="Parent/Guardian 2 Employer:"
|
||||
disabled=controller.submit_pending
|
||||
data_map=controller.data_map
|
||||
data_member="parent_two_employer"
|
||||
placeholder="Example Employer"
|
||||
|
||||
Reference in new issue
Block a user