From 80340d99b91a975c7d24932e0609fdcbb17f44aa Mon Sep 17 00:00:00 2001 From: Lucas Vas Date: Fri, 6 Mar 2026 01:11:07 -0500 Subject: [PATCH] feat: add redirect buttons to forms --- src/pages/student/home_page.rs | 71 +++++++++++++--------------------- 1 file changed, 26 insertions(+), 45 deletions(-) diff --git a/src/pages/student/home_page.rs b/src/pages/student/home_page.rs index f370932..fa53ca8 100644 --- a/src/pages/student/home_page.rs +++ b/src/pages/student/home_page.rs @@ -1,55 +1,36 @@ -use std::collections::HashMap; -use leptos::logging::log; use leptos::prelude::*; -use crate::common::ValueType; -use crate::components::ActionButton; -use crate::pages::api::students::{GetStudentData, PutStudentData}; -use crate::utils::get_user_claims; +use crate::components::DashboardButton; #[component] pub fn StudentHomePage() -> impl IntoView { - let user_claims = get_user_claims(); - let user_id = Memo::new(move |_| { - user_claims.get() - .map(|info| info.claims.subject.clone()) - }); - - let create_student_data = ServerAction::::new(); - let get_student_data = ServerAction::::new(); - - let on_click_student_test = move |_| { - create_student_data.dispatch(PutStudentData { - subject: user_id.get().unwrap_or_default(), - data_type: "TESTING".into(), - data_map: HashMap::from([ - ("testing_info".into(), ValueType::String(Some("hello!".to_string()))) - ]), - }); - }; - - let on_click_get_student = move |_| { - get_student_data.dispatch(GetStudentData { - subject: user_id.get().unwrap_or_default(), - data_type: "TESTING".into() - }); - }; - - Effect::new(move || { - let Some(value) = get_student_data.value().get() else { - return; - }; - - log!("{:?}", value); - }); - view! { -
-
"Student Home Page"
+
+
+
"Region 15 Scholarship Application"
- "This is just a placeholder for now. We'll show some redirect buttons." + "Welcome to the R15 general scholarship application! If you have any questions, please direct them to Sara Smith at " + "ssmith@region15.org""."
- "Test Put Student Function" - "Test Get Student Function" +
"Here are some links to get you started:"
+ + +
+
} }