Skip to content

Commit 400cd74

Browse files
committed
fix: curated collections ui tweak
1 parent 4b74118 commit 400cd74

File tree

2 files changed

+25
-19
lines changed

2 files changed

+25
-19
lines changed

admin/inertia/pages/settings/maps.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,30 @@ export default function MapsManager(props: {
191191
>
192192
Download Custom Map File
193193
</StyledButton>
194-
<StyledButton
195-
onClick={() => fetchLatestCollections.mutate()}
196-
disabled={fetchLatestCollections.isPending}
197-
icon="CloudArrowDownIcon"
198-
>
199-
Fetch Latest Collections
200-
</StyledButton>
201194
</div>
202195
</div>
203196
{!props.maps.baseAssetsExist && (
204197
<MissingBaseAssetsAlert loading={downloading} onClickDownload={downloadBaseAssets} />
205198
)}
206-
<StyledSectionHeader title="Curated Map Collections" className="mt-8 mb-4" />
207-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
199+
<StyledSectionHeader title="Curated Map Collections" className="mt-8 !mb-4" />
200+
<StyledButton
201+
onClick={() => fetchLatestCollections.mutate()}
202+
disabled={fetchLatestCollections.isPending}
203+
icon="CloudArrowDownIcon"
204+
>
205+
Fetch Latest Collections
206+
</StyledButton>
207+
<div className="!mt-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
208208
{curatedCollections?.map((collection) => (
209209
<CuratedCollectionCard
210210
key={collection.slug}
211211
collection={collection}
212212
onClick={(collection) => confirmDownload(collection)}
213213
/>
214214
))}
215+
{curatedCollections && curatedCollections.length === 0 && (
216+
<p className="text-gray-500">No curated collections available.</p>
217+
)}
215218
</div>
216219
<StyledSectionHeader title="Stored Map Files" className="mt-12 mb-4" />
217220
<StyledTable<FileEntry & { actions?: any }>

admin/inertia/pages/settings/zim/remote-explorer.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,6 @@ export default function ZimRemoteExplorer() {
198198
<h1 className="text-4xl font-semibold mb-2">ZIM Remote Explorer</h1>
199199
<p className="text-gray-500">Browse and download ZIM files for offline reading!</p>
200200
</div>
201-
<StyledButton
202-
onClick={() => fetchLatestCollections.mutate()}
203-
disabled={fetchLatestCollections.isPending}
204-
icon="CloudArrowDownIcon"
205-
>
206-
Fetch Latest Collections
207-
</StyledButton>
208201
</div>
209202
{!isOnline && (
210203
<Alert
@@ -223,16 +216,26 @@ export default function ZimRemoteExplorer() {
223216
className="!mt-6"
224217
/>
225218
)}
226-
<StyledSectionHeader title="Curated ZIM Collections" className="mt-8 mb-4" />
227-
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
219+
<StyledSectionHeader title="Curated ZIM Collections" className="mt-8 !mb-4" />
220+
<StyledButton
221+
onClick={() => fetchLatestCollections.mutate()}
222+
disabled={fetchLatestCollections.isPending}
223+
icon="CloudArrowDownIcon"
224+
>
225+
Fetch Latest Collections
226+
</StyledButton>
227+
<div className="mt-4 grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
228228
{curatedCollections?.map((collection) => (
229229
<CuratedCollectionCard
230230
key={collection.slug}
231231
collection={collection}
232232
onClick={(collection) => confirmDownload(collection)}
233-
size='large'
233+
size="large"
234234
/>
235235
))}
236+
{curatedCollections && curatedCollections.length === 0 && (
237+
<p className="text-gray-500">No curated collections available.</p>
238+
)}
236239
</div>
237240
<StyledSectionHeader title="Browse the Kiwix Library" className="mt-12 mb-4" />
238241
<div className="flex justify-start mt-4">

0 commit comments

Comments
 (0)