Skip to content

Commit

Permalink
Stable Master
Browse files Browse the repository at this point in the history
  • Loading branch information
ChaseTeichmann committed Oct 16, 2019
1 parent 563fac9 commit 5bd88e5
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 29 deletions.
Binary file added Routinely/app/components/img/clipboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 39 additions & 29 deletions Routinely/app/screens/calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ const fastDate = getPastDate(3);
const futureDates = getFutureDates(9);
const dates = [fastDate, today].concat(futureDates);


var events = [
{
title: dates[0],
Expand Down Expand Up @@ -114,7 +113,7 @@ class CalendarScreen extends Component {
itemPressed(id) {
Alert.alert(id);
}
/*
/*
getallEvents() {
const eventsRef = firestore()
.collection('users')
Expand All @@ -141,23 +140,33 @@ class CalendarScreen extends Component {
);
}

renderItem = events => {
if (_.isEmpty(this.events)) {
return this.renderEmptyItem();
}
renderEvent = () => {
// if (this.eventList.length() == 0) {
// return this.renderEmptyItem();
//
return (
<TouchableOpacity
onPress={() => this.itemPressed(item.title)}
style={styles.item}>
<View>
<Text style={styles.itemHourText}>{item.hour}</Text>
<Text style={styles.itemDurationText}>{item.duration}</Text>
</View>
<Text style={styles.itemTitleText}>{item.title}</Text>
<View style={styles.itemButtonContainer}>
<Button title={'Info'} onPress={this.buttonPressed} />
</View>
</TouchableOpacity>
<FlatList
data={this.state.eventList}
keyExtractor={item => item.id}
renderItem={({item}) => {
return (
<TouchableOpacity
onPress={() => this.itemPressed(item.title)}
style={styles.item}>
<View>
<Text>Hello </Text>
<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.notes}</Text>
<View style={styles.itemButtonContainer}>
<Button title={'Info'} onPress={this.buttonPressed} />
</View>
</TouchableOpacity>
);
}}
/>
);
};

Expand Down Expand Up @@ -240,19 +249,14 @@ class CalendarScreen extends Component {
// calendarStyle={styles.calendar}
// headerStyle={styles.calendar} // for horizontal only
/>

<AgendaList
sections={events}
extraData={events.notes}
renderItem={this.renderItem}
// sectionStyle={styles.section}
/>
<FlatList
data={this.state.eventList}
keyExtractor={item => item.id}
renderItem={({item}) => {
console.log(item);
return <Text> {item.title}</Text>;
renderItem={() => {
return this.renderEvent();
}}
// sectionStyle={styles.section}
/>
<View style={styles.container}>
<View style={{flexDirection: 'row'}}>
Expand All @@ -273,8 +277,8 @@ class CalendarScreen extends Component {
<TouchableHighlight
onPress={() => this.props.navigation.navigate('Task')}>
<Image
style={styles.contain}
source={require('../components/img/calendar.png')}
style={styles.clip}
source={require('../components/img/clipboard.png')}
/>
</TouchableHighlight>
</View>
Expand Down Expand Up @@ -302,6 +306,12 @@ const styles = StyleSheet.create({
height: 50,
marginRight: 10,
},
clip: {
width: 30,
height: 30,
marginRight: 10,
marginBottom: 10,
},
calendar: {
paddingLeft: 20,
paddingRight: 20,
Expand Down

0 comments on commit 5bd88e5

Please sign in to comment.