Neighbourhood.omg.lol/Components/Pages/Now.razor

38 lines
1.1 KiB
Text
Raw Normal View History

2024-06-11 00:36:48 +00:00
@page "/now"
@inject IJSRuntime JS
2024-06-11 00:36:48 +00:00
@inject State State
<PageHeading title="Now.garden" icon="fa-duotone fa-seedling">
<Description>Feel free to stroll through the <a href="now.garden">now.garden</a> and take a look at what people are up to.</Description>
</PageHeading>
2024-06-11 00:36:48 +00:00
<div id="now-garden" class="responsive card-grid">
@if (garden != null) {
foreach (NowData now in garden) {
2024-06-11 00:36:48 +00:00
<article class="now">
<nav>
<a class="author" href="/person/@now.Address#now">
2024-06-13 06:35:40 +00:00
<h6><i class="fa-duotone fa-seedling"></i> @now.Address</h6>
2024-06-11 00:36:48 +00:00
</a>
</nav>
<nav>
<small>@now.UpdatedRelative</small>
</nav>
</article>
}
}
<LoadingCard id="now-loading" icon="fa-duotone fa-seedling" class="now"></LoadingCard>
2024-06-11 00:36:48 +00:00
</div>
@code {
private List<NowData>? garden;
2024-06-11 00:36:48 +00:00
protected override async Task OnInitializedAsync() {
await base.OnInitializedAsync();
if (garden == null || garden.Count == 0) garden = await State.GetNowGarden();
await InvokeAsync(StateHasChanged);
await JS.InvokeVoidAsync("removeElementById", "now-loading");
}
2024-06-11 00:36:48 +00:00
}