1
1
mirror of https://github.com/theoludwig/p61-project.git synced 2024-07-17 07:00:12 +02:00
p61-project/app/(pages)/index.tsx

35 lines
841 B
TypeScript
Raw Normal View History

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