@@ -59,6 +59,7 @@ export default function Post({
5959 combineLatest ( [ isUserTeam$ , isUserMember$ , isUserCourseSub$ ] )
6060 . pipe ( take ( 1 ) )
6161 . subscribe ( ( c ) => {
62+ console . log ( c ) ;
6263 setMember ( c . includes ( true ) ) ;
6364 } ) ;
6465 }
@@ -67,33 +68,6 @@ export default function Post({
6768 const content = source ? hydrate ( source ) : null ;
6869 return (
6970 < Layout site = { site } >
70- { /* Could not see where this was used. */ }
71- { /* <div
72- className={`${
73- showMustSignin ? 'block' : 'hidden'
74- } fixed inset-0 z-50 overflow-hidden bg-primary-100 bg-opacity-80`}
75- >
76- <section
77- className="absolute inset-y-0 left-0 grid w-full h-full place-items-center justify-items-center"
78- aria-labelledby="slide-over-heading"
79- >
80- <OutsideClick toggle={setShowMustSignin} value={false}>
81- <section className="flex items-center p-8 m-auto space-x-20 space-between bg-primary-900 dark:bg-primary-50 rounded-xl">
82- <div className="grid gap-4 text-2xl text-primary-50 dark:text-primary-900">
83- <div>Please Sign in First.</div>
84- <Link href="/membership">
85- <a>
86- <button className="btn-secondary">Sign In</button>
87- </a>
88- </Link>
89- <div>
90- Then you can purchase courses directly, or become a member.
91- </div>
92- </div>
93- </section>
94- </OutsideClick>
95- </section>
96- </div> */ }
9771 < section className = "top-0 z-10 grid 2xl:sticky" >
9872 < BreakBarLeft >
9973 < div className = "grid w-full gap-4 " >
@@ -198,20 +172,25 @@ export default function Post({
198172 ) }
199173 < div className = "grid grid-cols-1 gap-2 p-4 justify-items-center" >
200174 { member ? (
201- // start course with link instead of telling user to go down on a page?
202175 < >
203- { post . sections && (
204- // not sure if this will get the correct slug, I think going to the first lesson here is better UX.
205- < >
206- { /* <Link
207- href={`/course/${post.sections[0].lessons[0].slug}/lesson/1` }
208- >
209- <a>
210- <button className="btn-primary">Start Course</button>
211- </a>
212- </Link> */ }
213- </ >
214- ) }
176+ { post . sections &&
177+ post . sections . map ( ( section , i ) => {
178+ return (
179+ < >
180+ { section . lessons && (
181+ < Link
182+ href = { `/course/${ post . slug } /lesson/${ section . lessons [ 0 ] . slug } ` }
183+ >
184+ < a >
185+ < button className = "btn-primary" >
186+ Start Course
187+ </ button >
188+ </ a >
189+ </ Link >
190+ ) }
191+ </ >
192+ ) ;
193+ } ) }
215194 </ >
216195 ) : (
217196 < >
0 commit comments