Skip to content

Commit

Permalink
profile links in cards
Browse files Browse the repository at this point in the history
  • Loading branch information
wyatt-avilla committed Jun 21, 2024
1 parent c15b3a2 commit a9870af
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 21 deletions.
14 changes: 14 additions & 0 deletions config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ pub const ENDPOINT: Endpoint = Endpoint {
goodreads: "/api/goodreads",
};

pub const SOCIAL: SocialLinks = SocialLinks {
github: "https://github.com/wyatt-avilla",
lastfm: "https://www.last.fm/user/wowitswyatt",
letterboxd: "https://letterboxd.com/wowitswyatt/",
goodreads: "https://www.goodreads.com/user/show/159014522-wowitswyatt",
};

pub struct SocialLinks<'a> {
pub github: &'a str,
pub lastfm: &'a str,
pub letterboxd: &'a str,
pub goodreads: &'a str,
}

pub struct Endpoint<'a> {
pub base: &'a str,
pub github: &'a str,
Expand Down
9 changes: 4 additions & 5 deletions frontend/src/components/github/button.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use config::SOCIAL;
use stylist::yew::styled_component;
use yew::prelude::*;

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

let onclick = Callback::noop();

html! {
<button class={css!(r#"
<a href={ SOCIAL.github } class={css!(r#"
background: none;
border: none;
cursor: pointer;
border-radius: 50%;
"#)} onclick={ onclick }>
"#)}>
{ icon_svg.clone() }
</button>
</a>
}
}
11 changes: 5 additions & 6 deletions frontend/src/components/goodreads/button.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use config::SOCIAL;
use stylist::yew::styled_component;
use yew::prelude::*;

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

let onclick = Callback::noop();

html! {
<button class={css!(r#"
<a href={ SOCIAL.goodreads } class={css!(r#"
background: none;
border: none;
cursor: pointer;
border-radius: 50%;
"#)} onclick={ onclick }>
{ icon_svg.clone() }
</button>
"#)}>
{ icon_svg.clone() }
</a>
}
}
9 changes: 4 additions & 5 deletions frontend/src/components/lastfm/button.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use config::SOCIAL;
use stylist::yew::styled_component;
use yew::prelude::*;

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

let onclick = Callback::noop();

html! {
<button class={css!(r#"
<a href={ SOCIAL.lastfm } class={css!(r#"
background: none;
border: none;
cursor: pointer;
border-radius: 50%;
"#)} onclick={ onclick }>
"#)}>
{ icon_svg.clone() }
</button>
</a>
}
}
9 changes: 4 additions & 5 deletions frontend/src/components/letterboxd/button.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use config::SOCIAL;
use stylist::yew::styled_component;
use yew::prelude::*;

Expand Down Expand Up @@ -36,16 +37,14 @@ pub fn Button() -> Html {
</svg>
};

let onclick = Callback::noop();

html! {
<button class={css!(r#"
<a href={ SOCIAL.letterboxd } class={css!(r#"
background: none;
border: none;
cursor: pointer;
border-radius: 50%;
"#)} onclick={ onclick }>
"#)}>
{ icon_svg.clone() }
</button>
</a>
}
}

0 comments on commit a9870af

Please sign in to comment.