Skip to content

Commit 5612bc2

Browse files
committed
In AssetList put pagination alongside the heading
1 parent 1b2f7de commit 5612bc2

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/lib/AssetList.svelte

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import { loadRHInventoryAssetData } from '$src/lib/rhinventory_api';
44
import AssetListPagination from "./AssetListPagination.svelte";
55
6-
let props: { assetTagId: number } = $props();
6+
let props: { withHeading?: boolean, assetTagId: number } = $props();
77
88
let assetPage = $state(1);
99
let assetsDataPromise = $derived(loadRHInventoryAssetData({tagId: props.assetTagId, page: assetPage}))
@@ -18,7 +18,12 @@
1818
</script>
1919

2020
<div id="assetList" class="assets">
21-
<AssetListPagination bind:assetPage bind:assetCount />
21+
<div style="display: flex; justify-content: space-between;">
22+
{#if props.withHeading}
23+
<h3 id="Predmety">Předměty</h3>
24+
{/if}
25+
<AssetListPagination bind:assetPage bind:assetCount />
26+
</div>
2227
{#await assetsDataPromise }
2328
<!-- TODO placeholder AssetBoxes -->
2429
<p><em>Načítá se...</em></p>

src/lib/AssetListPagination.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,10 @@
2828
.pagination {
2929
display: flex;
3030
justify-content: flex-end;
31+
align-items: center;
32+
}
33+
34+
button {
35+
height: auto;
3136
}
3237
</style>

src/routes/projects/atari-klub-citov/+page.svelte

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@
3939
<InterviewBox {data}/>
4040
{/each}
4141

42-
<h3 id="Predmety">Předměty</h3>
43-
<AssetList assetTagId={16} />
42+
<AssetList withHeading=true assetTagId={16} />
4443

4544
<!-- <h3>Články</h3>
4645
<p><em>Sem přijdou případné články.</em> -->

0 commit comments

Comments
 (0)