Added ArticleTileArray

This commit is contained in:
Mia Rose Winter 2024-01-25 16:45:54 +01:00
parent 4af471b48a
commit 1601e80dfb
Signed by: miawinter
GPG key ID: 4B6F6A83178F595E
5 changed files with 21 additions and 12 deletions

View 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; }
}

View file

@ -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]

View file

@ -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; } = [];

View file

@ -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) {

View file

@ -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; } = [];