chore: add Show and fix small typing errors
This commit is contained in:
1 parent
1b8406e09c
commit
caec4fb017
5 files changed
+40
-14
No files matched your search
@@ -1,5 +1,5 @@
|
|||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
use crate::components::{OutlinedTextField, Select, TextFieldType, ValidatedForm};
|
use crate::components::{Loading, OutlinedTextField, Select, TextFieldType, ValidatedForm};
|
||||||
use crate::pages::student::form_setup::use_student_form;
|
use crate::pages::student::form_setup::use_student_form;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
@@ -12,6 +12,10 @@ pub fn StudentDemographicsPage() -> impl IntoView {
|
|||||||
let controller = use_student_form("demographics");
|
let controller = use_student_form("demographics");
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
|
<Show
|
||||||
|
when=move || controller.data_resource.get().is_some()
|
||||||
|
fallback=Loading
|
||||||
|
>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
<div class="flex flex-col flex-2 mt-6">
|
<div class="flex flex-col flex-2 mt-6">
|
||||||
<ValidatedForm title="Student Demographic Form" on_submit=controller.submit_action>
|
<ValidatedForm title="Student Demographic Form" on_submit=controller.submit_action>
|
||||||
@@ -75,5 +79,6 @@ pub fn StudentDemographicsPage() -> impl IntoView {
|
|||||||
</ValidatedForm>
|
</ValidatedForm>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
|
</Show>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
use crate::components::{MultiEntry, OutlinedTextField, TextFieldType, ValidatedForm};
|
use crate::components::{Loading, MultiEntry, OutlinedTextField, TextFieldType, ValidatedForm};
|
||||||
use crate::input;
|
use crate::input;
|
||||||
use crate::pages::student::form_setup::use_student_form;
|
use crate::pages::student::form_setup::use_student_form;
|
||||||
|
|
||||||
@@ -8,6 +8,10 @@ pub fn StudentExtracurricularsPage() -> impl IntoView {
|
|||||||
let controller = use_student_form("demographics");
|
let controller = use_student_form("demographics");
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
|
<Show
|
||||||
|
when=move || controller.data_resource.get().is_some()
|
||||||
|
fallback=Loading
|
||||||
|
>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
<div class="flex flex-col flex-2 mt-6">
|
<div class="flex flex-col flex-2 mt-6">
|
||||||
<ValidatedForm title="Extracurricular Information" on_submit=controller.submit_action>
|
<ValidatedForm title="Extracurricular Information" on_submit=controller.submit_action>
|
||||||
@@ -38,5 +42,6 @@ pub fn StudentExtracurricularsPage() -> impl IntoView {
|
|||||||
</ValidatedForm>
|
</ValidatedForm>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
|
</Show>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
use crate::components::{OutlinedTextField, TextFieldType, ValidatedForm};
|
use crate::components::{Loading, OutlinedTextField, TextFieldType, ValidatedForm};
|
||||||
use crate::pages::student::form_setup::use_student_form;
|
use crate::pages::student::form_setup::use_student_form;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
@@ -7,6 +7,10 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
|||||||
let controller = use_student_form("family");
|
let controller = use_student_form("family");
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
|
<Show
|
||||||
|
when=move || controller.data_resource.get().is_some()
|
||||||
|
fallback=Loading
|
||||||
|
>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
<div class="flex flex-col flex-2 mt-6">
|
<div class="flex flex-col flex-2 mt-6">
|
||||||
<ValidatedForm title="Family Information" on_submit=controller.submit_action>
|
<ValidatedForm title="Family Information" on_submit=controller.submit_action>
|
||||||
@@ -65,7 +69,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
|||||||
<OutlinedTextField
|
<OutlinedTextField
|
||||||
label="Parent/Guardian 2 Name:"
|
label="Parent/Guardian 2 Name:"
|
||||||
data_map=controller.data_map
|
data_map=controller.data_map
|
||||||
data_member="parent_one_name"
|
data_member="parent_two_name"
|
||||||
placeholder="John Smith"
|
placeholder="John Smith"
|
||||||
input_type=TextFieldType::Text
|
input_type=TextFieldType::Text
|
||||||
required=false
|
required=false
|
||||||
@@ -74,7 +78,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
|||||||
<OutlinedTextField
|
<OutlinedTextField
|
||||||
label="Parent/Guardian 2 Relationship:"
|
label="Parent/Guardian 2 Relationship:"
|
||||||
data_map=controller.data_map
|
data_map=controller.data_map
|
||||||
data_member="parent_one_relationship"
|
data_member="parent_two_relationship"
|
||||||
placeholder="Mother/Father"
|
placeholder="Mother/Father"
|
||||||
input_type=TextFieldType::Text
|
input_type=TextFieldType::Text
|
||||||
required=false
|
required=false
|
||||||
@@ -83,7 +87,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
|||||||
<OutlinedTextField
|
<OutlinedTextField
|
||||||
label="Parent/Guardian 2 Occupation:"
|
label="Parent/Guardian 2 Occupation:"
|
||||||
data_map=controller.data_map
|
data_map=controller.data_map
|
||||||
data_member="parent_one_occupation"
|
data_member="parent_two_occupation"
|
||||||
placeholder="Milkman"
|
placeholder="Milkman"
|
||||||
input_type=TextFieldType::Text
|
input_type=TextFieldType::Text
|
||||||
required=false
|
required=false
|
||||||
@@ -91,7 +95,7 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
|||||||
<OutlinedTextField
|
<OutlinedTextField
|
||||||
label="Parent/Guardian 2 Employer:"
|
label="Parent/Guardian 2 Employer:"
|
||||||
data_map=controller.data_map
|
data_map=controller.data_map
|
||||||
data_member="parent_one_employer"
|
data_member="parent_two_employer"
|
||||||
placeholder="Example Employer"
|
placeholder="Example Employer"
|
||||||
input_type=TextFieldType::Text
|
input_type=TextFieldType::Text
|
||||||
required=false
|
required=false
|
||||||
@@ -99,5 +103,6 @@ pub fn StudentFamilyPage() -> impl IntoView {
|
|||||||
</ValidatedForm>
|
</ValidatedForm>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
|
</Show>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
use crate::components::{OutlinedTextField, Select, TextFieldType, ValidatedForm};
|
use crate::components::{Loading, OutlinedTextField, Select, TextFieldType, ValidatedForm};
|
||||||
use crate::pages::student::form_setup::use_student_form;
|
use crate::pages::student::form_setup::use_student_form;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
@@ -10,6 +10,10 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
|||||||
// major, study field, intended career, college_acceptance
|
// major, study field, intended career, college_acceptance
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
|
<Show
|
||||||
|
when=move || controller.data_resource.get().is_some()
|
||||||
|
fallback=Loading
|
||||||
|
>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
<div class="flex flex-col flex-2 mt-6">
|
<div class="flex flex-col flex-2 mt-6">
|
||||||
<ValidatedForm title="University Information" on_submit=controller.submit_action>
|
<ValidatedForm title="University Information" on_submit=controller.submit_action>
|
||||||
@@ -19,7 +23,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
|||||||
data_map=controller.data_map
|
data_map=controller.data_map
|
||||||
data_member="college_name"
|
data_member="college_name"
|
||||||
placeholder="University of Example"
|
placeholder="University of Example"
|
||||||
input_type=TextFieldType::Number
|
input_type=TextFieldType::Text
|
||||||
required=true
|
required=true
|
||||||
/>
|
/>
|
||||||
<OutlinedTextField
|
<OutlinedTextField
|
||||||
@@ -44,7 +48,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
|||||||
data_map=controller.data_map
|
data_map=controller.data_map
|
||||||
data_member="college_zip"
|
data_member="college_zip"
|
||||||
placeholder="12345"
|
placeholder="12345"
|
||||||
input_type=TextFieldType::Number
|
input_type=TextFieldType::Text
|
||||||
required=true
|
required=true
|
||||||
/>
|
/>
|
||||||
<Select
|
<Select
|
||||||
@@ -69,5 +73,6 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
|||||||
</ValidatedForm>
|
</ValidatedForm>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
|
</Show>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,25 @@
|
|||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use leptos::prelude::*;
|
use leptos::prelude::*;
|
||||||
use crate::components::{MultiEntry, ValidatedForm};
|
use crate::components::{Loading, MultiEntry, ValidatedForm};
|
||||||
use crate::input;
|
use crate::input;
|
||||||
|
use crate::pages::student::form_setup::use_student_form;
|
||||||
|
|
||||||
#[component]
|
#[component]
|
||||||
pub fn StudentWorkExperiencePage() -> impl IntoView {
|
pub fn StudentWorkExperiencePage() -> impl IntoView {
|
||||||
let data_map = RwSignal::new(HashMap::new());
|
let controller = use_student_form("workexp");
|
||||||
|
|
||||||
view! {
|
view! {
|
||||||
|
<Show
|
||||||
|
when=move || controller.data_resource.get().is_some()
|
||||||
|
fallback=Loading
|
||||||
|
>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
<div class="flex flex-col flex-2 mt-6">
|
<div class="flex flex-col flex-2 mt-6">
|
||||||
<ValidatedForm title="Student Work Experience" on_submit=move || {}>
|
<ValidatedForm title="Student Work Experience" on_submit=controller.submit_action>
|
||||||
<MultiEntry
|
<MultiEntry
|
||||||
label="Work Experience:"
|
label="Work Experience:"
|
||||||
description="Leave blank if not applicable."
|
description="Leave blank if not applicable."
|
||||||
data_map=data_map
|
data_map=controller.data_map
|
||||||
data_member="extracurricular"
|
data_member="extracurricular"
|
||||||
schema=vec![
|
schema=vec![
|
||||||
input!(Text, "job_title", "Job Title:", true, "Waiter, Cashier, etc..."),
|
input!(Text, "job_title", "Job Title:", true, "Waiter, Cashier, etc..."),
|
||||||
@@ -27,5 +32,6 @@ pub fn StudentWorkExperiencePage() -> impl IntoView {
|
|||||||
</ValidatedForm>
|
</ValidatedForm>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-1" />
|
<div class="flex flex-1" />
|
||||||
|
</Show>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user