-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGroupSummary.js
39 lines (32 loc) · 1.1 KB
/
GroupSummary.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// GroupSummary.js
// Componente che descrive il riassunto di un gruppo regalo (all'interno di una FlatList)
import React from 'react';
import moment from 'moment';
import 'moment-timezone';
import { TouchableHighlight, View, Button } from 'react-native';
import { Text,ListItem} from 'native-base';
export default class GroupSummary extends React.PureComponent {
constructor(){
super();
}
// toggle a todo as completed or not via update()
toggleComplete() {
this.props.navigation.navigate('GiftListView',{groupId:this.props.docId});
this.props.doc.ref.update({
complete: !this.props.complete,
});
}
render() {
const dateToFormat = moment(this.props.endDate).format('MM/DD/YYYY').toString();
return (
<ListItem thumbnail
onPress={() => this.toggleComplete()}
>
<Text>{this.props.title}</Text>
<Text>{dateToFormat}</Text>
<Text>{this.props.test}</Text>
<Text>{this.props.person_fee}</Text>
</ListItem>
);
}
}