Added ProfilePictureComponent

This commit is contained in:
Mia Rose Winter 2024-01-15 20:51:23 +01:00
parent c96b6c5ba2
commit 08daca8dd3
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
2 changed files with 12 additions and 6 deletions

View file

@ -57,12 +57,7 @@
</ul> </ul>
<AuthorizeView> <AuthorizeView>
@if (context.User.FindFirst(ClaimTypes.NameIdentifier)?.Value is { } id) { @if (context.User.FindFirst(ClaimTypes.NameIdentifier)?.Value is { } id) {
<div class="avatar"> <ProfilePictureComponent ProfileId="@id" />
<div class="w-8 rounded">
<img src="/api/user/pfp/@id" alt="" loading="lazy"
onerror="this.remove()" />
</div>
</div>
} }
</AuthorizeView> </AuthorizeView>
</div> </div>

View file

@ -0,0 +1,11 @@
<div class="avatar">
<div class="w-8 rounded">
<img src="/api/user/pfp/@ProfileId" alt="" loading="lazy"
onerror="this.remove()" />
</div>
</div>
@code {
[Parameter]
public string ProfileId { get; set; } = string.Empty;
}