feat: add simple MultiEntry component
This commit is contained in:
1 parent
9d18eb0810
commit
c6e99cc7a8
9 files changed
+369
-184
No files matched your search
@@ -37,7 +37,6 @@ pub async fn get_submission(id: String) -> Result<StudentInfo, ServerFnError> {
|
||||
}
|
||||
Err(err) => {
|
||||
let msg = err.message().unwrap_or("Unknown error");
|
||||
// console_log(format!("Exception while getting submission information: {}", msg).as_str());
|
||||
Err(ServerFnError::new(msg))
|
||||
}
|
||||
}
|
||||
@@ -141,7 +140,7 @@ pub fn HomePage() -> impl IntoView {
|
||||
<ActionButton
|
||||
on:click=on_click
|
||||
disabled={elements_disabled}
|
||||
button_type="submit".to_string()
|
||||
button_type="submit".into()
|
||||
>
|
||||
"Submit"
|
||||
</ActionButton>
|
||||
|
||||
@@ -2,8 +2,3 @@
|
||||
mod user_entry;
|
||||
mod action_selection;
|
||||
|
||||
pub use self::{
|
||||
loaner_kiosk::LoanerKiosk,
|
||||
user_entry::UserEntry,
|
||||
action_selection::ActionSelection,
|
||||
};
|
||||
@@ -22,7 +22,7 @@ pub fn UserEntry(
|
||||
/// A callback function used when the control has determined this stage is finished.
|
||||
#[prop()] mut on_submit: impl FnMut() + 'static,
|
||||
/// The global user record.
|
||||
#[prop()] mut user: RwSignal<LoanerUser>,
|
||||
#[prop()] user: RwSignal<LoanerUser>,
|
||||
/// Whether this control is shown. Required for use with CSS animations.
|
||||
#[prop()] shown: bool
|
||||
) -> impl IntoView {
|
||||
|
||||
+1
-1
@@ -3,4 +3,4 @@ mod home_page;
|
||||
mod provider_entry;
|
||||
mod loaner_kiosk;
|
||||
|
||||
pub use self::{about_page::*, home_page::*, provider_entry::*, loaner_kiosk::*};
|
||||
pub use self::{about_page::*, home_page::*, provider_entry::*};
|
||||
@@ -1,8 +1,10 @@
|
||||
use crate::components::{MultiEntry, OutlinedTextField};
|
||||
use crate::components::{MultiEntry, MultiEntryData, MultiEntryMember, OutlinedTextField};
|
||||
use leptos::prelude::*;
|
||||
|
||||
#[component]
|
||||
pub fn ProviderEntry() -> impl IntoView {
|
||||
let multi_entries: RwSignal<Vec<MultiEntryData>> = RwSignal::new(vec![]);
|
||||
|
||||
view! (
|
||||
<h1>This is the provider entry page</h1>
|
||||
<h2>It would usually have a series of questions that we ask the providers</h2>
|
||||
@@ -16,8 +18,9 @@ pub fn ProviderEntry() -> impl IntoView {
|
||||
<div>
|
||||
<p>This is an example of the multientry element.</p>
|
||||
<MultiEntry
|
||||
nameMember="name".into()
|
||||
infoMember="info".into()
|
||||
entries=multi_entries
|
||||
name_member=Signal::from(MultiEntryMember::from_str("Entry Name", "name"))
|
||||
info_member=Signal::from(MultiEntryMember::from_str("Entry Info", "info"))
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user