From 358996234c1abcd88a29b13e5b62517b78edcd66 Mon Sep 17 00:00:00 2001 From: Saphire Lattice Date: Wed, 21 Aug 2024 01:06:04 +0700 Subject: [PATCH] Static navigation links! And no more streaming stuff (#20) * Remove some of unnecessary onclick handlers again * Disable blazor dynamic nav and page streaming --- ReplayBrowser/Pages/Home.razor | 2 +- ReplayBrowser/Pages/Leaderboard.razor | 1 - ReplayBrowser/Pages/Profile.razor | 1 - ReplayBrowser/Pages/Shared/App.razor | 6 +- ReplayBrowser/Pages/Shared/MainLayout.razor | 77 +++++++++++---------- ReplayBrowser/Pages/ViewReplay.razor | 2 +- 6 files changed, 45 insertions(+), 44 deletions(-) diff --git a/ReplayBrowser/Pages/Home.razor b/ReplayBrowser/Pages/Home.razor index fe9e1f9..919ef3a 100644 --- a/ReplayBrowser/Pages/Home.razor +++ b/ReplayBrowser/Pages/Home.razor @@ -5,7 +5,7 @@ @using ReplayBrowser.Helpers @using ReplayBrowser.Models @using ReplayBrowser.Pages.Shared -@attribute [StreamRendering] + @inject ReplayHelper ReplayHelper @inject AuthenticationStateProvider AuthenticationStateProvider diff --git a/ReplayBrowser/Pages/Leaderboard.razor b/ReplayBrowser/Pages/Leaderboard.razor index ddcee2f..a5f5d24 100644 --- a/ReplayBrowser/Pages/Leaderboard.razor +++ b/ReplayBrowser/Pages/Leaderboard.razor @@ -10,7 +10,6 @@ @inject IConfiguration Configuration @inject LeaderboardService LeaderboardService @inject Ss14ApiHelper Ss14ApiHelper -@attribute [StreamRendering] Leaderboard

Leaderboards

diff --git a/ReplayBrowser/Pages/Profile.razor b/ReplayBrowser/Pages/Profile.razor index f69ce53..a0ec38d 100644 --- a/ReplayBrowser/Pages/Profile.razor +++ b/ReplayBrowser/Pages/Profile.razor @@ -11,7 +11,6 @@ @inject ReplayHelper ReplayHelper @inject Ss14ApiHelper Ss14ApiHelper -@attribute [StreamRendering] Player info diff --git a/ReplayBrowser/Pages/Shared/App.razor b/ReplayBrowser/Pages/Shared/App.razor index c26681f..191c6d7 100644 --- a/ReplayBrowser/Pages/Shared/App.razor +++ b/ReplayBrowser/Pages/Shared/App.razor @@ -1,5 +1,5 @@  - + @@ -14,13 +14,15 @@ + + + - \ No newline at end of file diff --git a/ReplayBrowser/Pages/Shared/MainLayout.razor b/ReplayBrowser/Pages/Shared/MainLayout.razor index d7e0e74..59526df 100644 --- a/ReplayBrowser/Pages/Shared/MainLayout.razor +++ b/ReplayBrowser/Pages/Shared/MainLayout.razor @@ -43,28 +43,7 @@
-
- @foreach (var activeNotice in NoticeHelper.GetActiveNotices()) - { - // See in cookies if we have already dismissed this notice - var dismissed = HttpContextAccessor.HttpContext != null && HttpContextAccessor.HttpContext.Request.Cookies.ContainsKey($"dismissed-notice-{activeNotice.Id}"); - if (dismissed) - continue; - var markupString = new MarkupString(activeNotice.Message); - - - } - +
@if (_user.Identity.IsAuthenticated) { @if (_account is { Protected: true }) @@ -74,18 +53,18 @@

Your account is set as protected. Your redaction settings were automatically set to true, in order to prevent harassment or similar. Contact the site operator to remove your protection status.

} - +

Hello @_user.Claims.Single(c => c.Type == "name").Value!

Logout - Manage - Favourites - Watched profiles + Manage + Favourites + Watched profiles @if (_account?.IsAdmin ?? false) { - Admin - Manage notices + Admin + Manage notices } } else @@ -94,10 +73,32 @@ }
- Leaderboard - Main page - Current downloads - Changelog + Main page + Leaderboard + Current downloads + Changelog + +
+ @foreach (var activeNotice in NoticeHelper.GetActiveNotices()) + { + // See in cookies if we have already dismissed this notice + var dismissed = HttpContextAccessor.HttpContext != null && HttpContextAccessor.HttpContext.Request.Cookies.ContainsKey($"dismissed-notice-{activeNotice.Id}"); + if (dismissed) + continue; + var markupString = new MarkupString(activeNotice.Message); + + + }

Warning: Replays recorded before @ReplayParserService.CutOffDateTime.ToLocalTime().ToString("yyyy-MM-dd") (yyyy-MM-dd) are not supported and are not counted

@@ -108,9 +109,9 @@