2024-06-05 12:41:08 +00:00
|
|
|
@page "/pics"
|
2024-06-06 05:20:09 +00:00
|
|
|
@inject State State
|
2024-06-05 12:41:08 +00:00
|
|
|
|
|
|
|
<div class="row center-align">
|
|
|
|
<h3>
|
2024-06-11 00:36:48 +00:00
|
|
|
<i class="fa-solid fa-images"></i> Some.pics
|
2024-06-05 12:41:08 +00:00
|
|
|
</h3>
|
|
|
|
</div>
|
|
|
|
<div class="row center-align">
|
|
|
|
<p>Sit back, relax, and look at <a href="https://some.pics/">some.pics</a></p>
|
|
|
|
</div>
|
|
|
|
|
2024-06-06 05:20:09 +00:00
|
|
|
<AuthorizeView>
|
|
|
|
<Authorized>
|
|
|
|
<button class="fab circle extra large-elevate" data-ui="#post-modal">
|
|
|
|
<i class="fa-solid fa-camera-retro"></i>
|
|
|
|
</button>
|
|
|
|
<NewPicDialog id="post-modal"></NewPicDialog>
|
|
|
|
</Authorized>
|
|
|
|
</AuthorizeView>
|
|
|
|
|
2024-06-07 04:25:21 +00:00
|
|
|
<div id="pics" class="responsive card-grid">
|
2024-06-06 05:20:09 +00:00
|
|
|
<PicList PicsFunc="@State.VirtualPicsFunc()"></PicList>
|
2024-06-05 12:41:08 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
@code {
|
|
|
|
private List<Pic> pics;
|
|
|
|
private async ValueTask<ItemsProviderResult<Pic>> GetPics(ItemsProviderRequest request) {
|
|
|
|
// TODO: request.cancellationToken
|
|
|
|
RestService api = new RestService();
|
|
|
|
if(pics == null || pics.Count == 0) pics = await api.SomePics();
|
|
|
|
var numPics = Math.Min(request.Count, pics.Count - request.StartIndex);
|
|
|
|
return new ItemsProviderResult<Pic>(pics.Skip(request.StartIndex).Take(numPics), pics.Count);
|
|
|
|
}
|
|
|
|
}
|