Discussion stays open for finished studies; only planned studies are closed; v2.11.2
Publish Container / build (push) Successful in 16m10s

A finished study is just no longer the main study, so students who take it later still need discussion.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nmemmertandClaude Sonnet 5.5 committed 2026-10-09 11:52:56 -04:00
1 parent f1d4909acb
commit 0ab94bfcd4
5 files changed
+20 -17

No files matched your search

+9 -7
View File
@@ -212,9 +212,11 @@ function getEffectiveStudyStatus(study: StudyProgram): 'active' | 'planned' | 'c
return 'active'
}
// Discussion (community board and lesson comments) is only open while a study is active.
// Discussion (community board and lesson comments) is open for every study that has started,
// including finished ones, so students who take a study later can still join in. Planned
// studies are closed until they begin.
function isDiscussionOpen(study: StudyProgram | undefined): boolean {
return Boolean(study) && getEffectiveStudyStatus(study as StudyProgram) === 'active'
return Boolean(study) && getEffectiveStudyStatus(study as StudyProgram) !== 'planned'
}
function getNextReleaseLabel(study: StudyProgram): string {
@@ -1698,7 +1700,7 @@ export function ColossiansStudyIndexPage({ content }: Props) {
)}
{allLessonsDone && <Link to="/study/account" className="btn-secondary">🏅 My Certificate</Link>}
{enrolled && <Link to={`/study/${study.slug}/notes`} className="btn-secondary">My Notes</Link>}
{enrolled && studyStatus === 'active' && <Link to={`/study/${study.slug}/community`} className="btn-secondary">Community</Link>}
{enrolled && studyStatus !== 'planned' && <Link to={`/study/${study.slug}/community`} className="btn-secondary">Community</Link>}
{auth.authenticated && <Link to="/study/account" className="btn-secondary">My Account</Link>}
</div>
{enrollMessage && <p className="study-note-status" style={{ marginTop: '0.75rem' }}>{enrollMessage}</p>}
@@ -4204,12 +4206,12 @@ export function StudyDiscussionHubPage({ content }: Props) {
<div className="section-inner study-course-hero-inner">
<p className="eyebrow">Student Community</p>
<h1>Study Discussion</h1>
<p className="study-course-hero-copy">Pick an active study to see what other students are saying, ask questions, and share what God is teaching you. Discussion is open while a study is active.</p>
<p className="study-course-hero-copy">Pick a study track to see what other students are saying, ask questions, and share what God is teaching you.</p>
</div>
</section>
<section className="section-inner" style={{ paddingTop: '1rem', paddingBottom: '4rem' }}>
{openDiscussionStudies.length === 0 ? (
<p className="study-detail-copy">Discussion opens while a study is active. There are no active studies right now — check back when the next one starts.</p>
<p className="study-detail-copy">There are no studies open for discussion yet. Check back when the next one starts.</p>
) : (
<div className="study-module-list">
{openDiscussionStudies.map(study => {
@@ -4294,8 +4296,8 @@ export function StudyCommunityPage({ content }: Props) {
<div className="auth-shell auth-shell--single">
<div className="auth-card auth-card--center">
<p className="eyebrow">{study.title}</p>
<h1>Discussion Is Closed</h1>
<p>Discussion is only open while a study is active, and this study isn't active right now.</p>
<h1>Discussion Isn't Open Yet</h1>
<p>Discussion opens once this study has started. Check back when it begins.</p>
<div className="study-signup-actions">
<Link to={`/study/${study.slug}`} className="btn-primary">Back to Study</Link>
</div>