feat: redesign home tab as dashboard with stats, move prayer entry to journal tab
This commit is contained in:
1 parent
8a5658a359
commit
7237aa6181
2 files changed
+117
-10
No files matched your search
+20
-10
@@ -9,6 +9,7 @@ import DailyEntry from '@/components/DailyEntry';
|
||||
import CalendarView from '@/components/CalendarView';
|
||||
import ReflectionsList from '@/components/ReflectionsList';
|
||||
import SettingsPage from '@/components/SettingsPage';
|
||||
import HomePage from '@/components/HomePage';
|
||||
import { db } from '@/lib/firebase';
|
||||
import { collection, addDoc, getDocs, updateDoc, query, where, doc } from 'firebase/firestore';
|
||||
import toast from 'react-hot-toast';
|
||||
@@ -190,20 +191,29 @@ export default function Home() {
|
||||
<BottomNav activeTab={activeTab} onTabChange={setActiveTab} />
|
||||
|
||||
{activeTab === 'home' && (
|
||||
<DailyEntry
|
||||
date={date}
|
||||
onDateChange={setDate}
|
||||
text={text}
|
||||
onTextChange={setText}
|
||||
prayFor={prayFor}
|
||||
onPrayForChange={setPrayFor}
|
||||
onSubmit={handleSubmit}
|
||||
isEditing={!!editingPrayer}
|
||||
<HomePage
|
||||
prayers={prayers}
|
||||
todayCount={prayers.filter(p => p.date === new Date().toISOString().split('T')[0]).length}
|
||||
onStartPraying={() => setActiveTab('journal')}
|
||||
/>
|
||||
)}
|
||||
|
||||
{activeTab === 'journal' && (
|
||||
<CalendarView prayers={prayers} onDayClick={handleDateClick} />
|
||||
<>
|
||||
<DailyEntry
|
||||
date={date}
|
||||
onDateChange={setDate}
|
||||
text={text}
|
||||
onTextChange={setText}
|
||||
prayFor={prayFor}
|
||||
onPrayForChange={setPrayFor}
|
||||
onSubmit={handleSubmit}
|
||||
isEditing={!!editingPrayer}
|
||||
/>
|
||||
<div className="max-w-md mx-auto p-4">
|
||||
<CalendarView prayers={prayers} onDayClick={handleDateClick} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{activeTab === 'reflections' && (
|
||||
|
||||
Reference in new issue
Block a user