feat: init usergroup linking to a course

This commit is contained in:
swve 2024-03-30 10:22:38 +00:00
parent a6152ef1f5
commit 4f75e6a90a
12 changed files with 428 additions and 55 deletions

View file

@ -116,10 +116,11 @@ function EditCourseGeneral(props: EditCourseStructureProps) {
message={formik.errors.description}
/>
<Form.Control asChild>
<Textarea
<Input
style={{ backgroundColor: 'white' }}
onChange={formik.handleChange}
value={formik.values.description}
type='text'
required
/>
</Form.Control>
@ -177,26 +178,7 @@ function EditCourseGeneral(props: EditCourseStructureProps) {
</Form.Control>
</FormField>
<FormField className="flex items-center h-10" name="public">
<div className="flex my-auto items-center">
<label
className="text-black text-[15px] leading-none pr-[15px]"
htmlFor="public-course"
>
Public Course
</label>
<Switch.Root
className="w-[42px] h-[25px] bg-neutral-200 rounded-full relative data-[state=checked]:bg-neutral-500 outline-none cursor-default"
id="public-course"
onCheckedChange={(checked) =>
formik.setFieldValue('public', checked)
}
checked={formik.values.public === 'true'}
>
<Switch.Thumb className="block w-[21px] h-[21px] bg-white rounded-full shadow-[0_2px_2px] shadow-neutral-300 transition-transform duration-100 translate-x-0.5 will-change-transform data-[state=checked]:translate-x-[19px]" />
</Switch.Root>
</div>
</FormField>
</FormLayout>
</div>
)}

View file

@ -46,18 +46,17 @@ function ThumbnailUpdate() {
{localThumbnail ? (
<img
src={URL.createObjectURL(localThumbnail)}
className={`${
isLoading ? 'animate-pulse' : ''
} shadow w-[200px] h-[100px] rounded-md`}
className={`${isLoading ? 'animate-pulse' : ''
} shadow w-[200px] h-[100px] rounded-md`}
/>
) : (
<img
src={`${getCourseThumbnailMediaDirectory(
src={`${course.courseStructure.thumbnail_image ? getCourseThumbnailMediaDirectory(
org?.org_uuid,
course.courseStructure.course_uuid,
course.courseStructure.thumbnail_image
)}`}
className="shadow w-[200px] h-[100px] rounded-md"
) : '/empty_thumbnail.png'}`}
className="shadow w-[200px] h-[100px] rounded-md bg-gray-200"
/>
)}
</div>