File tree Expand file tree Collapse file tree
apps/codingcatdev/src/routes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<script lang =" ts" >
22 import Image from ' $lib/components/content/Image.svelte' ;
3- import type { Content , ContentType } from ' $lib/types' ;
4-
5- export let data: { contentType: ContentType ; content: Content []; next? : any };
3+ import type { Content , Course } from ' $lib/types' ;
4+ import { ContentType } from ' $lib/types ' ;
5+ export let data: { contentType: ContentType ; content: Content [] & Course [] ; next? : any };
66
77 let next = data .next ;
88 const contentType = data .contentType ;
4848 classes =" object-cover w-full bg-cover rounded bg-black/50 aspect-video rounded-md rounded-b-none cursor-pointer"
4949 />
5050 {/if }
51-
5251 <section class =" grid h-full grid-cols-1 gap-2 p-4" >
5352 <div class =" space-y-2" >
53+ {#if contentType === ContentType .course }
54+ {#if content ?.lesson ?.filter ((l ) => l .locked ).length }
55+ <span class =" chip variant-filled-primary py-1 px-4 rounded-full text-sm"
56+ >Pro</span
57+ >
58+ {:else }
59+ <span class =" chip variant-ringed py-1 px-4 rounded-full text-sm" >Free</span >
60+ {/if }
61+ {/if }
5462 <h3 class =" font-sans text-lg tracking-wide text-bold" >
5563 {content .title }
5664 </h3 >
5765 {#if content ?.excerpt }
58- <p class ="text-sm font-hairline " >{content .excerpt }</p >
66+ <p class ="text-sm font-hairline" >{content .excerpt }</p >
5967 {/if }
6068 </div >
6169 </section >
Original file line number Diff line number Diff line change 4444 {/each }
4545 </section >
4646 {/if }
47+ <div class =" flex" >
48+ {#if data ?.course ?.lesson ?.filter ((l ) => l .locked ).length }
49+ <span class =" chip variant-filled-primary py-1 px-4 rounded-full font-bold text-xl"
50+ >Pro</span
51+ >
52+ {:else }
53+ <span class =" chip variant-ringed py-1 px-4 rounded-full font-bold text-xl" >Free</span >
54+ {/if }
55+ </div >
4756 <h1 >{data .course .title }</h1 >
4857 <!-- Sponsors -->
4958 {#if data ?.sponsors ?.length }
You can’t perform that action at this time.
0 commit comments