diff options
author | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-11-01 20:35:40 +0100 |
---|---|---|
committer | Baitinq <manuelpalenzuelamerino@gmail.com> | 2022-11-01 20:35:40 +0100 |
commit | f40a40e555f0041e8f7631e26adadd5cc47a5768 (patch) | |
tree | a0c933d47e32c5cfc9747dc0b6b9b0001e738555 /frontend | |
parent | Frontend: Result component: Add basic structure (diff) | |
download | OSSE-f40a40e555f0041e8f7631e26adadd5cc47a5768.tar.gz OSSE-f40a40e555f0041e8f7631e26adadd5cc47a5768.tar.bz2 OSSE-f40a40e555f0041e8f7631e26adadd5cc47a5768.zip |
Frontend: Result component: Use the stylist crate to apply basic css
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/Cargo.toml | 1 | ||||
-rw-r--r-- | frontend/src/app.rs | 17 |
2 files changed, 16 insertions, 2 deletions
diff --git a/frontend/Cargo.toml b/frontend/Cargo.toml index f3d1e6d..5b76828 100644 --- a/frontend/Cargo.toml +++ b/frontend/Cargo.toml @@ -16,4 +16,5 @@ gloo-net = "0.2" wasm-bindgen-futures = "0.4" itertools = "0.10.5" urlencoding = "2.1.2" +stylist = "0.10" lib = { path = "../lib" } \ No newline at end of file diff --git a/frontend/src/app.rs b/frontend/src/app.rs index d4ef37c..2389922 100644 --- a/frontend/src/app.rs +++ b/frontend/src/app.rs @@ -2,6 +2,7 @@ use crate::Route; use gloo_net::http::Request; use itertools::Itertools; use lib::lib::*; +use stylist::style; use wasm_bindgen::*; use web_sys::{EventTarget, HtmlInputElement}; use yew::prelude::*; @@ -14,11 +15,23 @@ pub struct ResultComponentProps { #[function_component(ResultComponent)] fn result_component(props: &ResultComponentProps) -> Html { + let style = style!( + r#" + a { + text-decoration: none; + } + .underline-hover:hover { + text-decoration: underline; + } + "# + ) + .unwrap(); + let style = style.get_class_name().to_owned(); html! { - <div class="my-5"> + <div class={format!("mb-5 {}", style)}> <a href={props.result.url.clone()}> <p class="text-muted">{props.result.url.clone()}</p> - <p>{props.result.title.clone()}</p> + <p class="underline-hover">{props.result.title.clone()}</p> </a> <p>//No description if no description {props.result.description.clone()}{format!("PRIO: {}", props.result.priority)} |