feat: add prayer frequency tracking with 1-7 slider and frequency compliance calculation
This commit is contained in:
1 parent
4225ef017c
commit
8105d39554
7 files changed
+88
-8
No files matched your search
@@ -24,6 +24,8 @@ interface Prayer {
|
||||
prayFor?: string;
|
||||
answered?: boolean;
|
||||
answerDetails?: string;
|
||||
prayFrequency?: number; // 1-7 times per week
|
||||
lastPrayedFor?: string; // ISO date string
|
||||
}
|
||||
|
||||
export default function Home() {
|
||||
@@ -37,6 +39,7 @@ export default function Home() {
|
||||
const [prayFor, setPrayFor] = useState('');
|
||||
const [answered, setAnswered] = useState(false);
|
||||
const [answerDetails, setAnswerDetails] = useState('');
|
||||
const [prayFrequency, setPrayFrequency] = useState(1); // 1-7 times per week
|
||||
|
||||
const { user, loading: authLoading } = useAuth();
|
||||
|
||||
@@ -106,6 +109,8 @@ export default function Home() {
|
||||
prayFor: prayFor || undefined,
|
||||
answered,
|
||||
answerDetails: answerDetails || undefined,
|
||||
prayFrequency,
|
||||
lastPrayedFor: answered ? undefined : new Date().toISOString().split('T')[0],
|
||||
};
|
||||
|
||||
if (editingPrayer) {
|
||||
@@ -142,6 +147,7 @@ export default function Home() {
|
||||
setPrayFor(prayer.prayFor || '');
|
||||
setAnswered(prayer.answered || false);
|
||||
setAnswerDetails(prayer.answerDetails || '');
|
||||
setPrayFrequency(prayer.prayFrequency || 1);
|
||||
setActiveTab('compose');
|
||||
};
|
||||
|
||||
@@ -221,6 +227,8 @@ export default function Home() {
|
||||
onAnsweredChange={setAnswered}
|
||||
answerDetails={answerDetails}
|
||||
onAnswerDetailsChange={setAnswerDetails}
|
||||
prayFrequency={prayFrequency}
|
||||
onPrayFrequencyChange={setPrayFrequency}
|
||||
onSubmit={handleSubmit}
|
||||
isEditing={!!editingPrayer}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user