From bf186a9f22f764b1088393668ac6c6e7c90974c3 Mon Sep 17 00:00:00 2001 From: Lilian Date: Tue, 9 Jul 2024 02:37:07 +0200 Subject: [PATCH] [frontend] Allow opening user profile from UserProfileCard --- Iceshrimp.Frontend/Components/UserProfileCard.razor | 10 +++++++++- .../Components/UserProfileCard.razor.css | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Iceshrimp.Frontend/Components/UserProfileCard.razor b/Iceshrimp.Frontend/Components/UserProfileCard.razor index 736c198c..94dea746 100644 --- a/Iceshrimp.Frontend/Components/UserProfileCard.razor +++ b/Iceshrimp.Frontend/Components/UserProfileCard.razor @@ -1,9 +1,10 @@ @inject ApiService Api; @using Iceshrimp.Frontend.Core.Services @using Iceshrimp.Shared.Schemas.Web +@inject NavigationManager NavigationManager; @if (UserProfile != null) { -
+
@@ -34,4 +35,11 @@ { UserProfile = await Api.Users.GetUserProfile(User.Id); } + + private void Open() + { + var username = $"@{User.Username}"; + if (User.Host != null) username += $"@{User.Host}"; + NavigationManager.NavigateTo($"/{username}"); + } } \ No newline at end of file diff --git a/Iceshrimp.Frontend/Components/UserProfileCard.razor.css b/Iceshrimp.Frontend/Components/UserProfileCard.razor.css index b1f14cbd..1913fa11 100644 --- a/Iceshrimp.Frontend/Components/UserProfileCard.razor.css +++ b/Iceshrimp.Frontend/Components/UserProfileCard.razor.css @@ -19,7 +19,7 @@ border-radius: 1rem; background-color: var(--foreground-color); max-width: 45rem; - margin: 1rem auto auto; + margin-top: 1rem; width: 100%; }