@@ -60,7 +60,7 @@ export default function Course({
60
60
</ >
61
61
) }
62
62
< BreakBarLeft >
63
- < div className = "grid w-full gap-4 " >
63
+ < div className = "grid w-full gap-4" >
64
64
< section className = "grid items-center justify-between gap-2 lg:flex" >
65
65
< h1 className = "font-sans text-5xl lg:flex-1 sm:text-4xl text-basics-50 dark:text-basics-50" >
66
66
{ post . title }
@@ -134,121 +134,115 @@ export default function Course({
134
134
</ BreakBarLeft >
135
135
</ section >
136
136
< div className = "grid grid-cols-1 gap-4 px-4 pb-4 lg:px-10 lg:pb-10 lg:grid-cols-sidebar" >
137
- < section >
137
+ < section className = "max-w-2xl flex flex-col gap-4" >
138
138
< PostMedia post = { post } noImage = { true } />
139
- < div className = "mt-2" >
139
+ < div className = "mt-2 flex flex-col gap-2 " >
140
140
{ source && < MDXRemote { ...source } components = { components } /> }
141
141
</ div >
142
- </ section >
143
- < section className = "flex flex-col mb-2" >
144
142
{ post . _type === PostType . course && (
145
- < div className = "" >
146
- { post . coverPhoto ?. public_id ? (
147
- < >
148
- < Image
149
- src = { post . coverPhoto ?. public_id }
150
- alt = { post . title }
151
- width = "480"
152
- height = "270"
153
- layout = "responsive"
154
- className = "rounded-md rounded-b-none cursor-pointer"
155
- />
156
- </ >
157
- ) : (
158
- < div className = "relative" style = { { paddingBottom : '56.25%' } } >
159
- < div className = "absolute flex items-center flex-auto w-full h-full rounded-t-md bg-primary-900 dark:bg-primary-900" >
160
- < AJPrimary className = "w-full h-full p-4" />
161
- </ div >
162
- </ div >
163
- ) }
143
+ < div >
164
144
{ signInCheckResult ?. user ? (
165
- < div className = "grid grid-cols-1 gap-2 p-4 justify-items-center" >
166
- < CourseBuyButton
167
- product = { product }
168
- user = { signInCheckResult . user }
169
- post = { post }
170
- />
171
- </ div >
145
+ < CourseBuyButton
146
+ product = { product }
147
+ user = { signInCheckResult . user }
148
+ post = { post }
149
+ />
172
150
) : (
173
- < div className = "grid grid-cols-1 gap-2 p-4 justify-items-center" >
174
- < Link href = "/user/profile" >
175
- < a className = "border-none" >
176
- < button className = "btn-primary" > Membership Login</ button >
177
- </ a >
178
- </ Link >
179
- </ div >
151
+ < Link href = "/user/profile" >
152
+ < a className = "border-none" >
153
+ < button className = "btn-primary" > Membership Login</ button >
154
+ </ a >
155
+ </ Link >
180
156
) }
181
157
</ div >
182
158
) }
183
- < section >
184
- < div className = "flex items-center justify-between p-4 mb-2 bg-primary-900 dark:bg-primary-900 text-basics-50 dark:text-basics-50 rounded-t-md" >
185
- < h2 className = "text-xl" > Course Content</ h2 >
186
- { /* Beginner/Intermediate/Advanced descriptor */ }
187
- < p className = "p-2 text-base rounded-full text-basics-50 dark:text-basics-50 bg-secondary-600 dark:bg-secondary-600" >
188
- Beginner
189
- </ p >
159
+ </ section >
160
+ < section className = "flex flex-col mb-2" >
161
+ { post . coverPhoto ?. public_id ? (
162
+ < >
163
+ < Image
164
+ src = { post . coverPhoto ?. public_id }
165
+ alt = { post . title }
166
+ width = "480"
167
+ height = "270"
168
+ layout = "responsive"
169
+ className = "rounded-md rounded-b-none cursor-pointer"
170
+ />
171
+ </ >
172
+ ) : (
173
+ < div className = "relative" style = { { paddingBottom : '56.25%' } } >
174
+ < div className = "absolute flex items-center flex-auto w-full h-full rounded-t-md bg-primary-900 dark:bg-primary-900" >
175
+ < AJPrimary className = "w-full h-full p-4" />
176
+ </ div >
190
177
</ div >
191
- { /* LESSONS */ }
192
- { post && post . sections && (
193
- < section className = "grid content-start grid-cols-1 row-start-2 gap-4 2xl:col-start-2 2xl:row-start-1" >
194
- { post . sections . map ( ( section ) => (
195
- < section
196
- key = { section . _key }
197
- className = "flex flex-col rounded-t-md"
198
- >
199
- < div className = "p-2 m-0 text-2xl font-bold xl:p-4 rounded-t-md xl:flex-shrink-0 bg-secondary-600 dark:bg-secondary-600 text-basics-50 dark:text-basics-50" >
200
- { section . title }
201
- </ div >
202
- < ul className = "flex flex-col flex-grow rounded-b rounded-tr bg-basics-50 justify-items-stretch" >
203
- { section . lessons &&
204
- section . lessons . map ( ( lesson ) => (
205
- < li key = { lesson . _id } className = "ml-0 list-none" >
206
- < Link
207
- href = { `/course/${ post . slug } /lesson/${ lesson . slug } ` }
208
- key = { lesson . _id }
209
- passHref
210
- >
211
- < div
212
- className = { `p-2 cursor-pointer hover:bg-primary-200 rounded m-1 flex flex-wrap justify-between
178
+ ) }
179
+ < div className = "flex items-center justify-between p-4 mb-2 bg-primary-900 dark:bg-primary-900 text-basics-50 dark:text-basics-50 rounded-t-md" >
180
+ < h2 className = "text-xl" > Course Content</ h2 >
181
+ { /* Beginner/Intermediate/Advanced descriptor */ }
182
+ < p className = "p-2 text-base rounded-full text-basics-50 dark:text-basics-50 bg-secondary-600 dark:bg-secondary-600" >
183
+ Beginner
184
+ </ p >
185
+ </ div >
186
+ { /* LESSONS */ }
187
+ { post && post . sections && (
188
+ < section className = "grid content-start grid-cols-1 row-start-2 gap-4 2xl:col-start-2 2xl:row-start-1" >
189
+ { post . sections . map ( ( section ) => (
190
+ < section
191
+ key = { section . _key }
192
+ className = "flex flex-col rounded-t-md"
193
+ >
194
+ < div className = "p-2 m-0 text-2xl font-bold xl:p-4 rounded-t-md xl:flex-shrink-0 bg-secondary-600 dark:bg-secondary-600 text-basics-50 dark:text-basics-50" >
195
+ { section . title }
196
+ </ div >
197
+ < ul className = "flex flex-col flex-grow rounded-b rounded-tr bg-basics-50 justify-items-stretch" >
198
+ { section . lessons &&
199
+ section . lessons . map ( ( lesson ) => (
200
+ < li key = { lesson . _id } className = "ml-0 list-none" >
201
+ < Link
202
+ href = { `/course/${ post . slug } /lesson/${ lesson . slug } ` }
203
+ key = { lesson . _id }
204
+ passHref
205
+ >
206
+ < div
207
+ className = { `p-2 cursor-pointer hover:bg-primary-200 rounded m-1 flex flex-wrap justify-between
213
208
${
214
209
isActiveLink ( post , lesson )
215
210
? 'bg-primary-200'
216
211
: 'bg-transparent'
217
212
}
218
213
` }
219
- >
220
- < a className = "no-underline text-basics-900 hover:text-primary-900" >
221
- { lesson . title }
222
- </ a >
223
- { lesson ?. accessSettings ?. accessMode && (
224
- < div className = "no-underline text-basics-900 hover:text-primary-900" >
225
- { lesson ?. accessSettings ?. accessMode !=
226
- AccessMode . free && (
227
- < svg
228
- xmlns = "http://www.w3.org/2000/svg"
229
- className = "w-5 h-5"
230
- viewBox = "0 0 20 20"
231
- fill = "currentColor"
232
- >
233
- < path
234
- fillRule = "evenodd"
235
- d = "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"
236
- clipRule = "evenodd"
237
- />
238
- </ svg >
239
- ) }
240
- </ div >
241
- ) }
242
- </ div >
243
- </ Link >
244
- </ li >
245
- ) ) }
246
- </ ul >
247
- </ section >
248
- ) ) }
249
- </ section >
250
- ) }
251
- </ section >
214
+ >
215
+ < a className = "no-underline text-basics-900 hover:text-primary-900" >
216
+ { lesson . title }
217
+ </ a >
218
+ { lesson ?. accessSettings ?. accessMode && (
219
+ < div className = "no-underline text-basics-900 hover:text-primary-900" >
220
+ { lesson ?. accessSettings ?. accessMode !=
221
+ AccessMode . free && (
222
+ < svg
223
+ xmlns = "http://www.w3.org/2000/svg"
224
+ className = "w-5 h-5"
225
+ viewBox = "0 0 20 20"
226
+ fill = "currentColor"
227
+ >
228
+ < path
229
+ fillRule = "evenodd"
230
+ d = "M5 9V7a5 5 0 0110 0v2a2 2 0 012 2v5a2 2 0 01-2 2H5a2 2 0 01-2-2v-5a2 2 0 012-2zm8-2v2H7V7a3 3 0 016 0z"
231
+ clipRule = "evenodd"
232
+ />
233
+ </ svg >
234
+ ) }
235
+ </ div >
236
+ ) }
237
+ </ div >
238
+ </ Link >
239
+ </ li >
240
+ ) ) }
241
+ </ ul >
242
+ </ section >
243
+ ) ) }
244
+ </ section >
245
+ ) }
252
246
</ section >
253
247
</ div >
254
248
< style global jsx > { `
@@ -264,7 +258,7 @@ export default function Course({
264
258
article > p + blockquote {
265
259
margin: 1rem 0;
266
260
}
267
- main a {
261
+ main a > :not(button) {
268
262
word-wrap: break-word;
269
263
border-bottom: 2px solid #bc2261;
270
264
}
0 commit comments