From bc5651905e63d18559b9fd69680384942ecd98b6 Mon Sep 17 00:00:00 2001 From: Mr <37304121+IRHM@users.noreply.github.com> Date: Sun, 1 Dec 2024 23:05:13 +0000 Subject: [PATCH] person: show message when no credits to show (#705) * person: show message when no credits to show also hides filters when no credits, since they don't do anything in that case. * person: remove unused css selector --- src/routes/(app)/person/[id]/+page.svelte | 76 +++++++++++++++-------- 1 file changed, 50 insertions(+), 26 deletions(-) diff --git a/src/routes/(app)/person/[id]/+page.svelte b/src/routes/(app)/person/[id]/+page.svelte index 44502b7b..c9f27c65 100644 --- a/src/routes/(app)/person/[id]/+page.svelte +++ b/src/routes/(app)/person/[id]/+page.svelte @@ -12,6 +12,7 @@ import axios from "axios"; import { onMount } from "svelte"; import Checkbox from "@/lib/Checkbox.svelte"; + import Icon from "@/lib/Icon.svelte"; export let data; @@ -71,7 +72,6 @@ function sortCredits(sortOption: string) { if (!credits || !credits.cast) return; - switch (sortOption) { case "Vote count": credits.cast.sort((a, b) => b.vote_count - a.vote_count); @@ -172,32 +172,40 @@ -
-
- On my list - -
- -
{#if credits} -
- - {#each credits.cast as c (c.id)} - - {/each} - -
+ {#if credits?.cast?.length > 0} +
+
+ On my list + +
+ +
+
+ + {#each credits.cast as c (c.id)} + + {/each} + +
+ {:else} +
+ +

We found no credits!

+

It seems that this person has no credits.

+
+ {/if} {:else} {/if} @@ -336,4 +344,20 @@ gap: 30px; padding: 10px 0px; } + + .no-credits-message { + display: flex; + flex-flow: column; + gap: 5px; + align-items: center; + margin-top: 20px; + + h2 { + margin-top: 10px; + } + + h4 { + font-weight: normal; + } + }