Skip to content

Commit

Permalink
feat: only show optional deps table when they exist
Browse files Browse the repository at this point in the history
  • Loading branch information
budak7273 committed Jun 20, 2024
1 parent 91bb930 commit 61ee5fd
Showing 1 changed file with 15 additions and 18 deletions.
33 changes: 15 additions & 18 deletions src/lib/components/versions/VersionDependenciesGrid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<td><div class="text-center">Version Range</div></td>
</tr>
{#if requiredDependencies?.length === 0}
<!-- A mod *not* having required dependencies is rare, so point it out when this is the case -->
<tr class="rounded border !border-surface-500">
<td><div class="text-center">None</div></td>
<td><div class="text-center">N/A</div></td>
Expand All @@ -40,26 +41,22 @@
</table>
</div>

<div class="grid grid-flow-row">
<table aria-label="Mod Dependencies" class="max-w-auto table table-hover !overflow-visible">
<tbody>
<tr class="rounded border !border-surface-500">
<td
class="underline decoration-dotted"
title="Other mods that don't need to be installed for this mod to function, but may unlock additional functionality when present. You must chose to install them in the Mod Manager if you wish to use them."
>Optional Dependencies</td>
<td><div class="text-center">Version Range</div></td>
</tr>
{#if optionalDependencies?.length === 0}
<!-- Optional dependencies are uncommon as of now, so don't spend UI space on them unless there are any -->
{#if optionalDependencies?.length !== 0}
<div class="grid grid-flow-row">
<table aria-label="Mod Dependencies" class="max-w-auto table table-hover !overflow-visible">
<tbody>
<tr class="rounded border !border-surface-500">
<td><div class="text-center">None</div></td>
<td><div class="text-center">N/A</div></td>
<td
class="underline decoration-dotted"
title="Other mods that don't need to be installed for this mod to function, but may unlock additional functionality when present. You must chose to install them in the Mod Manager if you wish to use them."
>Optional Dependencies</td>
<td><div class="text-center">Version Range</div></td>
</tr>
{:else}
{#each optionalDependencies as dependency}
<DependencyRow {dependency} />
{/each}
{/if}
</tbody>
</table>
</div>
</tbody>
</table>
</div>
{/if}

0 comments on commit 61ee5fd

Please sign in to comment.