about summary refs log tree commit diff
path: root/frontend/src/app.rs
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-01 20:35:40 +0100
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-11-01 20:35:40 +0100
commitf40a40e555f0041e8f7631e26adadd5cc47a5768 (patch)
treea0c933d47e32c5cfc9747dc0b6b9b0001e738555 /frontend/src/app.rs
parentFrontend: Result component: Add basic structure (diff)
downloadOSSE-f40a40e555f0041e8f7631e26adadd5cc47a5768.tar.gz
OSSE-f40a40e555f0041e8f7631e26adadd5cc47a5768.tar.bz2
OSSE-f40a40e555f0041e8f7631e26adadd5cc47a5768.zip
Frontend: Result component: Use the stylist crate to apply basic css
Diffstat (limited to '')
-rw-r--r--frontend/src/app.rs17
1 files changed, 15 insertions, 2 deletions
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)}