use yew::prelude::*; use crate::components::PageHeader; /// The route for `/userstyles`. pub(crate) struct UserstylesRoute; impl Component for UserstylesRoute { type Message = (); type Properties = (); fn create(_props: Self::Properties, _link: ComponentLink) -> Self { log::trace!("Creating UserstylesRoute"); Self } fn update(&mut self, _msg: Self::Message) -> ShouldRender { unimplemented!() } fn change(&mut self, _props: Self::Properties) -> ShouldRender { false } fn view(&self) -> Html { let styles = userstyles::ALL_USERSTYLES .iter() .map(|target| userstyles::Userstyle::load(target)) .flatten() .map(|style| { let style_name = style.metadata.name.to_lowercase().replace(" ", "-"); html! {

{style.metadata.name}

{"Install"}

{style.metadata.description}

} }) .collect::>(); html! { <>
{styles}
} } }