fixed Home page hero loading avatar lazily, even tho it is always visible on navigation

This commit is contained in:
Mia Rose Winter 2024-03-18 12:08:55 +01:00
parent ed69c55d3b
commit 9831bbd5bf
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 4 additions and 3 deletions

View file

@ -90,7 +90,7 @@
</p>
</div>
<div class="hidden sm:block w-1/3 float-left mr-2">
<ProfilePictureComponent ProfileId="@featured.Author.Id" Size="400" />
<ProfilePictureComponent ProfileId="@featured.Author.Id" LoadAsync="false" Size="400" />
</div>
<p class="font-bold">@featured.Author.FullName</p>
<small class="text-sm">@featured.PublishDate.ToString("g")</small>

View file

@ -1,6 +1,6 @@
<div class="avatar">
<div class="rounded">
<img src="/api/user/pfp/@ProfileId?size=@Size" alt="" loading="lazy" width="@Size" onerror="this.remove()" />
<img src="/api/user/pfp/@ProfileId?size=@Size" alt="" loading="@(LoadAsync ? "lazy" : "eager")" width="@Size" onerror="this.remove()" />
</div>
</div>
@ -9,5 +9,6 @@
public string ProfileId { get; set; } = string.Empty;
[Parameter]
public int Size { get; set; } = 800;
[Parameter]
public bool LoadAsync { get; set; } = true;
}