diff --git a/src/infrastructure/services/random_svg_generators.rs b/src/infrastructure/services/random_svg_generators.rs index ed1a7c8..0132010 100644 --- a/src/infrastructure/services/random_svg_generators.rs +++ b/src/infrastructure/services/random_svg_generators.rs @@ -116,7 +116,7 @@ async fn fetch_text(req: String) -> RequestResult { async fn fetch_dicebear_svg( r#type: &DicebearType, - req_fields: &Vec, + req_fields: &[String], placeholder_fetcher: Option>>>, ) -> String { // TODO: Use configuration file @@ -146,7 +146,7 @@ async fn fetch_dicebear_svg( } #[cfg(feature = "desktop")] -fn gen_placeholder_fetcher<'a>(path: &'static str) -> Box>> { +fn gen_placeholder_fetcher(path: &'static str) -> Box>> { let path = format!("./public/{}", &path); Box::new(async move { match read_to_string(&path).await { diff --git a/src/ui/components/icons.rs b/src/ui/components/icons.rs index e978c23..99fcb3d 100644 --- a/src/ui/components/icons.rs +++ b/src/ui/components/icons.rs @@ -3,7 +3,6 @@ use dioxus::prelude::*; use dioxus_free_icons::icons::fa_solid_icons::{ FaComments, FaLayerGroup, FaMagnifyingGlass, FaPeopleGroup, }; -use dioxus_free_icons::icons::md_navigation_icons::MdArrowDropDown; use dioxus_free_icons::{Icon, IconShape}; turf::style_sheet!("src/ui/components/icons.scss"); @@ -26,9 +25,6 @@ macro_rules! transparent_icon { }; } -// TODO: Remove this icon once the conversation panel finished -transparent_icon!(DownArrowIcon, MdArrowDropDown); - transparent_icon!(SearchIcon, FaMagnifyingGlass); transparent_icon!(SpacesIcon, FaLayerGroup); transparent_icon!(ChatsIcon, FaComments); diff --git a/src/ui/components/login.rs b/src/ui/components/login.rs index 87f981d..2f68653 100644 --- a/src/ui/components/login.rs +++ b/src/ui/components/login.rs @@ -538,7 +538,7 @@ fn generate_modal( on_confirm: on_confirm, div { - {rendered_suggestions.into_iter()} + {rendered_suggestions.iter()} } } } @@ -608,15 +608,16 @@ pub fn Login() -> Element { generate_random_svg_shape(Some(&shape_config)).await }); - let avatar = match &*random_avatar_future.read_unchecked() { - Some(svg) => Some(rsx! { - div { - class: ClassName::LOGIN_AVATAR_CONTENT, - dangerous_inner_html: svg.as_str(), + let avatar = (*random_avatar_future.read_unchecked()) + .as_ref() + .map(|svg| { + rsx! { + div { + class: ClassName::LOGIN_AVATAR_CONTENT, + dangerous_inner_html: svg.as_str(), + } } - }), - None => None, - }; + }); if *spinner_animated.read() && SESSION.read().is_logged { debug!("Stop spinner"); diff --git a/src/ui/components/modal.rs b/src/ui/components/modal.rs index 59a5016..483c8ea 100644 --- a/src/ui/components/modal.rs +++ b/src/ui/components/modal.rs @@ -59,15 +59,16 @@ pub fn Modal(props: ModalProps) -> Element { let random_figure_future = use_resource(move || async move { generate_random_svg_avatar(avatar_config).await }); - let icon = match &*random_figure_future.read_unchecked() { - Some(svg) => Some(rsx! { - div { - class: ClassName::MODAL_CONTENT_ICON_PLACEHOLDER, - dangerous_inner_html: svg.as_str(), + let icon = (*random_figure_future.read_unchecked()) + .as_ref() + .map(|svg| { + rsx! { + div { + class: ClassName::MODAL_CONTENT_ICON_PLACEHOLDER, + dangerous_inner_html: svg.as_str(), + } } - }), - None => None, - }; + }); let button_class = match &props.severity { Severity::Ok => SuccessButton,