diff --git a/public/Book.png b/public/Book.png new file mode 100644 index 0000000..939c4da Binary files /dev/null and b/public/Book.png differ diff --git a/public/Book_Style2.png b/public/Book_Style2.png new file mode 100644 index 0000000..66f1f94 Binary files /dev/null and b/public/Book_Style2.png differ diff --git a/public/Book_Style3.png b/public/Book_Style3.png new file mode 100644 index 0000000..4fc3e06 Binary files /dev/null and b/public/Book_Style3.png differ diff --git a/public/Bulb.png b/public/Bulb.png new file mode 100644 index 0000000..2940e9e Binary files /dev/null and b/public/Bulb.png differ diff --git a/public/Bulb_Style2.png b/public/Bulb_Style2.png new file mode 100644 index 0000000..6778936 Binary files /dev/null and b/public/Bulb_Style2.png differ diff --git a/public/Calendar.png b/public/Calendar.png new file mode 100644 index 0000000..b40ab22 Binary files /dev/null and b/public/Calendar.png differ diff --git a/public/Calendar_Style2.png b/public/Calendar_Style2.png new file mode 100644 index 0000000..38d570c Binary files /dev/null and b/public/Calendar_Style2.png differ diff --git a/public/Check.png b/public/Check.png new file mode 100644 index 0000000..27c9cd4 Binary files /dev/null and b/public/Check.png differ diff --git a/public/Check_Style2.png b/public/Check_Style2.png new file mode 100644 index 0000000..4de2ba3 Binary files /dev/null and b/public/Check_Style2.png differ diff --git a/public/Cog_Black.png b/public/Cog_Black.png new file mode 100644 index 0000000..4c574b6 Binary files /dev/null and b/public/Cog_Black.png differ diff --git a/public/Cog_Style3.png b/public/Cog_Style3.png new file mode 100644 index 0000000..df5d926 Binary files /dev/null and b/public/Cog_Style3.png differ diff --git a/public/Create.png b/public/Create.png new file mode 100644 index 0000000..5b0118b Binary files /dev/null and b/public/Create.png differ diff --git a/public/Create_Black.png b/public/Create_Black.png new file mode 100644 index 0000000..43cc0ed Binary files /dev/null and b/public/Create_Black.png differ diff --git a/public/Edit.png b/public/Edit.png new file mode 100644 index 0000000..a691d08 Binary files /dev/null and b/public/Edit.png differ diff --git a/public/Form.png b/public/Form.png new file mode 100644 index 0000000..c534471 Binary files /dev/null and b/public/Form.png differ diff --git a/public/Form_Black.png b/public/Form_Black.png new file mode 100644 index 0000000..528abaf Binary files /dev/null and b/public/Form_Black.png differ diff --git a/public/Medal_Black.png b/public/Medal_Black.png new file mode 100644 index 0000000..9c1e2a5 Binary files /dev/null and b/public/Medal_Black.png differ diff --git a/public/Person.png b/public/Person.png new file mode 100644 index 0000000..35f5e14 Binary files /dev/null and b/public/Person.png differ diff --git a/public/Person_Black.png b/public/Person_Black.png new file mode 100644 index 0000000..76891b8 Binary files /dev/null and b/public/Person_Black.png differ diff --git a/public/Warning.png b/public/Warning.png new file mode 100644 index 0000000..60efb17 Binary files /dev/null and b/public/Warning.png differ diff --git a/public/Warning_Style2.png b/public/Warning_Style2.png new file mode 100644 index 0000000..bc301e0 Binary files /dev/null and b/public/Warning_Style2.png differ diff --git a/public/medal.png b/public/medal.png new file mode 100644 index 0000000..0fc6b76 Binary files /dev/null and b/public/medal.png differ diff --git a/public/square-user.svg b/public/square-user.svg new file mode 100644 index 0000000..92f1016 --- /dev/null +++ b/public/square-user.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/app.rs b/src/app.rs index e854ce4..1c7065b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -7,7 +7,7 @@ use leptos_router::{ }; use url::Url; -use crate::pages::{AboutPage, HomePage, UnauthenticatedPage}; +use crate::pages::{AboutPage, HomePage, TestPage, UnauthenticatedPage}; pub fn shell(options: LeptosOptions) -> impl IntoView { view! { @@ -67,6 +67,7 @@ pub fn App() -> impl IntoView { + diff --git a/src/components/checkbox.rs b/src/components/checkbox.rs index a245834..ba711dc 100644 --- a/src/components/checkbox.rs +++ b/src/components/checkbox.rs @@ -1,4 +1,5 @@ use crate::common::ValueType; +use crate::components::utils::create_unique_id; use leptos::prelude::*; use std::collections::HashMap; @@ -7,10 +8,13 @@ pub fn Checkbox( #[prop()] checked: Signal, #[prop(into)] on_change: Callback<(), ()>, #[prop(into)] value: String, + #[prop(into)] name: String, #[prop(default = RwSignal::new(false))] disabled: RwSignal, ) -> impl IntoView { + let id = create_unique_id(&name, &value); + view! { - + } diff --git a/src/components/chips.rs b/src/components/chips.rs index bc3a31c..6c117b0 100644 --- a/src/components/chips.rs +++ b/src/components/chips.rs @@ -1,13 +1,14 @@ -use std::collections::HashMap; -use leptos::prelude::*; use crate::common::ValueType; +use crate::components::utils::create_unique_id; +use leptos::prelude::*; +use std::collections::HashMap; /// # Chip Component -/// +/// /// This component defines a single chip for use in the `ChipsList` component. It functions almost /// identically to the `Checkbox` component. It should only be created from within its parent /// `CheckboxList` component. -/// +/// /// Example usage: /// ``` /// view! { @@ -31,11 +32,8 @@ pub fn Chip( ) -> impl IntoView { // Generate a unique id - ensure that the value doesn't contain spaces. // Without this id, checkbox/radio inputs can interfere with each other. - let value_no_spaces = value.clone().chars() - .filter(|c| !c.is_whitespace()) - .collect::(); - let id = format!("{}-{}", name.clone(), value_no_spaces); - + let id = create_unique_id(&name, &value); + view! { +/// +/// +/// ``` +#[component] +pub fn DashboardButton( + /// The main label displayed on the button. + #[prop(into)] + title: String, + /// A brief explanatory text that describes the destination page. + #[prop(into)] + description: String, + /// The file path or URL of the icon displayed at the top of the button. + #[prop(into)] + icon: String, + /// The route that the user is navigated to when clicking the button. + #[prop(into)] + path: String, +) -> impl IntoView { + let navigate = use_navigate(); + + let on_click = move |_| navigate(&path, Default::default()); + + view! { + + + + + + {title.clone()} + + + + {description.clone()} + + + + + } +} diff --git a/src/components/mod.rs b/src/components/mod.rs index 2616640..f0297f7 100644 --- a/src/components/mod.rs +++ b/src/components/mod.rs @@ -1,5 +1,7 @@ mod action_button; mod checkbox; +mod chips; +mod dashboard_button; mod loading; mod multi_entry; mod panel; @@ -7,9 +9,9 @@ mod radio; mod row; mod select; mod text_field; -mod chips; +mod utils; pub use self::{ - action_button::*, checkbox::*, loading::*, multi_entry::*, panel::*, radio::*, row::*, - select::*, text_field::*, chips::* + action_button::*, checkbox::*, chips::*, dashboard_button::*, loading::*, multi_entry::*, + panel::*, radio::*, row::*, select::*, text_field::*, }; diff --git a/src/components/radio.rs b/src/components/radio.rs index 73cc789..72047ef 100644 --- a/src/components/radio.rs +++ b/src/components/radio.rs @@ -1,4 +1,5 @@ use crate::common::ValueType; +use crate::components::utils::create_unique_id; use leptos::prelude::*; use std::collections::HashMap; @@ -7,10 +8,13 @@ pub fn Radio( #[prop()] checked: Signal, #[prop(into)] on_change: Callback<(), ()>, #[prop(into)] value: String, + #[prop(into)] name: String, #[prop(default = RwSignal::new(false))] disabled: RwSignal, ) -> impl IntoView { + let id = create_unique_id(&name, &value); + view! { - + } diff --git a/src/components/utils.rs b/src/components/utils.rs new file mode 100644 index 0000000..6dba9c9 --- /dev/null +++ b/src/components/utils.rs @@ -0,0 +1,10 @@ +/// Creates a unique ID for use in components like the [`CheckboxList`], +/// [`RadioList`], and [`ChipsList`]. +pub fn create_unique_id(name: &String, value: &String) -> String { + let value_no_spaces = value + .clone() + .chars() + .filter(|c| !c.is_whitespace()) + .collect::(); + format!("{}-{}", name.clone(), value_no_spaces) +} diff --git a/src/pages/mod.rs b/src/pages/mod.rs index 5e2f017..3f50e1a 100644 --- a/src/pages/mod.rs +++ b/src/pages/mod.rs @@ -1,6 +1,9 @@ mod about_page; mod home_page; mod provider_portal; +mod test_page; mod unauthenticated_page; -pub use self::{about_page::*, home_page::*, provider_portal::*, unauthenticated_page::*}; +pub use self::{ + about_page::*, home_page::*, provider_portal::*, test_page::*, unauthenticated_page::*, +}; diff --git a/src/pages/test_page.rs b/src/pages/test_page.rs new file mode 100644 index 0000000..f3e1f28 --- /dev/null +++ b/src/pages/test_page.rs @@ -0,0 +1,28 @@ +use crate::components::DashboardButton; +use leptos::prelude::*; + +#[component] +pub fn TestPage() -> impl IntoView { + view! { + + + + + + } +}
+ {description.clone()} +