Add EventCard and EventOverviewScreen
This commit is contained in:
parent
dd639c087f
commit
2fbae5215e
|
|
@ -0,0 +1,37 @@
|
||||||
|
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
||||||
|
import Colors from "../constants/colors";
|
||||||
|
|
||||||
|
const EventCard = (props) => {
|
||||||
|
return (
|
||||||
|
<TouchableOpacity style={{ ...styles.screen, ...props.style }}>
|
||||||
|
<View style={styles.eventItem}>
|
||||||
|
<Text style={styles.text}>
|
||||||
|
{props.event._name} ({props.event._date})
|
||||||
|
</Text>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
screen: {
|
||||||
|
flex: 1,
|
||||||
|
alignItem: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
backgroundColor: Colors.primary500,
|
||||||
|
},
|
||||||
|
eventItem: {
|
||||||
|
margin: 10,
|
||||||
|
padding: 10,
|
||||||
|
borderRadius: 10,
|
||||||
|
borderWidth: 1,
|
||||||
|
borderColor: "white",
|
||||||
|
height: 60,
|
||||||
|
backgroundColor: Colors.primary400,
|
||||||
|
},
|
||||||
|
text: {
|
||||||
|
color: "white",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default EventCard;
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
import { ScrollView, StyleSheet, View } from "react-native";
|
||||||
|
import { StatusBar } from "expo-status-bar";
|
||||||
|
|
||||||
|
import { EVENTS } from "../data/EventData";
|
||||||
|
|
||||||
|
import Colors from "../constants/colors";
|
||||||
|
import EventCard from "../components/EventCard";
|
||||||
|
import FloatingButton from "../components/FloatingButton";
|
||||||
|
|
||||||
|
const eventsToDisplay = EVENTS.map((event, index) => {
|
||||||
|
return <EventCard event={event} key={index} />;
|
||||||
|
});
|
||||||
|
|
||||||
|
const EventOverviewScreen = (props) => {
|
||||||
|
return (
|
||||||
|
<View style={styles.container}>
|
||||||
|
<ScrollView>{eventsToDisplay}</ScrollView>
|
||||||
|
<FloatingButton />
|
||||||
|
<StatusBar style="auto" />
|
||||||
|
</View>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const styles = StyleSheet.create({
|
||||||
|
container: {
|
||||||
|
flex: 1,
|
||||||
|
backgroundColor: Colors.primary500,
|
||||||
|
alignItem: "center",
|
||||||
|
justifyContent: "center",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default EventOverviewScreen;
|
||||||
Reference in New Issue