Skip to content

Commit 0234ac2

Browse files
CopilotargyleinkRobbieTheWagner
authored
Add no episodes placeholder (#39)
* Initial plan * Add no episodes placeholder to EpisodeList component Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com> * Use UFOIllustration for no episodes placeholder Co-authored-by: RobbieTheWagner <2640861+RobbieTheWagner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: argyleink <1134620+argyleink@users.noreply.github.com> Co-authored-by: RobbieTheWagner <2640861+RobbieTheWagner@users.noreply.github.com>
1 parent 77bb2f2 commit 0234ac2

File tree

1 file changed

+64
-51
lines changed

1 file changed

+64
-51
lines changed

src/components/EpisodeList.astro

Lines changed: 64 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
import FormattedDate from '../components/FormattedDate';
33
import FullPlayButton from '../components/FullPlayButton';
4+
import UFOIllustration from '../components/illustrations/UFOIllustration.astro';
45
import type { Episode, Show } from '../lib/rss';
56
import { dasherize } from '../utils/dasherize';
67
@@ -12,61 +13,73 @@ export interface Props {
1213
const { episodes, show } = Astro.props;
1314
---
1415

15-
<ul aria-label="EpisodeList">
16-
{
17-
episodes.map((episode) => {
18-
return (
19-
<li class="dark:border-dark-border border-b">
20-
<div class="flex w-full flex-col py-12 lg:flex-row">
21-
<img
22-
alt={`${episode.title} - episode art`}
23-
aria-hidden="true"
24-
class="mb-3 block h-20 w-20 rounded-md lg:mr-6"
25-
height={80}
26-
loading="lazy"
27-
src={episode.episodeThumbnail ?? show.image}
28-
width={80}
29-
/>
16+
{
17+
episodes.length === 0 ? (
18+
<div class="flex flex-col items-center">
19+
<div class="h-auto w-full max-w-80">
20+
<UFOIllustration />
21+
</div>
3022

31-
<div class="flex flex-col">
32-
<FormattedDate date={new Date(episode.published)} />
23+
<p class="text-light-text-heading py-10 text-lg font-bold dark:text-white">
24+
No episodes yet. Check back soon!
25+
</p>
26+
</div>
27+
) : (
28+
<ul aria-label="EpisodeList">
29+
{episodes.map((episode) => {
30+
return (
31+
<li class="dark:border-dark-border border-b">
32+
<div class="flex w-full flex-col py-12 lg:flex-row">
33+
<img
34+
alt={`${episode.title} - episode art`}
35+
aria-hidden="true"
36+
class="mb-3 block h-20 w-20 rounded-md lg:mr-6"
37+
height={80}
38+
loading="lazy"
39+
src={episode.episodeThumbnail ?? show.image}
40+
width={80}
41+
/>
3342

34-
<h2 class="text-light-text-heading my-2 text-lg font-bold dark:text-white">
35-
<a
36-
href={`/${episode.episodeSlug}`}
37-
style={
38-
'view-transition-name: var(--should-vt); --vt-name: vt-' +
39-
dasherize(episode.title)
40-
}
41-
>
42-
{episode.episodeNumber}: {episode.title}
43-
</a>
44-
</h2>
43+
<div class="flex flex-col">
44+
<FormattedDate date={new Date(episode.published)} />
4545

46-
<p class="mb-5">{episode.description}</p>
46+
<h2 class="text-light-text-heading my-2 text-lg font-bold dark:text-white">
47+
<a
48+
href={`/${episode.episodeSlug}`}
49+
style={
50+
'view-transition-name: var(--should-vt); --vt-name: vt-' +
51+
dasherize(episode.title)
52+
}
53+
>
54+
{episode.episodeNumber}: {episode.title}
55+
</a>
56+
</h2>
4757

48-
<div class="flex items-center gap-6 text-sm">
49-
<FullPlayButton
50-
client:visible
51-
episode={{
52-
audio: episode.audio,
53-
episodeNumber: episode.episodeNumber,
54-
id: episode.id,
55-
title: episode.title
56-
}}
57-
/>
58+
<p class="mb-5">{episode.description}</p>
5859

59-
<a
60-
class="text-light-text-heading font-bold dark:text-white"
61-
href={`/${episode.episodeSlug}`}
62-
>
63-
Show notes
64-
</a>
60+
<div class="flex items-center gap-6 text-sm">
61+
<FullPlayButton
62+
client:visible
63+
episode={{
64+
audio: episode.audio,
65+
episodeNumber: episode.episodeNumber,
66+
id: episode.id,
67+
title: episode.title
68+
}}
69+
/>
70+
71+
<a
72+
class="text-light-text-heading font-bold dark:text-white"
73+
href={`/${episode.episodeSlug}`}
74+
>
75+
Show notes
76+
</a>
77+
</div>
6578
</div>
6679
</div>
67-
</div>
68-
</li>
69-
);
70-
})
71-
}
72-
</ul>
80+
</li>
81+
);
82+
})}
83+
</ul>
84+
)
85+
}

0 commit comments

Comments
 (0)