Added ArticleTileArray
This commit is contained in:
parent
4af471b48a
commit
1601e80dfb
10
Wave/Components/ArticleTileArray.razor
Normal file
10
Wave/Components/ArticleTileArray.razor
Normal file
|
@ -0,0 +1,10 @@
|
|||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-x-8 gap-y-4 mb-6" @attributes="AdditionalAttributes">
|
||||
@ChildContent
|
||||
</div>
|
||||
|
||||
@code {
|
||||
[Parameter]
|
||||
public required RenderFragment ChildContent { get; set; }
|
||||
[Parameter(CaptureUnmatchedValues = true)]
|
||||
public IDictionary<string, object>? AdditionalAttributes { get; set; }
|
||||
}
|
|
@ -8,14 +8,14 @@
|
|||
@inject UserManager<ApplicationUser> UserManager
|
||||
@inject IStringLocalizer<Drafts> Localizer
|
||||
|
||||
<div class="flex gap-x-8 gap-y-4">
|
||||
<ArticleTileArray>
|
||||
@foreach (var article in Articles) {
|
||||
<ArticleTile Article="article" />
|
||||
}
|
||||
@if (Articles.Count < 1) {
|
||||
<p>@Localizer["NoArticles"]</p>
|
||||
}
|
||||
</div>
|
||||
</ArticleTileArray>
|
||||
|
||||
@code {
|
||||
[CascadingParameter]
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
@page "/future"
|
||||
@using Wave.Data
|
||||
@using Microsoft.EntityFrameworkCore
|
||||
@using Wave.Data.Migrations.postgres
|
||||
|
||||
@attribute [Authorize(Policy = "ArticleDeletePermissions")]
|
||||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||
@inject IStringLocalizer<Future> Localizer
|
||||
|
||||
<div class="flex gap-x-8 gap-y-4">
|
||||
<ArticleTileArray>
|
||||
@foreach (var article in Articles) {
|
||||
<ArticleTile Article="article" />
|
||||
}
|
||||
@if(Articles.Count < 1) {
|
||||
<p>@Localizer["NoArticles"]</p>
|
||||
}
|
||||
</div>
|
||||
</ArticleTileArray>
|
||||
|
||||
@code {
|
||||
private List<Article> Articles { get; } = [];
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
<p>@Localizer["NoArticles_Message"]</p>
|
||||
}
|
||||
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 gap-x-8 gap-y-4 mb-6">
|
||||
@foreach (var article in Articles.Skip(1)) {
|
||||
<ArticleTile Article="article" />
|
||||
}
|
||||
</div>
|
||||
<ArticleTileArray>
|
||||
@foreach (var article in Articles.Skip(1)) {
|
||||
<ArticleTile Article="article" />
|
||||
}
|
||||
</ArticleTileArray>
|
||||
}
|
||||
|
||||
@if (HasMore) {
|
||||
|
|
|
@ -6,14 +6,14 @@
|
|||
@inject IDbContextFactory<ApplicationDbContext> ContextFactory
|
||||
@inject IStringLocalizer<Review> Localizer
|
||||
|
||||
<div class="flex gap-x-8 gap-y-4">
|
||||
<ArticleTileArray>
|
||||
@foreach (var article in Articles) {
|
||||
<ArticleTile Article="article" />
|
||||
}
|
||||
@if(Articles.Count < 1) {
|
||||
<p>@Localizer["NoArticles"]</p>
|
||||
}
|
||||
</div>
|
||||
</ArticleTileArray>
|
||||
|
||||
@code {
|
||||
private List<Article> Articles { get; } = [];
|
||||
|
|
Loading…
Reference in a new issue