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.completedLessons}/{studyInfo.totalLessons} lessons completed · {studyInfo.noteCount} notes
{studyInfo.status === 'active' ? 'Active study' : 'Planned study'}
+{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.status === 'active' ? 'Active study' : 'Planned study'}
+{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
}