From e11858c2f3812a4c909e20fbf92f423a960fb683 Mon Sep 17 00:00:00 2001 From: nmemmert Date: Wed, 3 Jun 2026 16:07:54 -0400 Subject: [PATCH] gated lessions --- data/study-reminders.json | 2 +- src/colossiansStudy.tsx | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/data/study-reminders.json b/data/study-reminders.json index 9edc739..419e498 100644 --- a/data/study-reminders.json +++ b/data/study-reminders.json @@ -1,4 +1,4 @@ { "users": {}, - "updatedAt": "2026-06-03T19:07:22.282Z" + "updatedAt": "2026-06-03T20:07:22.259Z" } \ No newline at end of file diff --git a/src/colossiansStudy.tsx b/src/colossiansStudy.tsx index 8333fd4..c680324 100644 --- a/src/colossiansStudy.tsx +++ b/src/colossiansStudy.tsx @@ -1284,12 +1284,15 @@ export function ColossiansStudyIndexPage({ content }: Props) {

{study.title}

- {sections.map(section => { + {sections.map((section, sectionIdx) => { const lessonNumber = getLessonNumber(sections, section.id) const isNew = isNewLesson(section) const coming = isComingSoon(section) - const isDisabled = coming || !enrolled - + const prevSection = sectionIdx > 0 ? sections[sectionIdx - 1] : null + const prevCompleted = !prevSection || studyProgress.completedSectionIds.includes(prevSection.id) + const lockedByProgress = enrolled && !coming && sectionIdx > 0 && !prevCompleted && !studyProgress.completedSectionIds.includes(section.id) + const isDisabled = coming || !enrolled || lockedByProgress + return ( isDisabled && e.preventDefault()}>
@@ -1298,7 +1301,8 @@ export function ColossiansStudyIndexPage({ content }: Props) { {isNew && New} {coming && Coming {getReleaseDateDisplay(section)}} {!coming && !enrolled && Enroll to open} - {enrolled && studyProgress.completedSectionIds.includes(section.id) && ( + {lockedByProgress && Complete previous lesson} + {enrolled && !lockedByProgress && studyProgress.completedSectionIds.includes(section.id) && ( Completed )}
@@ -1836,10 +1840,12 @@ export function ColossiansStudySectionPage({ content }: Props) { {previousSection ? ( Previous Lesson ) : } - {nextSection && isSectionReleased(nextSection) ? ( - Next Lesson - ) : nextSection ? ( + {nextSection && !isSectionReleased(nextSection) ? ( Available {getReleaseDateDisplay(nextSection)} + ) : nextSection && !lessonCompleted ? ( + 🔒 Complete checkpoint first + ) : nextSection ? ( + Next Lesson ) : }