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 ) })