[frontend] Allow opening user profile from UserProfileCard
This commit is contained in:
parent
d36a9ec235
commit
bf186a9f22
2 changed files with 10 additions and 2 deletions
|
@ -1,9 +1,10 @@
|
||||||
@inject ApiService Api;
|
@inject ApiService Api;
|
||||||
@using Iceshrimp.Frontend.Core.Services
|
@using Iceshrimp.Frontend.Core.Services
|
||||||
@using Iceshrimp.Shared.Schemas.Web
|
@using Iceshrimp.Shared.Schemas.Web
|
||||||
|
@inject NavigationManager NavigationManager;
|
||||||
@if (UserProfile != null)
|
@if (UserProfile != null)
|
||||||
{
|
{
|
||||||
<div class="profile-card">
|
<div @onclick="Open" class="profile-card">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div>
|
<div>
|
||||||
<img class="avatar" src="@User.AvatarUrl"/>
|
<img class="avatar" src="@User.AvatarUrl"/>
|
||||||
|
@ -34,4 +35,11 @@
|
||||||
{
|
{
|
||||||
UserProfile = await Api.Users.GetUserProfile(User.Id);
|
UserProfile = await Api.Users.GetUserProfile(User.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Open()
|
||||||
|
{
|
||||||
|
var username = $"@{User.Username}";
|
||||||
|
if (User.Host != null) username += $"@{User.Host}";
|
||||||
|
NavigationManager.NavigateTo($"/{username}");
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -19,7 +19,7 @@
|
||||||
border-radius: 1rem;
|
border-radius: 1rem;
|
||||||
background-color: var(--foreground-color);
|
background-color: var(--foreground-color);
|
||||||
max-width: 45rem;
|
max-width: 45rem;
|
||||||
margin: 1rem auto auto;
|
margin-top: 1rem;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue