From 9c2b14758291b60b74fb0b55d55b90799c2b66c9 Mon Sep 17 00:00:00 2001 From: Chris Holland Date: Sat, 19 Oct 2024 07:45:50 -0700 Subject: [PATCH] refactor: remove onclick on pencil and condense indicator --- .../DraggableElements/ActivityElement.tsx | 72 +++++++------------ 1 file changed, 27 insertions(+), 45 deletions(-) diff --git a/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx b/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx index 2792bdab..54624707 100644 --- a/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx +++ b/apps/web/components/Dashboard/Course/EditCourseStructure/DraggableElements/ActivityElement.tsx @@ -145,7 +145,6 @@ function ActivityElement(props: ActivitiyElementProps) { > updateActivityName(props.activity.id)} /> @@ -224,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' && ( - <> -
-