feat: make some courses inputs optional

This commit is contained in:
swve 2024-01-19 21:22:06 +01:00
parent 8ad2533058
commit 513d65704f
8 changed files with 40 additions and 15 deletions

View file

@ -111,16 +111,16 @@ function CreateCourseModal({ closeModal, orgslug }: any) {
<FormMessage match="valueMissing">Please provide a thumbnail for your course</FormMessage>
</Flex>
<Form.Control asChild>
<Input onChange={handleThumbnailChange} type="file" required />
<Input onChange={handleThumbnailChange} type="file" />
</Form.Control>
</FormField>
<FormField name="course-tags">
<Flex css={{ alignItems: 'baseline', justifyContent: 'space-between' }}>
<FormLabel>Course tags (separated by comma)</FormLabel>
<FormLabel>Course Learnings (separated by comma)</FormLabel>
<FormMessage match="valueMissing">Please provide learning elements, separated by comma (,)</FormMessage>
</Flex>
<Form.Control asChild>
<Textarea onChange={handleTagsChange} required />
<Textarea onChange={handleTagsChange} />
</Form.Control>
</FormField>
<FormField name="course-visibility">

View file

@ -41,9 +41,10 @@ function CourseThumbnail(props: PropsType) {
<div className='relative'>
<AdminEditsArea course={props.course} orgSlug={props.orgslug} courseId={props.course.course_uuid} deleteCourses={deleteCourses} />
<Link href={getUriWithOrg(props.orgslug, "/course/" + removeCoursePrefix(props.course.course_uuid))}>
<div className="inset-0 ring-1 ring-inset ring-black/10 rounded-xl shadow-xl w-[249px] h-[131px] bg-cover" style={{ backgroundImage: `url(${getCourseThumbnailMediaDirectory(org?.org_uuid, props.course.course_uuid, props.course.thumbnail_image)})` }}>
</div>
{props.course.thumbnail_image ? <div className="inset-0 ring-1 ring-inset ring-black/10 rounded-xl shadow-xl w-[249px] h-[131px] bg-cover" style={{ backgroundImage: `url(${getCourseThumbnailMediaDirectory(org?.org_uuid, props.course.course_uuid, props.course.thumbnail_image)})` }} />
: <div className="inset-0 ring-1 ring-inset ring-black/10 rounded-xl shadow-xl w-[249px] h-[131px] bg-cover" style={{ backgroundImage: `url('../empty_thumbnail.png')` , backgroundSize:'contain' }} />}
</Link>
<h2 className="font-bold text-lg w-[250px] py-2">{props.course.name}</h2>
</div>