import React from "react"; import PropTypes from "prop-types"; import { IconButton, Card, Text, withTheme, } from "react-native-paper"; import { View, StyleSheet } from "react-native"; function HomeScreen({ theme, timetable, subjects, navigation, days }) { return (<> {timetable.map((day, dayIdx) => ( {day.map((cls, idx) => { const subject = subjects.find(i => i.id === cls.sub_id); return ( {subject.name} {cls.start} to {cls.end} {cls.count} ); })} navigation.navigate(`New Entry ${days[dayIdx]}`)} icon="plus" color={theme.colors.primary} /> ))} ); } HomeScreen.propTypes = { timetable: PropTypes.array, subjects: PropTypes.array, navigation: PropTypes.object, days: PropTypes.array, theme: PropTypes.object, }; const style = StyleSheet.create({ card: { marginTop: 12, marginLeft: 10, marginRight: 10, }, text: { marginTop: 12, textAlign: "center", }, class: { flexDirection: "row", justifyContent: "space-between" }, }); export default withTheme(HomeScreen);