web: use favicon for avatar when viewing a post
This commit is contained in:
parent
a3f720a51e
commit
410e582b44
@ -1101,9 +1101,26 @@ fn render_news_post_header(post: &ShowThreadQueryThreadOnNewsPost) -> Node<Msg>
|
|||||||
let is_unread = !post.is_read;
|
let is_unread = !post.is_read;
|
||||||
// TODO: use https://www.google.com/s2/favicons?domain={domain}
|
// TODO: use https://www.google.com/s2/favicons?domain={domain}
|
||||||
let avatar = render_avatar(avatar, &from, true);
|
let avatar = render_avatar(avatar, &from, true);
|
||||||
|
let domain = &post.url;
|
||||||
|
let favicon = div![
|
||||||
|
C![
|
||||||
|
"w-16",
|
||||||
|
"h-16",
|
||||||
|
"text-4xl",
|
||||||
|
"[text-shadow:_0_1px_0_rgb(0_0_0_/_40%)]",
|
||||||
|
"font-extrabold",
|
||||||
|
"grid",
|
||||||
|
"place-content-center",
|
||||||
|
"uppercase"
|
||||||
|
],
|
||||||
|
img![
|
||||||
|
C!["object-cover", "w-16", "h-16",],
|
||||||
|
attrs! {At::Src=>format!("https://www.google.com/s2/favicons?sz=64&domain={domain}")}
|
||||||
|
],
|
||||||
|
];
|
||||||
div![
|
div![
|
||||||
C!["flex", "p-4"],
|
C!["flex", "p-4"],
|
||||||
div![avatar],
|
div![favicon],
|
||||||
div![
|
div![
|
||||||
C!["px-4", "mr-auto"],
|
C!["px-4", "mr-auto"],
|
||||||
div![
|
div![
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user