feat(web): publish completed game portfolios

This commit is contained in:
Claude
2026-06-02 15:41:43 +03:00
parent e970e94e00
commit 401653a4d1
6 changed files with 571 additions and 4 deletions
@@ -1,7 +1,10 @@
@page "/gm/{Slug}"
@layout PublicLayout
@inject ISessionStore SessionStore
@inject IPortfolioStore PortfolioStore
@inject NavigationManager Navigation
@using GmRelay.Web.Components.Portfolio
@using GmRelay.Web.Services.Portfolio
<PageTitle>@PageTitleText</PageTitle>
@@ -83,12 +86,22 @@ else if (profile is not null)
}
</div>
}
@if (portfolioGames.Count > 0)
{
<section class="glass-card portfolio-section">
<h2>Портфолио</h2>
<p>Завершённые игры мастера, открытые для публичного просмотра.</p>
<PortfolioCardGrid Games="portfolioGames" />
</section>
}
}
@code {
[Parameter] public string? Slug { get; set; }
private GmRelay.Web.Services.PublicMasterProfile? profile;
private IReadOnlyList<PublicPortfolioCard> portfolioGames = [];
private bool loaded;
private string PageTitleText => profile is null ? "Профиль мастера — GM-Relay" : $"{profile.DisplayName} — GM-Relay";
@@ -101,9 +114,13 @@ else if (profile is not null)
protected override async Task OnParametersSetAsync()
{
loaded = false;
profile = string.IsNullOrWhiteSpace(Slug)
var trimmedSlug = string.IsNullOrWhiteSpace(Slug) ? null : Slug.Trim();
profile = trimmedSlug is null
? null
: await SessionStore.GetPublicMasterProfileBySlugAsync(Slug.Trim());
: await SessionStore.GetPublicMasterProfileBySlugAsync(trimmedSlug);
portfolioGames = trimmedSlug is null
? []
: await PortfolioStore.GetPublicPortfolioGamesForMasterAsync(trimmedSlug);
loaded = true;
}