Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide the filter input if there are no videos to filter #145

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions src/routes/list/[id]/+layout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -66,21 +66,23 @@
<ProgressRadial class="ml-2 h-8 w-8" stroke={100} />
</span>
{:then videos}
<div class="my-4">
<label class="label">
<span>{$LL.labels.filter()}</span>
<input on:input={updateFilter} class="input" />
</label>
</div>
<div
data-testid="video-list"
class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{#each filterVideos(videos, filter) as video}
<YouTubeVideoEmbed
active={$page.params.videoid === video.videoId}
locale={data.locale}
{video} />
{/each}
</div>
{#if data.list.items.length > 0 && videos.length > 0}
<div class="my-4">
<label class="label">
<span>{$LL.labels.filter()}</span>
<input on:input={updateFilter} class="input" />
</label>
</div>
<div
data-testid="video-list"
class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
{#each filterVideos(videos, filter) as video}
<YouTubeVideoEmbed
active={$page.params.videoid === video.videoId}
locale={data.locale}
{video} />
{/each}
</div>
{/if}
{/await}
</div>
Loading