From 4544d88a0896b0e43c534b585beb55ffde598bac Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Fri, 16 Dec 2022 11:55:52 +0100 Subject: [PATCH 1/2] merge --- .../BlazorApp/Components/InventoryComp.razor | 11 +++++------ .../Components/InventoryComp.razor.css | 19 ++++++++++++------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/BlazorApp/BlazorApp/Components/InventoryComp.razor b/BlazorApp/BlazorApp/Components/InventoryComp.razor index 7645f1c..5ed6408 100644 --- a/BlazorApp/BlazorApp/Components/InventoryComp.razor +++ b/BlazorApp/BlazorApp/Components/InventoryComp.razor @@ -37,12 +37,10 @@
- -
-
Available items:
+
Available items:
-
+
@@ -56,6 +54,7 @@ ShowPager Sortable="true"> + @@ -66,8 +65,8 @@
- -
+
+ diff --git a/BlazorApp/BlazorApp/Components/InventoryComp.razor.css b/BlazorApp/BlazorApp/Components/InventoryComp.razor.css index 901ab49..24a257c 100644 --- a/BlazorApp/BlazorApp/Components/InventoryComp.razor.css +++ b/BlazorApp/BlazorApp/Components/InventoryComp.razor.css @@ -1,16 +1,21 @@ -.css-grid { +.css-body { + flex: auto; + flex-direction: column; +} + + +.css-grid { grid-template-columns: repeat(6,minmax(0,1fr)); - gap: 75px; + grid-column-gap: 75px; + grid-row-gap: 5px; display: grid; width: 40%; + align-items: flex-start } -.css-recipe { - grid-template-columns: repeat(3,minmax(0,1fr)); - gap: 10px; - display: grid; - width: 212px; +.css-dataGrid { + align-items: flex-end, } From ca45d052a05c4b8ad033ad06b5d5f6a1ea5adf87 Mon Sep 17 00:00:00 2001 From: Thomas Chazot Date: Fri, 16 Dec 2022 11:54:17 +0100 Subject: [PATCH 2/2] =?UTF-8?q?sort=20qui=20marche=20meme=20pour=20la=20de?= =?UTF-8?q?rni=C3=A8re=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BlazorApp/BlazorApp/Services/DataApiService.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BlazorApp/BlazorApp/Services/DataApiService.cs b/BlazorApp/BlazorApp/Services/DataApiService.cs index 78f44de..5cb5fc3 100644 --- a/BlazorApp/BlazorApp/Services/DataApiService.cs +++ b/BlazorApp/BlazorApp/Services/DataApiService.cs @@ -61,6 +61,11 @@ namespace BlazorApp.Services { List it = await _http.GetFromJsonAsync>($"https://localhost:7234/api/Crafting/all/"); it = it.OrderBy(i => i.DisplayName).ToList(); + if ((currentPage - 1) * 10+ pageSize > it.Count) + { + int tmp = ((currentPage - 1) * 10 + pageSize) - it.Count; + return it.GetRange((currentPage - 1) * 10, pageSize - tmp); + } return it.GetRange((currentPage - 1) * 10, pageSize); }