feat: link student pages to database
This commit is contained in:
1 parent
fdc5374f17
commit
838a412376
4 files changed
+39
-39
No files matched your search
@@ -1,10 +1,10 @@
|
||||
use leptos::prelude::*;
|
||||
use std::collections::HashMap;
|
||||
use crate::components::{OutlinedTextField, Select, TextFieldType, ValidatedForm};
|
||||
use crate::pages::student::form_setup::use_student_form;
|
||||
|
||||
#[component]
|
||||
pub fn StudentUniversityPage() -> impl IntoView {
|
||||
let data_map = RwSignal::new(HashMap::new());
|
||||
let controller = use_student_form("university");
|
||||
|
||||
// college name, state, city, zip
|
||||
// major, study field, intended career, college_acceptance
|
||||
@@ -12,11 +12,11 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
||||
view! {
|
||||
<div class="flex flex-1" />
|
||||
<div class="flex flex-col flex-2 mt-6">
|
||||
<ValidatedForm title="University Information" on_submit=move || {}>
|
||||
<ValidatedForm title="University Information" on_submit=controller.submit_action>
|
||||
// Inputs here.
|
||||
<OutlinedTextField
|
||||
label="University Name:"
|
||||
data_map=data_map
|
||||
data_map=controller.data_map
|
||||
data_member="college_name"
|
||||
placeholder="University of Example"
|
||||
input_type=TextFieldType::Number
|
||||
@@ -24,7 +24,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="University Street Address:"
|
||||
data_map=data_map
|
||||
data_map=controller.data_map
|
||||
data_member="college_city"
|
||||
placeholder="123 Example Rd"
|
||||
input_type=TextFieldType::Text
|
||||
@@ -33,7 +33,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
||||
// TODO Make this a select dropdown.
|
||||
<OutlinedTextField
|
||||
label="University State:"
|
||||
data_map=data_map
|
||||
data_map=controller.data_map
|
||||
data_member="college_state"
|
||||
placeholder="The State of Panic"
|
||||
input_type=TextFieldType::Text
|
||||
@@ -41,7 +41,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
||||
/>
|
||||
<OutlinedTextField
|
||||
label="University ZIP:"
|
||||
data_map=data_map
|
||||
data_map=controller.data_map
|
||||
data_member="college_zip"
|
||||
placeholder="12345"
|
||||
input_type=TextFieldType::Number
|
||||
@@ -49,7 +49,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
||||
/>
|
||||
<Select
|
||||
label="Have you been sent an acceptance to the university?"
|
||||
data_map=data_map
|
||||
data_map=controller.data_map
|
||||
data_member="college_acceptance"
|
||||
required=true
|
||||
value_list=vec![
|
||||
@@ -60,7 +60,7 @@ pub fn StudentUniversityPage() -> impl IntoView {
|
||||
// TODO Make this a select dropdown.
|
||||
<OutlinedTextField
|
||||
label="Chosen Major:"
|
||||
data_map=data_map
|
||||
data_map=controller.data_map
|
||||
data_member="major"
|
||||
placeholder="Computer Science"
|
||||
input_type=TextFieldType::Text
|
||||
|
||||
Reference in new issue
Block a user