From cd40ecc207fe4a3d3ce4b8c7ce0d5feac4fe020e Mon Sep 17 00:00:00 2001 From: nmemmert Date: Wed, 7 Oct 2026 14:57:53 -0400 Subject: [PATCH] Add Active/Planned status badges, dim planned studies, sort active first in track lists; v2.8.4 Co-Authored-By: Claude Sonnet 5.5 --- package.json | 2 +- src/App.css | 12 ++++++++++++ src/studyPages.tsx | 20 ++++++++++++-------- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index de98f29..b125a4f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "siteforge", "private": true, - "version": "2.8.3", + "version": "2.8.4", "type": "module", "scripts": { "dev": "vite", diff --git a/src/App.css b/src/App.css index e009d46..c454e21 100644 --- a/src/App.css +++ b/src/App.css @@ -13110,3 +13110,15 @@ font-size: 0.8rem; color: #e0c070; } + +.study-status-badge { + display: inline-block; + padding: 0.15rem 0.6rem; + border-radius: 999px; + font-size: 0.7rem; + font-weight: 700; + letter-spacing: 0.08em; + text-transform: uppercase; +} +.study-status-badge.active { background: rgba(201, 168, 76, 0.18); color: #c9a84c; border: 1px solid rgba(201, 168, 76, 0.45); } +.study-status-badge.planned { background: rgba(255, 255, 255, 0.05); color: #9a9486; border: 1px solid rgba(255, 255, 255, 0.15); } diff --git a/src/studyPages.tsx b/src/studyPages.tsx index 61ef3d5..37378e8 100644 --- a/src/studyPages.tsx +++ b/src/studyPages.tsx @@ -107,6 +107,10 @@ type StudyCommunityPost = { pending?: boolean } +function StudyStatusBadge({ status }: { status: 'active' | 'planned' }) { + return {status === 'active' ? 'Active' : 'Planned'} +} + function getLegacyColossiansStudy(content: SiteContent): StudyProgram { const legacySections = content.colossiansStudySections?.length ? content.colossiansStudySections : DEFAULT_COLOSSIANS_STUDY_SECTIONS return { @@ -678,7 +682,7 @@ export function StudyLandingPage({ content }: Props) { }, []) const enrolledStudies = overview?.studies.filter(study => study.enrolled) ?? [] - const availableStudies = overview?.studies ?? [] + const availableStudies = [...(overview?.studies ?? [])].sort((a, b) => Number(b.status === 'active') - Number(a.status === 'active')) const totalEnrolled = enrolledStudies.length const totalCompletedLessons = enrolledStudies.reduce((sum, study) => sum + study.completedLessons, 0) const totalLessons = enrolledStudies.reduce((sum, study) => sum + study.totalLessons, 0) @@ -750,7 +754,7 @@ export function StudyLandingPage({ content }: Props) {
-

{studyInfo.status === 'active' ? 'Active study' : 'Planned study'}

+

{studyInfo.title}

{studyInfo.completedLessons}/{studyInfo.totalLessons} lessons completed · {studyInfo.noteCount} notes

@@ -788,12 +792,12 @@ export function StudyLandingPage({ content }: Props) { ) : (
{availableStudies.map(studyInfo => ( -
+
-

{studyInfo.status === 'active' ? 'Active study' : 'Planned study'}

+

{studyInfo.title}

-

{studyInfo.completedLessons}/{studyInfo.totalLessons} lessons completed · {studyInfo.noteCount} notes

+ {!studyInfo.enrolled && studyInfo.status === 'planned' ?

Not open for enrollment yet

:

{studyInfo.completedLessons}/{studyInfo.totalLessons} lessons completed · {studyInfo.noteCount} notes

}
{studyInfo.enrolled && confirmLeaveSlug === studyInfo.slug ? (
@@ -3279,12 +3283,12 @@ export function StudyAccountPage() { ) : overview?.studies?.length ? (
{overview.studies.map(studyInfo => ( -
+
-

{studyInfo.status === 'active' ? 'Active study' : 'Planned study'}

+

{studyInfo.title}

-

{studyInfo.completedLessons} of {studyInfo.totalLessons} lessons completed · {studyInfo.noteCount} notes

+ {!studyInfo.enrolled && studyInfo.status === 'planned' ?

Not open for enrollment yet

:

{studyInfo.completedLessons} of {studyInfo.totalLessons} lessons completed · {studyInfo.noteCount} notes

}
{!studyInfo.enrolled && studyInfo.status === 'planned' ? ( Coming soon