Skip to content

Commit

Permalink
Changed Navigation to new menu screen
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaseTeichmann committed Oct 23, 2019
1 parent f5b001f commit a427761
Show file tree
Hide file tree
Showing 5 changed files with 144 additions and 39 deletions.
Binary file added Routinely/app/components/img/circle-plus.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion Routinely/app/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import AlarmScreen from './screens/alarm';
import AlarmRingingScreen from './screens/alarmRinging';
import EventScreen from './screens/event';
import TaskScreen from './screens/tasks';
import MenuScreen from './screens/menu';

const AuthStack = createStackNavigator(
{
Expand All @@ -24,11 +25,13 @@ const AppStack = createStackNavigator(
Calendar: CalendarScreen,
Event: EventScreen,
Task: TaskScreen,
Menu: MenuScreen,
},
{
initialRouteName: 'Alarm',
initialRouteName: 'AlarmRinging',
initialRouteName: 'Calendar',
initialRouteName: 'Menu',
},
);

Expand All @@ -39,7 +42,7 @@ export default createAppContainer(
Auth: AuthStack,
},
{
initialRouteName: 'Auth',
initialRouteName: 'App',
},
),
);
55 changes: 18 additions & 37 deletions Routinely/app/screens/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ const utcDateToString = (momentInUTC: moment): string => {
const eventsRef = firestore()
.collection('users')
.doc('skiser')
.collection('event');
.collection('event');

const eRef = firestore().collection('users').get();
const eRef = firestore()
.collection('users')
.get();

//const eventsRef = eRef.collection('event');

Expand Down Expand Up @@ -90,9 +92,9 @@ class CalendarScreen extends Component {

getEvents = async eventRetrieved => {
try {
const snapshot = await eventsRef.get()
const snapshot = await eventsRef.get();
snapshot.forEach(event => {
//.then(snapshot => {
//.then(snapshot => {
this.state.eventList.push(event.data());
});
eventRetrieved(this.state.eventList);
Expand Down Expand Up @@ -145,7 +147,7 @@ class CalendarScreen extends Component {
<Text style={styles.itemHourText}>{item.hour}</Text>
<Text style={styles.itemDurationText}>{item.duration}</Text>
</View>
<Text style={styles.itemTitleText}>{item.title} </Text>
<Text style={styles.itemTitleText}>{item.title} </Text>
<Text style={styles.itemHourText}>{item.notes}</Text>
{/* TODO: do we want an info button or not??
<View style={styles.itemButtonContainer}>
Expand All @@ -158,8 +160,7 @@ class CalendarScreen extends Component {
);
};


//TODO: make marked dates appear in calendar
//TODO: make marked dates appear in calendar
getMarkedDates = () => {
const marked = {};
data = this.state.eventList;
Expand Down Expand Up @@ -248,27 +249,13 @@ class CalendarScreen extends Component {
}}
// sectionStyle={styles.section}
/>
<View style={styles.container}>
<View style={{flexDirection: 'row'}}>
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Alarm')}>
<Image
style={styles.contain}
source={require('../components/img/alarm.png')}
/>
</TouchableHighlight>
<View style={styles.plus}>
<View>
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Event')}>
onPress={() => this.props.navigation.navigate('Menu')}>
<Image
style={styles.contain}
source={require('../components/img/plus.png')}
/>
</TouchableHighlight>
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Task')}>
<Image
style={styles.clip}
source={require('../components/img/clipboard.png')}
style={styles.plusImage}
source={require('../components/img/circle-plus.png')}
/>
</TouchableHighlight>
</View>
Expand All @@ -280,9 +267,10 @@ class CalendarScreen extends Component {

const styles = StyleSheet.create({
plus: {
width: 20,
height: 20,
marginLeft: 350,
color: 'white',
alignItems: 'baseline',
marginLeft: 300,
marginBottom: 25,
},
container: {
paddingTop: 10,
Expand All @@ -291,16 +279,9 @@ const styles = StyleSheet.create({
paddingBottom: 5,
alignItems: 'center',
},
contain: {
plusImage: {
width: 50,
height: 50,
marginRight: 10,
},
clip: {
width: 30,
height: 30,
marginRight: 10,
marginBottom: 10,
},
calendar: {
paddingLeft: 20,
Expand Down
2 changes: 1 addition & 1 deletion Routinely/app/screens/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class EventScreen extends Component {
addEvent = async () => {
const addEvent = firestore()
.collection('users')
.doc('skiser')
.doc('cteichmann')
.collection('event');
try {
await addEvent
Expand Down
121 changes: 121 additions & 0 deletions Routinely/app/screens/menu.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import React, {Component} from 'react';
import {
View,
StyleSheet,
Button,
TouchableHighlight,
Image,
Text,
} from 'react-native';

class MenuScreen extends Component {
render() {
return (
<View>
<View style={styles.block}>
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Task')}>
<Image
style={styles.contain}
source={require('../components/img/clipboard.png')}
/>

</TouchableHighlight>
<Text style={styles.title}> To-Do List </Text>
</View>
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Event')}>
<Image
style={styles.contain}
source={require('../components/img/plus.png')}
/>
</TouchableHighlight>
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Task')}>
<Image
style={styles.clip}
source={require('../components/img/clipboard.png')}
/>
</TouchableHighlight>
<Button
title="Back"
onPress={() => this.props.navigation.navigate('Calendar')}
/>
</View>
);
}
}

const styles = StyleSheet.create({
block: {
margin: 15,
width: 150,
height: 50,
backgroundColor: 'blue',
flexDirection: 'row',
flexWrap: 'wrap',
},
title: {
paddingTop: 15,
fontSize: 18,
color: 'white',
},
plus: {
width: 20,
height: 20,
marginLeft: 350,
},
container: {
paddingTop: 10,
paddingLeft: 40,
paddingRight: 20,
paddingBottom: 5,
alignItems: 'center',
},
contain: {
width: 50,
height: 50,
marginRight: 10,
},
clip: {
width: 30,
height: 30,
marginRight: 10,
marginBottom: 10,
},
calendar: {
paddingLeft: 20,
paddingRight: 20,
},
section: {
backgroundColor: '#f0f4f7',
color: '#79838a',
},
item: {
padding: 20,
backgroundColor: 'white',
borderBottomWidth: 1,
borderBottomColor: '#e8ecf0',
flexDirection: 'row',
},
itemHourText: {
color: 'black',
},
itemDurationText: {
color: 'grey',
fontSize: 12,
marginTop: 4,
marginLeft: 4,
},
itemTitleText: {
color: 'black',
marginLeft: 16,
fontWeight: 'bold',
fontSize: 16,
},
itemButtonContainer: {
flex: 1,
alignItems: 'flex-end',
},
});
export default MenuScreen;

0 comments on commit a427761

Please sign in to comment.