Add sorting functionality for prospects with new ProspectSortControl component

This commit is contained in:
troogs
2026-04-16 21:42:15 +02:00
parent 701388ee34
commit eda6625e91
12 changed files with 153 additions and 60 deletions

View File

@@ -2,6 +2,7 @@
@page "/prospect"
@page "/prospects"
@using FoodsharingSiegen.Contracts
@using FoodsharingSiegen.Contracts.Enums
@using FoodsharingSiegen.Shared.Helper
@inherits FsBase
@@ -25,28 +26,11 @@
><i class="fa-solid fa-plus"></i>
</Button>
<Button
Color="Color.Primary"
Width="Width.Px(50)"
Height="Height.Px(50)"
title="Sortieren"
style="min-width: auto;"
Clicked="@OpenSortDialogAsync"
><i class="fa-solid fa-sort"></i>
</Button>
<div class="badge-row mt-2">
@if (HasCustomSort)
{
<Badge Color="Color.Primary" Closable="true" CloseClicked="@EventCallback.Factory.Create(this, ResetSortAsync)">@CurrentSortText</Badge>
}
</div>
<ProspectSortControl @bind-CurrentSort="CurrentSort" StorageKey="@StorageKeys.SortProspects" OnSortChanged="StateHasChanged" />
@{
var filterList = ProspectList.ApplyFilter(Filter);
var sortList = SortProspects(filterList);
var sortList = filterList.ApplySort(CurrentSort);
}
<hr/>