2024-03-15 22:48:28 +01:00
|
|
|
import { StyleSheet, Text, View } from "react-native"
|
2024-02-16 22:51:50 +01:00
|
|
|
import { SafeAreaView } from "react-native-safe-area-context"
|
|
|
|
|
2024-03-15 22:48:28 +01:00
|
|
|
import { useHabitsTracker } from "@/contexts/HabitsTracker"
|
|
|
|
|
2024-02-16 22:51:50 +01:00
|
|
|
const HomePage: React.FC = () => {
|
2024-03-15 22:48:28 +01:00
|
|
|
const { habitsTrackerPresenterState } = useHabitsTracker()
|
|
|
|
const { habitsTracker } = habitsTrackerPresenterState
|
|
|
|
const { habitProgressHistories } = habitsTracker
|
|
|
|
|
2024-02-16 22:51:50 +01:00
|
|
|
return (
|
|
|
|
<SafeAreaView style={styles.container}>
|
2024-03-15 22:48:28 +01:00
|
|
|
{habitProgressHistories.map((progressHistory) => {
|
|
|
|
const { habit } = progressHistory
|
|
|
|
|
|
|
|
return (
|
|
|
|
<View key={habit.id}>
|
|
|
|
<Text>{habit.name}</Text>
|
|
|
|
</View>
|
|
|
|
)
|
|
|
|
})}
|
2024-02-16 22:51:50 +01:00
|
|
|
</SafeAreaView>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
const styles = StyleSheet.create({
|
|
|
|
container: {
|
|
|
|
flex: 1,
|
|
|
|
alignItems: "center",
|
|
|
|
justifyContent: "center",
|
|
|
|
},
|
|
|
|
})
|
|
|
|
|
|
|
|
export default HomePage
|