feat: implement checkboxlist component
This commit is contained in:
1 parent
f7ca1ecbc5
commit
9925e753d8
8 files changed
+125
-14
No files matched your search
@@ -3,7 +3,7 @@ use std::collections::HashMap;
|
||||
use aws_sdk_dynamodb::{error::ProvideErrorMetadata, types::AttributeValue, Client};
|
||||
use crate::app::Unauthenticated;
|
||||
use crate::common::{StudentInfo, StudentInfoReactive, UserClaims};
|
||||
use crate::components::{ActionButton, Loading, OutlinedTextField, Select};
|
||||
use crate::components::{ActionButton, Loading, OutlinedTextField, Select, CheckboxList};
|
||||
use leptos::leptos_dom::logging::console_log;
|
||||
use leptos::prelude::*;
|
||||
use leptos_oidc::{Algorithm, AuthLoaded, AuthSignal, Authenticated};
|
||||
@@ -154,6 +154,7 @@ pub fn HomePage() -> impl IntoView {
|
||||
let reactive_info = StudentInfoReactive::new(submission);
|
||||
|
||||
let select_value = RwSignal::new(String::from("Math"));
|
||||
let chk_select = RwSignal::new(vec!["Testing 2".into()]);
|
||||
|
||||
view! {
|
||||
<p>
|
||||
@@ -184,9 +185,15 @@ pub fn HomePage() -> impl IntoView {
|
||||
value_list = vec!["Math".into(), "English".into(), "Science".into()]
|
||||
value = select_value
|
||||
/>
|
||||
<div>
|
||||
<CheckboxList
|
||||
selected = chk_select
|
||||
items = vec!["Testing 1".into(), "Testing 2".into()] />
|
||||
</div>
|
||||
<div>
|
||||
<ActionButton
|
||||
on:click=move |_| {
|
||||
console_log(format!("Found value {:?}", chk_select.get()).as_str());
|
||||
submit_action.dispatch(CreateSampleSubmission {
|
||||
student_info: reactive_info.capture(),
|
||||
subject: user_claims.get().unwrap().claims.subject.clone()
|
||||
|
||||
@@ -4,7 +4,6 @@ use crate::components::{Loading, MultiEntry, MultiEntryData, MultiEntryMember, O
|
||||
use leptos::leptos_dom::logging::console_log;
|
||||
use leptos::prelude::*;
|
||||
use leptos_oidc::{Algorithm, AuthLoaded, AuthSignal, Authenticated, LogoutLink};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[component]
|
||||
pub fn ProviderEntry() -> impl IntoView {
|
||||
|
||||
Reference in new issue
Block a user