From 748ac2476c9f17d830e598e59430937a6452f77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20LUDWIG?= Date: Wed, 1 May 2024 14:15:54 +0200 Subject: [PATCH] fix: habit end date filtering + habit stop wording --- .../components/HabitForm/HabitEditForm.tsx | 42 +++++++++++++------ .../components/HabitsMainPage/HabitsList.tsx | 2 +- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/presentation/react/components/HabitForm/HabitEditForm.tsx b/presentation/react/components/HabitForm/HabitEditForm.tsx index a97f844..f16c216 100644 --- a/presentation/react/components/HabitForm/HabitEditForm.tsx +++ b/presentation/react/components/HabitForm/HabitEditForm.tsx @@ -4,7 +4,13 @@ import { zodResolver } from "@hookform/resolvers/zod" import { useState } from "react" import { Controller, useForm } from "react-hook-form" import { ScrollView, StyleSheet, View } from "react-native" -import { Button, HelperText, Snackbar, TextInput } from "react-native-paper" +import { + Button, + HelperText, + Snackbar, + Text, + TextInput, +} from "react-native-paper" import { SafeAreaView } from "react-native-safe-area-context" import ColorPicker, { HueSlider, @@ -159,17 +165,29 @@ export const HabitEditForm: React.FC = ({ habit }) => { Save - + {habit.endDate == null ? ( + + ) : ( + + 🛑 The habit has been stopped! (No further progress can be saved) + + )} = (props) => { .filter((habitItem) => { return ( (habitItem.habit.endDate != null && - habitItem.habit.endDate <= selectedDate) || + habitItem.habit.endDate >= selectedDate) || habitItem.habit.endDate == null ) })