diff --git a/presentation/react-native/components/HabitProgress.tsx b/presentation/react-native/components/HabitProgress.tsx index c834f35..b0b87f2 100644 --- a/presentation/react-native/components/HabitProgress.tsx +++ b/presentation/react-native/components/HabitProgress.tsx @@ -30,6 +30,8 @@ export const HabitProgress: React.FC = ({ const goalProgress = habitHistory.getGoalProgressByDate(selectedDate) + const goalProgresses = habitHistory.getProgressesByDate(selectedDate) + const values = { progress: 0, min: 0, @@ -61,8 +63,8 @@ export const HabitProgress: React.FC = ({ return ( - = ({ /> - {goalProgress.progress.toLocaleString()} /{" "} - {goalProgress.goal.target.value.toLocaleString()}{" "} + {goalProgress.progress.toLocaleString(LOCALE)} /{" "} + {goalProgress.goal.target.value.toLocaleString(LOCALE)}{" "} {goalProgress.goal.target.unit} @@ -195,7 +197,58 @@ export const HabitProgress: React.FC = ({ marginVertical: 10, }} /> - + + + Progress History + + + + {goalProgresses.map((habitProgress, index) => { + if (!habitProgress.goalProgress.isNumeric()) { + return <> + } + + return ( + + + {habitProgress.date.toLocaleDateString(LOCALE, { + year: "numeric", + month: "long", + day: "numeric", + })} + + + {habitProgress.goalProgress.progress.toLocaleString(LOCALE)}{" "} + {habitProgress.goalProgress.goal.target.unit} + + + ) + })} + +