diff --git a/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx b/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx index 81374057..54624707 100644 --- a/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx +++ b/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx @@ -88,7 +88,7 @@ function ActivityElement(props: ActivitiyElementProps) { modifiedActivity?.activityId === activityId && selectedActivity !== undefined ) { - setSelectedActivity(undefined) + let modifiedActivityCopy = { ...props.activity, name: modifiedActivity.activityName, @@ -99,6 +99,7 @@ function ActivityElement(props: ActivitiyElementProps) { await revalidateTags(['courses'], props.orgslug) router.refresh() } + setSelectedActivity(undefined) } return ( @@ -109,7 +110,7 @@ function ActivityElement(props: ActivitiyElementProps) { > {(provided, snapshot) => (
updateActivityName(props.activity.id)} + size={12} />
@@ -153,68 +153,69 @@ function ActivityElement(props: ActivitiyElementProps) { )} setSelectedActivity(props.activity.id)} - size={12} - className="text-neutral-400 hover:cursor-pointer" + className="text-neutral-400 hover:cursor-pointer size-3 min-w-3" /> {/* Edit and View Button */} -
- - {/* Publishing */} -
changePublicStatus()} - > - {!props.activity.published ? ( - - ) : ( - - )} - {!props.activity.published ? 'Publish' : 'Unpublish'} +
+
+ + {/* Publishing */} +
changePublicStatus()} + > + {!props.activity.published ? ( + + ) : ( + + )} + {!props.activity.published ? 'Publish' : 'Unpublish'} +
+ + + Preview + +
+ {/* Delete Button */} +
+ + + +
+ } + functionToExecute={() => deleteActivityUI()} + status="warning" + >
- - - Preview - -
- {/* Delete Button */} -
- - - -
- } - functionToExecute={() => deleteActivityUI()} - status="warning" - >
)} @@ -222,53 +223,36 @@ function ActivityElement(props: ActivitiyElementProps) { ) } -const ActivityTypeIndicator = (props: { activityType: string }) => { +const ACTIVITIES = { + 'TYPE_VIDEO': { + displayName: 'Video', + Icon: Video + }, + 'TYPE_DOCUMENT': { + displayName: 'Document', + Icon: File + }, + 'TYPE_ASSIGNMENT': { + displayName: 'Assignment', + Icon: Backpack + }, + 'TYPE_DYNAMIC': { + displayName: 'Dynamic', + Icon: Sparkles + } +} + +const ActivityTypeIndicator = ({activityType} : { activityType: keyof typeof ACTIVITIES}) => { + const {displayName, Icon} = ACTIVITIES[activityType] + return ( -
- {props.activityType === 'TYPE_VIDEO' && ( - <> -
-