Rename daily quiz to check-in and add collapsible journal calendar.

Replace user-facing quiz wording with daily check-in, add journal history on the Bit page with month browsing and read-only entry modals, and keep legacy quiz routes redirecting to the new anchor.
This commit is contained in:
2026-05-24 10:20:03 -06:00
parent e41fc10c77
commit 93af01dec1
14 changed files with 610 additions and 30 deletions

View File

@@ -4,6 +4,7 @@ import { useCallback, useEffect, useState } from "react";
import { DailyQuizForm } from "@/components/daily-quiz/daily-quiz-form";
import { HabitTracker } from "@/components/habits/habit-tracker";
import { JournalCalendar } from "@/components/journal/journal-calendar";
import { PetHabitat } from "@/components/pet/pet-habitat";
import { HABIT_PET_DATA_UPDATED_EVENT } from "@/lib/app-events";
import {
@@ -37,6 +38,14 @@ export function AvatarPageContent() {
};
}, [loadCustomization]);
useEffect(() => {
const hash = window.location.hash.replace("#", "");
if (hash === "bit-daily-quiz") {
window.location.hash = "bit-daily-check-in";
}
}, []);
if (loadError) {
return <p className="text-xs text-red-500">{loadError}</p>;
}
@@ -66,10 +75,14 @@ export function AvatarPageContent() {
<div id="bit-daily-tasks">
<HabitTracker mode="daily" />
</div>
<div id="bit-daily-quiz">
<div id="bit-daily-check-in">
<DailyQuizForm />
</div>
</section>
<section className="w-full pt-8">
<JournalCalendar />
</section>
</div>
);
}

View File

@@ -94,21 +94,21 @@ export function AvatarStatusCard({ customization }: AvatarStatusCardProps) {
Health {condition.health}/{WELLNESS_SCALE_MAX}
</Badge>
<Badge variant={hasCheckedInToday ? "default" : "outline"}>
{hasCheckedInToday ? "Checked in today" : "Quiz pending"}
{hasCheckedInToday ? "Checked in today" : "Check-in pending"}
</Badge>
</div>
<p className="text-center text-sm text-muted-foreground">
{hasCheckedInToday
? completedTaskCount > 0
? `Your bit reacts to today's quiz and ${completedTaskCount} completed task${completedTaskCount === 1 ? "" : "s"}. Meals, hydration, sleep, and relaxing habits boost health and mood.`
? `Your bit reacts to today's check-in and ${completedTaskCount} completed task${completedTaskCount === 1 ? "" : "s"}. Meals, hydration, sleep, and relaxing habits boost health and mood.`
: "Your bit is reacting to today's wellness check-in. Complete habits to boost mood, energy, and health."
: completedTaskCount > 0
? "Complete today's quiz for a full wellness read, then keep completing habits to boost your bit."
: "Complete today's quiz to update your bit's mood, energy, and health."}
? "Complete today's check-in for a full wellness read, then keep completing habits to boost your bit."
: "Complete today's check-in to update your bit's mood, energy, and health."}
</p>
{!hasCheckedInToday ? (
<Button asChild className="w-full">
<Link href={`${routes.avatar}#bit-daily-quiz`}>Take today&apos;s quiz</Link>
<Link href={`${routes.avatar}#bit-daily-check-in`}>Start daily check-in</Link>
</Button>
) : null}
</CardContent>