Skip to content

Commit 5f5cafe

Browse files
committed
update images for lessons
1 parent 799f2bc commit 5f5cafe

3 files changed

Lines changed: 36 additions & 17 deletions

File tree

‎apps/codingcatdev/src/routes/(content-single)/course/[slug]/Course.svelte‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</script>
1111

1212
{#if data?.course}
13-
<div class="flex flex-col justify-center !text-token p-1 xl:p-8 w-full items-center">
13+
<div class="flex flex-col justify-center !text-token p-2 md:p-4 xl:p-8 w-full items-center">
1414
<section class="justify-center flex flex-col gap-2 md:gap-8 max-w-7xl">
1515
<ol class="bcu-breadcrumb">
1616
<li class="bcu-crumb"><a href="/courses">Courses</a></li>

‎apps/codingcatdev/src/routes/(content-single)/course/[slug]/LessonCards.svelte‎

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import { Icon } from '@steeze-ui/svelte-icon';
44
import { LockClosed } from '@steeze-ui/heroicons';
55
import { LockOpen } from '@steeze-ui/heroicons';
6+
import Image from '$lib/components/content/Image.svelte';
67
78
export let lesson: Lesson[];
89
export let courseSlug: string;
@@ -13,22 +14,37 @@
1314
>
1415
{#each lesson as l}
1516
<a href={`/course/${courseSlug}/lesson/${l.slug}`} class="!no-underline !text-token">
16-
<div class="bcu-card h-full p-4">
17-
<header class="bcu-card-header capitalize py-6 text-2xl font-bold relative">
18-
<div class="w-6 absolute top-0 right-0">
19-
{#if l?.locked}
20-
<Icon src={LockClosed} theme="solid" />
21-
{:else}
22-
<Icon src={LockOpen} theme="solid" />
23-
{/if}
24-
</div>
25-
<div>
26-
{l.title}
27-
</div>
28-
</header>
29-
<p class="p-4 !opacity-80">
30-
{l?.excerpt || 'More info in course.'}
31-
</p>
17+
<div class="bcu-card h-full">
18+
{#if l?.cover}
19+
<Image
20+
src={l.cover}
21+
alt={l.title || 'Missing Alt Sorry'}
22+
classes="rounded-md rounded-b-none cursor-pointer"
23+
/>
24+
{:else}
25+
<Image
26+
src="https://media.codingcat.dev/image/upload/dev-codingcatdev-photo/v60h88eohd7ufghkspgo"
27+
alt={l.title || 'Missing Alt Sorry'}
28+
classes="rounded-md rounded-b-none cursor-pointer"
29+
/>
30+
{/if}
31+
<div class="p-4">
32+
<header class="bcu-card-header capitalize py-6 text-2xl font-bold relative">
33+
<div class="w-6 absolute top-0 right-0">
34+
{#if l?.locked}
35+
<Icon src={LockClosed} theme="solid" />
36+
{:else}
37+
<Icon src={LockOpen} theme="solid" />
38+
{/if}
39+
</div>
40+
<div>
41+
{l.title}
42+
</div>
43+
</header>
44+
<p class="p-4 !opacity-80">
45+
{l?.excerpt || 'More info in course.'}
46+
</p>
47+
</div>
3248
</div>
3349
</a>
3450
{/each}

‎apps/codingcatdev/src/routes/(content-single)/course/[slug]/lesson/[lessonSlug]/Lesson.svelte‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import type { Lesson, Course } from '$lib/types';
55
import { browser } from '$app/environment';
66
import CopyCodeInjector from '$lib/components/content/CopyCodeInjector.svelte';
7+
import CloudinaryImage from '$lib/components/content/CloudinaryImage.svelte';
78
export let data: {
89
course: Course;
910
content: Lesson;
@@ -32,6 +33,8 @@
3233
}
3334
]}
3435
/>
36+
{:else if data?.content?.cover}
37+
<CloudinaryImage src={data.content.cover} alt={data.content.title} />
3538
{/if}
3639
{#if data?.content?.title}
3740
<h1>{data?.content?.title}</h1>

0 commit comments

Comments
 (0)