-
-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathBlogPostNavigation.razor
More file actions
20 lines (18 loc) · 934 Bytes
/
Copy pathBlogPostNavigation.razor
File metadata and controls
20 lines (18 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
@typeparam T
@using LinkDotNet.Blog.Infrastructure
<nav aria-label="Page navigation">
<ul class="pagination justify-content-center">
<li class="page-item @(!PageList.IsFirstPage && PageList.Count > 0 ? string.Empty : "disabled")">
<Anchor CssClass="page-link" Href="@PreviousPageLink">Previous</Anchor>
</li>
<li class="page-item @(!PageList.IsLastPage && PageList.Count > 0 ? string.Empty : "disabled")">
<Anchor CssClass="page-link" Href="@NextPageLink">Next</Anchor>
</li>
</ul>
</nav>
@code {
[Parameter, EditorRequired]
public required IPagedList<T> PageList { get; set; }
private string PreviousPageLink => PageList.IsFirstPage ? string.Empty : $"/{PageList.PageNumber - 1}#posts-header";
private string NextPageLink => PageList.IsLastPage ? string.Empty : $"/{PageList.PageNumber + 1}#posts-header";
}