summaryrefslogtreecommitdiffstats
path: root/src/components/mod.rs
diff options
context:
space:
mode:
authorColin Reeder <colin@vpzom.click>2020-08-08 16:32:21 -0600
committerColin Reeder <colin@vpzom.click>2020-08-08 16:32:21 -0600
commit649d33ca68889669d62817765bf8d6a3441b6949 (patch)
tree2c6ef5db952b3a08112a3e62320ad502324250b3 /src/components/mod.rs
parent643eb3ca33122b094c30d4503b20e8e4d7069345 (diff)
Use SVG icons instead of emoji
Diffstat (limited to 'src/components/mod.rs')
-rw-r--r--src/components/mod.rs23
1 files changed, 20 insertions, 3 deletions
diff --git a/src/components/mod.rs b/src/components/mod.rs
index e3cd604..9527972 100644
--- a/src/components/mod.rs
+++ b/src/components/mod.rs
@@ -226,11 +226,18 @@ pub fn HTPage<'a, Children: render::Render>(
<>
<a
href={"/notifications"}
- class={if login.user.has_unread_notifications { "notification-indicator unread" } else { "notification-indicator" }}
>
- {"🔔︎"}
+ {
+ if login.user.has_unread_notifications {
+ hitide_icons::NOTIFICATIONS_SOME.img()
+ } else {
+ hitide_icons::NOTIFICATIONS.img()
+ }
+ }
+ </a>
+ <a href={format!("/users/{}", login.user.id)}>
+ {hitide_icons::PERSON.img()}
</a>
- <a href={format!("/users/{}", login.user.id)}>{"👤︎"}</a>
</>
})
} else {
@@ -501,3 +508,13 @@ impl<'a> render::Render for NotificationItem<'a> {
write!(writer, "</li>")
}
}
+
+trait IconExt {
+ fn img(&self) -> render::SimpleElement<()>;
+}
+
+impl IconExt for hitide_icons::Icon {
+ fn img(&self) -> render::SimpleElement<()> {
+ render::rsx! { <img src={format!("/static/{}", self.path)} class={"icon"} /> }
+ }
+}