diff --git a/src/components/content/courses/CourseDetails.js b/src/components/content/courses/CourseDetails.js index 4c68642..e62fa20 100644 --- a/src/components/content/courses/CourseDetails.js +++ b/src/components/content/courses/CourseDetails.js @@ -1,11 +1,8 @@ import React, { useEffect, useState, useCallback, useRef } from 'react'; import axios from 'axios'; import { useToast } from '@/hooks/useToast'; -import { Tag } from 'primereact/tag'; -import Image from 'next/image'; import { useRouter } from 'next/router'; import CoursePaymentButton from '@/components/bitcoinConnect/CoursePaymentButton'; -import ZapDisplay from '@/components/zaps/ZapDisplay'; import GenericButton from '@/components/buttons/GenericButton'; import { nip19 } from 'nostr-tools'; import { useImageProxy } from '@/hooks/useImageProxy'; @@ -20,8 +17,10 @@ import useTrackCourse from '@/hooks/tracking/useTrackCourse'; import WelcomeModal from '@/components/onboarding/WelcomeModal'; import { ProgressSpinner } from 'primereact/progressspinner'; import { Toast } from 'primereact/toast'; -import MoreOptionsMenu from '@/components/ui/MoreOptionsMenu'; -import { Divider } from 'primereact/divider'; + +// Import the desktop and mobile components +import DesktopCourseDetails from './DesktopCourseDetails'; +import MobileCourseDetails from './MobileCourseDetails'; export default function CourseDetails({ processedEvent, @@ -201,190 +200,33 @@ export default function CourseDetails({ ); } + // Shared props for both mobile and desktop components + const detailsProps = { + processedEvent, + paidCourse, + lessons, + decryptionPerformed, + author, + zapAmount, + zapsLoading, + menuItems, + returnImageProxy, + renderPaymentMessage, + isCompleted, + showCompletedTag + }; + return (
- Created by{' '} - - {author?.username || author?.name || author?.pubkey} - -
-- Created by{' '} - - {author?.username || author?.name || author?.pubkey} - -
-{line}
)} -Lessons
-{lessons.length}
-Price
-{processedEvent.price} sats
-Published
-- {new Date(processedEvent.published * 1000).toLocaleDateString()} -
-+ Created by{' '} + + {author?.username || author?.name || author?.pubkey} + +
+{line}
)} +Lessons
+{lessons.length}
+Price
+{processedEvent.price} sats
+Published
++ {new Date(processedEvent.published * 1000).toLocaleDateString()} +
++ Created by{' '} + + {author?.username || author?.name || author?.pubkey} + +
+{line}
)} +Lessons
+{lessons.length}
+Price
+{processedEvent.price} sats
+Published
++ {new Date(processedEvent.published * 1000).toLocaleDateString()} +
+Select a lesson from the sidebar to begin learning.
Please use the sidebar to navigate lessons.
-