diff --git a/src/modules/client/pages/CourseDetails.jsx b/src/modules/client/pages/CourseDetails.jsx index d643300..0c9d186 100644 --- a/src/modules/client/pages/CourseDetails.jsx +++ b/src/modules/client/pages/CourseDetails.jsx @@ -348,17 +348,21 @@ const CertCard = ({ courseTitle, courseLevel, badgeColor, badgeImageUrl, pending // ─── Course Units (spine + cards) ───────────────────────────────────────────── -const CourseUnits = ({ units = [], courseId, courseTitle, courseLevel, badgeColor, badgeImageUrl, onToggle, isCompleted, pendingCert, certificate, assessment }) => { +const CourseUnits = ({ units = [], courseId, courseTitle, courseLevel, badgeColor, badgeImageUrl, onToggle, isCompleted, pendingCert, certificate, assessment, contentNotReady }) => { const wrapRef = useRef(null); const cardRefs = useRef([]); // Build a flat ordered list of nodes: [unit, unit, ..., assessment?, cert] // Quiz is rendered inside each unit accordion, not as a separate spine node. - const nodes = [ - ...units.map((unit) => ({ type: "unit", unit })), - ...(assessment ? [{ type: "assessment", assessment }] : []), - { type: "cert" }, - ]; + // While content isn't ready yet, no unit/lesson/assessment titles are shown — + // only the Rewards (cert) card, as a preview of what's to come. + const nodes = contentNotReady + ? [{ type: "cert" }] + : [ + ...units.map((unit) => ({ type: "unit", unit })), + ...(assessment ? [{ type: "assessment", assessment }] : []), + { type: "cert" }, + ]; const totalNodes = nodes.length; const visibleNodes = useVisibleNodes(cardRefs, totalNodes); const [mids, setMids] = useState([]); @@ -702,10 +706,12 @@ const CourseDetails = () => { > )} - {/* Units */} + {/* Units — while content isn't ready, only Rewards is shown */} {course?.units?.length > 0 && ( <> -
+ This course is currently being prepared. Please check back later. +
+