Skip to content

Commit

Permalink
[Feat] add contact lnk
Browse files Browse the repository at this point in the history
  • Loading branch information
mistricky committed Jun 7, 2022
1 parent 4d605f4 commit a0d66e3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
7 changes: 6 additions & 1 deletion ui/src/common/contact.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::image::Icon;
use crate::link::Link;
use utils::use_style;
use yew::prelude::*;

Expand Down Expand Up @@ -70,7 +71,11 @@ pub fn contacts(props: &ContactsProps) -> Html {
.iter()
.map(|contact| {
let source: &'static str = contact.into();
html! {<Icon source={source} size={contact.into_size()} has_theme={contact.has_theme()} />}
html! {
<Link out_href={contact.into_lnk()}>
<Icon source={source} size={contact.into_size()} has_theme={contact.has_theme()} />
</Link>
}
})
.collect::<Html>();

Expand Down
5 changes: 4 additions & 1 deletion ui/src/common/header/header.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::contact::ContactType;
use crate::container::Container;
use crate::header::drawer::Drawer;
use crate::header::drawer_item::DrawerItem;
Expand Down Expand Up @@ -120,7 +121,9 @@ pub fn header() -> Html {
</div>
<div class="right">
<Icon source="setting.svg" size=26 onclick={handle_setting_click} />
<Icon source="github.svg" size=26 />
<Link out_href={ContactType::GitHub.into_lnk()}>
<Icon source="github.svg" size=26 />
</Link>
{only_render_on_mobile(html! {
<Icon source="drawer.svg" size=26 onclick={handle_drawer_click} />
})}
Expand Down

0 comments on commit a0d66e3

Please sign in to comment.