|
43 | 43 | Class="mud-text-field-large" /> |
44 | 44 | </MudPaper> |
45 | 45 |
|
46 | | - @if (isLoading) |
| 46 | + @if (isLoading && pagedBooks == null) |
47 | 47 | { |
48 | 48 | <MudGrid> |
49 | 49 | @for (int i = 0; i < 8; i++) |
|
73 | 73 | else if (pagedBooks != null) |
74 | 74 | { |
75 | 75 | @* Results Info *@ |
76 | | - <MudText Typo="Typo.body2" Color="Color.Secondary" Class="mb-4"> |
77 | | - Showing @pagedBooks.Items.Count of @pagedBooks.TotalItemCount books |
78 | | - @if (!string.IsNullOrWhiteSpace(searchQuery)) |
| 76 | + <MudStack Row="true" AlignItems="AlignItems.Center" Class="mb-4"> |
| 77 | + <MudText Typo="Typo.body2" Color="Color.Secondary"> |
| 78 | + Showing @pagedBooks.Items.Count of @pagedBooks.TotalItemCount books |
| 79 | + @if (!string.IsNullOrWhiteSpace(searchQuery)) |
| 80 | + { |
| 81 | + <MudChip T="string" Size="Size.Small" Color="Color.Primary" Class="ml-2">@searchQuery</MudChip> |
| 82 | + } |
| 83 | + </MudText> |
| 84 | + <MudSpacer /> |
| 85 | + @if (isFetching) |
79 | 86 | { |
80 | | - <MudChip T="string" Size="Size.Small" Color="Color.Primary" Class="ml-2">@searchQuery</MudChip> |
| 87 | + <MudProgressCircular Color="Color.Primary" Size="Size.Small" Indeterminate="true" /> |
81 | 88 | } |
82 | | - </MudText> |
| 89 | + </MudStack> |
| 90 | + |
| 91 | + @if (isFetching) |
| 92 | + { |
| 93 | + <MudProgressLinear Color="Color.Primary" Indeterminate="true" Class="mb-4" /> |
| 94 | + } |
| 95 | + else |
| 96 | + { |
| 97 | + <div style="height: 4px;" class="mb-4"></div> |
| 98 | + } |
83 | 99 |
|
84 | 100 | @* Book Grid *@ |
85 | 101 | <MudGrid Spacing="4" Class="mb-6"> |
|
210 | 226 | private ReactiveQuery<BookStore.Client.PagedListDtoOfBookDto>? bookQuery; |
211 | 227 | private BookStore.Client.PagedListDtoOfBookDto? pagedBooks => bookQuery?.Data; |
212 | 228 | private bool isLoading => bookQuery?.IsLoading ?? true; |
| 229 | + private bool isFetching => bookQuery?.IsFetching ?? false; |
213 | 230 | private string? errorMessage => bookQuery?.Error; |
214 | 231 |
|
215 | 232 | private string searchQuery = string.Empty; |
|
305 | 322 | currentPage = 1; |
306 | 323 | if (bookQuery != null) |
307 | 324 | { |
308 | | - await bookQuery.LoadAsync(); |
| 325 | + await bookQuery.LoadAsync(silent: true); |
309 | 326 | } |
310 | 327 | } |
311 | 328 |
|
|
320 | 337 | currentPage = page; |
321 | 338 | if (bookQuery != null) |
322 | 339 | { |
323 | | - await bookQuery.LoadAsync(); |
| 340 | + await bookQuery.LoadAsync(silent: true); |
324 | 341 | } |
325 | 342 | } |
326 | 343 |
|
|
0 commit comments