Compare commits
No commits in common. "d09e64e9ba9a7453e5b75f5d4e119d3519edc382" and "83f93b88e57064e5d14395aa2cb9ebaa59d2ab1f" have entirely different histories.
d09e64e9ba
...
83f93b88e5
|
|
@ -1,37 +0,0 @@
|
||||||
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;
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
import { Event } from "../models/Event.js";
|
|
||||||
|
|
||||||
const events = [
|
|
||||||
{
|
|
||||||
name: "Christmas",
|
|
||||||
date: "2020-12-24",
|
|
||||||
category: "family",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Valentines Day",
|
|
||||||
date: "2021-02-14",
|
|
||||||
category: "friends",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: "Birthday",
|
|
||||||
date: "2021-03-14",
|
|
||||||
category: "family",
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export const EVENTS = events.map(
|
|
||||||
(event) => new Event(event.name, event.date, event.category)
|
|
||||||
);
|
|
||||||
|
|
@ -1,12 +0,0 @@
|
||||||
import { v4 as generateUniqueKey } from "uuid";
|
|
||||||
|
|
||||||
export class Event {
|
|
||||||
constructor(name, date, category) {
|
|
||||||
this._key = generateUniqueKey();
|
|
||||||
this._name = name;
|
|
||||||
this._date = date;
|
|
||||||
this._category = category;
|
|
||||||
this._giftList = [];
|
|
||||||
this._personList = [];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -8,7 +8,6 @@ import Colors from "../constants/colors";
|
||||||
import MainScreen from "../screens/MainScreen";
|
import MainScreen from "../screens/MainScreen";
|
||||||
import LogoTitle from "../components/LogoTitle";
|
import LogoTitle from "../components/LogoTitle";
|
||||||
import PersonOverviewScreen from "../screens/PersonOverviewScreen";
|
import PersonOverviewScreen from "../screens/PersonOverviewScreen";
|
||||||
import EventOverviewScreen from "../screens/EventOverviewScreen";
|
|
||||||
|
|
||||||
const Tab = createBottomTabNavigator();
|
const Tab = createBottomTabNavigator();
|
||||||
|
|
||||||
|
|
@ -59,7 +58,7 @@ function Navigator() {
|
||||||
/>
|
/>
|
||||||
<Tab.Screen
|
<Tab.Screen
|
||||||
name="Calendar"
|
name="Calendar"
|
||||||
component={EventOverviewScreen}
|
component={MainScreen}
|
||||||
options={{
|
options={{
|
||||||
tabBarIcon: ({ color, size }) => (
|
tabBarIcon: ({ color, size }) => (
|
||||||
<Icon name="calendar-outline" color={color} size={size} />
|
<Icon name="calendar-outline" color={color} size={size} />
|
||||||
|
|
|
||||||
|
|
@ -1,33 +0,0 @@
|
||||||
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