feat: show count of prayers already prayed for today in greeting
This commit is contained in:
1 parent
8812d3d6ab
commit
8b4109a8fd
1 file changed
+13
-3
@@ -53,6 +53,9 @@ export default function HomePage({ prayers, todayCount, onStartPraying, onSelect
|
|||||||
// Count active prayer requests (not answered)
|
// Count active prayer requests (not answered)
|
||||||
const activePrayerCount = prayers.filter(p => !p.answered).length;
|
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
|
// Calculate actual streak - consecutive days with prayers
|
||||||
const calculateStreak = () => {
|
const calculateStreak = () => {
|
||||||
if (prayers.length === 0) return 0;
|
if (prayers.length === 0) return 0;
|
||||||
@@ -131,9 +134,16 @@ export default function HomePage({ prayers, todayCount, onStartPraying, onSelect
|
|||||||
{getGreeting()}, {getFirstName()}!
|
{getGreeting()}, {getFirstName()}!
|
||||||
</h1>
|
</h1>
|
||||||
{activePrayerCount > 0 ? (
|
{activePrayerCount > 0 ? (
|
||||||
<p className="text-lg text-slate-300">
|
<div 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>
|
||||||
</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">
|
<p className="text-lg text-slate-300">
|
||||||
All caught up! Start a new prayer to keep your journey going.
|
All caught up! Start a new prayer to keep your journey going.
|
||||||
|
|||||||
Reference in new issue
Block a user