Skip to content

Commit a9870af

Browse files
committed
profile links in cards
1 parent c15b3a2 commit a9870af

File tree

5 files changed

+31
-21
lines changed

5 files changed

+31
-21
lines changed

config/src/lib.rs

+14
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,20 @@ pub const ENDPOINT: Endpoint = Endpoint {
2222
goodreads: "/api/goodreads",
2323
};
2424

25+
pub const SOCIAL: SocialLinks = SocialLinks {
26+
github: "https://github.com/wyatt-avilla",
27+
lastfm: "https://www.last.fm/user/wowitswyatt",
28+
letterboxd: "https://letterboxd.com/wowitswyatt/",
29+
goodreads: "https://www.goodreads.com/user/show/159014522-wowitswyatt",
30+
};
31+
32+
pub struct SocialLinks<'a> {
33+
pub github: &'a str,
34+
pub lastfm: &'a str,
35+
pub letterboxd: &'a str,
36+
pub goodreads: &'a str,
37+
}
38+
2539
pub struct Endpoint<'a> {
2640
pub base: &'a str,
2741
pub github: &'a str,

frontend/src/components/github/button.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use config::SOCIAL;
12
use stylist::yew::styled_component;
23
use yew::prelude::*;
34

@@ -17,16 +18,14 @@ pub fn Button() -> Html {
1718
</svg>
1819
};
1920

20-
let onclick = Callback::noop();
21-
2221
html! {
23-
<button class={css!(r#"
22+
<a href={ SOCIAL.github } class={css!(r#"
2423
background: none;
2524
border: none;
2625
cursor: pointer;
2726
border-radius: 50%;
28-
"#)} onclick={ onclick }>
27+
"#)}>
2928
{ icon_svg.clone() }
30-
</button>
29+
</a>
3130
}
3231
}
+5-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use config::SOCIAL;
12
use stylist::yew::styled_component;
23
use yew::prelude::*;
34

@@ -9,16 +10,14 @@ pub fn Button() -> Html {
910
</svg>
1011
};
1112

12-
let onclick = Callback::noop();
13-
1413
html! {
15-
<button class={css!(r#"
14+
<a href={ SOCIAL.goodreads } class={css!(r#"
1615
background: none;
1716
border: none;
1817
cursor: pointer;
1918
border-radius: 50%;
20-
"#)} onclick={ onclick }>
21-
{ icon_svg.clone() }
22-
</button>
19+
"#)}>
20+
{ icon_svg.clone() }
21+
</a>
2322
}
2423
}
+4-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use config::SOCIAL;
12
use stylist::yew::styled_component;
23
use yew::prelude::*;
34

@@ -9,16 +10,14 @@ pub fn Button() -> Html {
910
</svg>
1011
};
1112

12-
let onclick = Callback::noop();
13-
1413
html! {
15-
<button class={css!(r#"
14+
<a href={ SOCIAL.lastfm } class={css!(r#"
1615
background: none;
1716
border: none;
1817
cursor: pointer;
1918
border-radius: 50%;
20-
"#)} onclick={ onclick }>
19+
"#)}>
2120
{ icon_svg.clone() }
22-
</button>
21+
</a>
2322
}
2423
}

frontend/src/components/letterboxd/button.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use config::SOCIAL;
12
use stylist::yew::styled_component;
23
use yew::prelude::*;
34

@@ -36,16 +37,14 @@ pub fn Button() -> Html {
3637
</svg>
3738
};
3839

39-
let onclick = Callback::noop();
40-
4140
html! {
42-
<button class={css!(r#"
41+
<a href={ SOCIAL.letterboxd } class={css!(r#"
4342
background: none;
4443
border: none;
4544
cursor: pointer;
4645
border-radius: 50%;
47-
"#)} onclick={ onclick }>
46+
"#)}>
4847
{ icon_svg.clone() }
49-
</button>
48+
</a>
5049
}
5150
}

0 commit comments

Comments
 (0)