feat: show count of prayers already prayed for today in greeting

This commit is contained in:
nmemmert committed 2026-01-16 08:54:09 -05:00
1 parent 8812d3d6ab
commit 8b4109a8fd
1 file changed
+13 -3
+13 -3
View File
@@ -53,6 +53,9 @@ export default function HomePage({ prayers, todayCount, onStartPraying, onSelect
// Count active prayer requests (not answered)
const activePrayerCount = prayers.filter(p => !p.answered).length;
// Count how many active prayers were prayed for today
const prayedTodayCount = prayers.filter(p => !p.answered && p.lastPrayedFor === today).length;
// Calculate actual streak - consecutive days with prayers
const calculateStreak = () => {
if (prayers.length === 0) return 0;
@@ -131,9 +134,16 @@ export default function HomePage({ prayers, todayCount, onStartPraying, onSelect
{getGreeting()}, {getFirstName()}!
</h1>
{activePrayerCount > 0 ? (
<p className="text-lg text-slate-300">
You have <span className="font-bold text-blue-400">{activePrayerCount}</span> {activePrayerCount === 1 ? 'thing' : 'things'} that need prayer today.
</p>
<div className="text-lg text-slate-300">
<p>
You have <span className="font-bold text-blue-400">{activePrayerCount}</span> {activePrayerCount === 1 ? 'thing' : 'things'} that need prayer today.
</p>
{prayedTodayCount > 0 && (
<p className="mt-1">
You've prayed for <span className="font-bold text-green-400">{prayedTodayCount}</span> of them! 🙏
</p>
)}
</div>
) : (
<p className="text-lg text-slate-300">
All caught up! Start a new prayer to keep your journey going.