diff --git a/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/activity/[activityid]/activity.tsx b/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/activity/[activityid]/activity.tsx index b7f70ecc..e665561c 100644 --- a/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/activity/[activityid]/activity.tsx +++ b/apps/web/app/orgs/[orgslug]/(withmenu)/course/[courseuuid]/activity/[activityid]/activity.tsx @@ -29,6 +29,9 @@ import { useMediaQuery } from 'usehooks-ts' import PaidCourseActivityDisclaimer from '@components/Objects/Courses/CourseActions/PaidCourseActivityDisclaimer' import { useContributorStatus } from '../../../../../../../../hooks/useContributorStatus' import ToolTip from '@components/Objects/StyledElements/Tooltip/Tooltip' +import ActivityNavigation from '@components/Dashboard/Pages/Activity/ActivityNavigation' +import ActivityChapterDropdown from '@components/Dashboard/Pages/Activity/ActivityChapterDropdown' +import FixedActivitySecondaryBar from '@components/Dashboard/Pages/Activity/FixedActivitySecondaryBar' interface ActivityClientProps { activityid: string @@ -92,158 +95,167 @@ function ActivityClient(props: ActivityClientProps) { -
-
-
-
- - - -
-
-

Course

-

- {course.name} -

-
-
-
- - -
-
- -
-

- Chapter : {getChapterNameByActivityId(course, activity.id)} -

-

- {activity.name} -

-
-
-
- {activity && activity.published == true && activity.content.paid_access != false && ( - - {activity.activity_type != 'TYPE_ASSIGNMENT' && - <> - - {contributorStatus === 'ACTIVE' && activity.activity_type == 'TYPE_DYNAMIC' && ( - - - Contribute to Activity - - )} - - + + +
+
+
+
+
+ + - - } - {activity.activity_type == 'TYPE_ASSIGNMENT' && - <> - - - - - - } - - )} -
-
- {activity && activity.published == false && ( -
-
-

- This activity is not published yet -

-
-
- )} - - {activity && activity.published == true && ( - <> - {activity.content.paid_access == false ? ( - - ) : ( -
- {/* Activity Types */} -
- {activity.activity_type == 'TYPE_DYNAMIC' && ( - - )} - {activity.activity_type == 'TYPE_VIDEO' && ( - - )} - {activity.activity_type == 'TYPE_DOCUMENT' && ( - - )} - {activity.activity_type == 'TYPE_ASSIGNMENT' && ( -
- {assignment ? ( - - - - - - - - ) : ( -
- )} -
- )} + +
+
+

Course

+

+ {course.name} +

- )} - - )} +
+ + + +
+
+ +
+

+ Chapter : {getChapterNameByActivityId(course, activity.id)} +

+

+ {activity.name} +

+
+
+
+ {activity && activity.published == true && activity.content.paid_access != false && ( + + {activity.activity_type != 'TYPE_ASSIGNMENT' && ( + <> + + {contributorStatus === 'ACTIVE' && activity.activity_type == 'TYPE_DYNAMIC' && ( + + + Contribute to Activity + + )} + + + + )} + {activity.activity_type == 'TYPE_ASSIGNMENT' && ( + <> + + + + + + )} + + )} +
+
+
+ {activity && activity.published == false && ( +
+
+

+ This activity is not published yet +

+
+
+ )} + + {activity && activity.published == true && ( + <> + {activity.content.paid_access == false ? ( + + ) : ( +
+ {/* Activity Types */} +
+ {activity.activity_type == 'TYPE_DYNAMIC' && ( + + )} + {activity.activity_type == 'TYPE_VIDEO' && ( + + )} + {activity.activity_type == 'TYPE_DOCUMENT' && ( + + )} + {activity.activity_type == 'TYPE_ASSIGNMENT' && ( +
+ {assignment ? ( + + + + + + + + ) : ( +
+ )} +
+ )} +
+
+ )} + + )} - {/* Activity Navigation */} - {activity && activity.published == true && activity.content.paid_access != false && ( - - )} - - {
} + + {/* Fixed Activity Secondary Bar */} + {activity && activity.published == true && activity.content.paid_access != false && ( + + )} + +
+
@@ -485,335 +497,4 @@ function AssignmentTools(props: { return null } -function ActivityChapterDropdown(props: { - course: any - currentActivityId: string - orgslug: string -}): React.ReactNode { - const [isOpen, setIsOpen] = React.useState(false); - const dropdownRef = React.useRef(null); - const isMobile = useMediaQuery('(max-width: 768px)'); - - // Close dropdown when clicking outside - React.useEffect(() => { - function handleClickOutside(event: MouseEvent) { - if (dropdownRef.current && !dropdownRef.current.contains(event.target as Node)) { - setIsOpen(false); - } - } - document.addEventListener('mousedown', handleClickOutside); - return () => { - document.removeEventListener('mousedown', handleClickOutside); - }; - }, []); - - const toggleDropdown = () => { - setIsOpen(!isOpen); - }; - - // Function to get the appropriate icon for activity type - const getActivityTypeIcon = (activityType: string) => { - switch (activityType) { - case 'TYPE_VIDEO': - return