Profile: hide alt text if the image is not loaded
This commit is contained in:
parent
e2a1f38958
commit
4aac0381ae
2 changed files with 21 additions and 13 deletions
|
@ -8,6 +8,21 @@
|
|||
gap: 16px;
|
||||
}
|
||||
|
||||
.banner {
|
||||
width: 100%;
|
||||
margin-top: calc(-1 * (var(--scaffold-topbar-height) + var(--safe-area-inset-top)));
|
||||
|
||||
>img {
|
||||
object-fit: cover;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
&::before {
|
||||
visibility: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.description {
|
||||
& a {
|
||||
color: inherit;
|
||||
|
|
|
@ -336,21 +336,14 @@ const Profile: Component = () => {
|
|||
</Menu>
|
||||
<div
|
||||
style={{
|
||||
width: "100%",
|
||||
height: `${268 * (Math.min(560, windowSize.width) / 560)}px`,
|
||||
"margin-top":
|
||||
"calc(-1 * (var(--scaffold-topbar-height) + var(--safe-area-inset-top)))",
|
||||
}}
|
||||
class="banner"
|
||||
role="presentation"
|
||||
>
|
||||
<img
|
||||
ref={(e) => obx.observe(e)}
|
||||
src={bannerImg()}
|
||||
style={{
|
||||
"object-fit": "cover",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
}}
|
||||
crossOrigin="anonymous"
|
||||
alt={`Banner image for ${profile()?.displayName || "the user"}`}
|
||||
onLoad={(event) => {
|
||||
|
|
Loading…
Reference in a new issue