Skip to content

Commit

Permalink
New buttons and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaseTeichmann committed Nov 12, 2019
1 parent 1632673 commit 1d92fc0
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 45 deletions.
Binary file added Routinely/app/components/img/NotesButton.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Routinely/app/components/img/NotesHome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 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.
4 changes: 2 additions & 2 deletions Routinely/app/screens/alarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class AlarmScreen extends Component {
<Divider />
<ColorPicker />
<AwesomeButtonBlue
width={350}
width={395}
title="addAlarm"
onPress={() => this.addAlarm(this.state.title)}>
Add Alarm
Expand Down Expand Up @@ -214,7 +214,7 @@ const styles = StyleSheet.create({
},
card1: {
paddingVertical: 16,
width: 350,
width: 400,
},
submit: {
paddingVertical: 16,
Expand Down
11 changes: 7 additions & 4 deletions Routinely/app/screens/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,10 @@ class CalendarScreen extends Component {
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Notes')}
underlayColor={'#ededed'}>
<Text>Notes ></Text>
<Image
style={styles.icon}
source={require('../components/img/NotesHome.png')}
/>
</TouchableHighlight>
<Divider />
<FlatList
Expand Down Expand Up @@ -515,8 +518,8 @@ class CalendarScreen extends Component {

const styles = StyleSheet.create({
container: {
marginLeft: 15,
marginRight: 15,
marginLeft: 10,
marginRight: 10,
},
greyBackground: {
backgroundColor: '#ededed',
Expand Down Expand Up @@ -582,7 +585,7 @@ const styles = StyleSheet.create({
//alignItems: 'baseline',
position: 'absolute',
bottom: 25,
marginLeft: 300,
marginLeft: 340,
},
plusImage: {
width: 60,
Expand Down
63 changes: 38 additions & 25 deletions Routinely/app/screens/event.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import React, {Component, useState} from 'react';
import {StyleSheet, Text, View, Button, TextInput, Platform, UIManager, DatePickerIOS,} from 'react-native';
import {
StyleSheet,
Text,
View,
Button,
TextInput,
Platform,
UIManager,
DatePickerIOS,
} from 'react-native';
import * as AddCalendarEvent from 'react-native-add-calendar-event';
import moment from 'moment';
import DayPicker from '../components/alarm_components/DayPicker';
Expand All @@ -17,10 +26,10 @@ const utcDateToString = (momentInUTC: moment): string => {
return time;
};

const user = [{"email": ''}];
if(firebase.auth().currentUser !== null){
const user = [{email: ''}];
if (firebase.auth().currentUser !== null) {
const currentUser = firebase.auth().currentUser;
user.email= currentUser.email;
user.email = currentUser.email;
}

class EventScreen extends Component {
Expand All @@ -42,28 +51,33 @@ class EventScreen extends Component {
//this.setDate = this.setDate.bind(this);
}

onButtonPress = (day) => {
onButtonPress = day => {
this.setState({
day: true
day: true,
});
}
};

addEvent = async (title) => {
addEvent = async title => {
//const title = this.state.title.toString();
const addEvent = firestore().collection('users').doc(user.email).collection('events');
const addEvent = firestore()
.collection('users')
.doc(user.email)
.collection('events');
try {
addEvent.doc().set({
title: this.state.title,
notes: this.state.notes,
chosenDate: this.state.chosenDate,
Sun: this.state.Sun,
Mon: this.state.Mon,
Tue: this.state.Tue,
Wed: this.state.Wed,
Thu: this.state.Thu,
Fri: this.state.Fri,
Sat: this.state.Sat,
})
addEvent
.doc()
.set({
title: this.state.title,
notes: this.state.notes,
chosenDate: this.state.chosenDate,
Sun: this.state.Sun,
Mon: this.state.Mon,
Tue: this.state.Tue,
Wed: this.state.Wed,
Thu: this.state.Thu,
Fri: this.state.Fri,
Sat: this.state.Sat,
})
.then(ref => {
console.log('Added doc w ID: ', ref.id);
});
Expand Down Expand Up @@ -138,10 +152,9 @@ class EventScreen extends Component {
/>
</View>
<AwesomeButtonBlue
width={350}
width={395}
title="addEvent"
onPress={() => this.addEvent(this.state.title)}>

Add Event
</AwesomeButtonBlue>
</View>
Expand Down Expand Up @@ -199,11 +212,11 @@ const styles = StyleSheet.create({
},
card1: {
paddingVertical: 16,
width: 350,
width: 400,
},
submit: {
paddingVertical: 16,
width: 350,
width: 400,
},
});
export default EventScreen;
28 changes: 14 additions & 14 deletions Routinely/app/screens/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,16 @@ class MenuScreen extends Component {
/>
</TouchableHighlight>
</View>
<View>
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Notes')}>
<Image
style={styles.icon}
source={require('../components/img/NotesButton.png')}
/>
</TouchableHighlight>
</View>
</View>
<Button
title="Back"
color="#90A4AE"
onPress={() => this.props.navigation.navigate('Calendar')}
/>
<Button
title="Notes"
color="#90A4AE"
onPress={() => this.props.navigation.navigate('Notes')}
/>
</View>
);
}
Expand All @@ -67,18 +66,19 @@ const styles = StyleSheet.create({
alignItems: 'center',
},
icon: {
width: 180,
width: 200,
height: 100,
marginLeft: 5,
marginTop: 5,
},
row: {
flexDirection: 'row',
},
MenuButton: {
backgroundColor: 'red',
width: '45%',
height: '35%',
borderRadius: 10,
width: '50%',
height: '40%',
borderRadius: 14,
margin: 10,
},
});
Expand Down

0 comments on commit 1d92fc0

Please sign in to comment.