-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPosting.js
116 lines (104 loc) · 3.8 KB
/
Posting.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
import React, { Component } from 'react';
import { StyleSheet, Text, View, SafeAreaView } from 'react-native';
import { TouchableOpacity } from 'react-native-gesture-handler';
import { Button, Icon, Avatar, SearchBar } from 'react-native-elements';
import firebase from './firebase.js'
export default class Posting extends React.Component {
render() {
if(this.props.user==this.props.currentUser)
return (
<TouchableOpacity style={{backgroundColor:'#D0D0D0', borderBottomWidth: 1}}>
<SafeAreaView style={styles.container}>
<TouchableOpacity>
<Avatar style={styles.pic}
large
rounded
//title="SL"
source={{uri: this.props.img}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>
<TouchableOpacity
style={{
width: 60,
height: 60,
borderRadius: 30,
flex:2
}}
onPress={this.props.delete}>
<Icon reverse
name='delete'
color="red"
/>
</TouchableOpacity>
</TouchableOpacity>
{/* <TouchableOpacity style={styles.pic}/> */}
<View styles={{paddingLeft:100,}}>
<Text style={styles.author}>{this.props.title}</Text>
<Text style={styles.message}>Professor: {this.props.professor}</Text>
<Text style={styles.message}>Description: {this.props.description}</Text>
<Text style={styles.message}>Days: {this.props.days}</Text>
<Text style={styles.message}>Time: {this.props.time}</Text>
<Text style={styles.message}>User: {this.props.user}</Text>
</View>
</SafeAreaView>
</TouchableOpacity>
);
else
return (
<TouchableOpacity style={{backgroundColor:'#D0D0D0', borderBottomWidth: 1}}>
<SafeAreaView style={styles.container}>
<TouchableOpacity>
<Avatar style={styles.pic}
large
rounded
//title="SL"
source={{uri: "https://s3.amazonaws.com/uifaces/faces/twitter/adhamdannaway/128.jpg"}}
onPress={() => console.log("Works!")}
activeOpacity={0.7}
/>
</TouchableOpacity>
{/* <TouchableOpacity style={styles.pic}/> */}
<View styles={{paddingLeft:100}}>
<Text style={styles.author}>{this.props.title}</Text>
<Text style={styles.message}>Professor: {this.props.professor}</Text>
<Text style={styles.message}>Description: {this.props.description}</Text>
<Text style={styles.message}>Days: {this.props.days}</Text>
<Text style={styles.message}>Time: {this.props.time}</Text>
<Text style={styles.message}>User: {this.props.user}</Text>
</View>
</SafeAreaView>
</TouchableOpacity>
);
}
}
const styles = StyleSheet.create({
pic:{
width: 80,
height: 80,
borderRadius: 40,
overflow:'hidden'
},
deleteIcon:{
width: 40,
height: 40,
borderRadius: 30,
backgroundColor: 'red',
},
container: {
width: "100%",
//marginBottom: 5,
flexDirection:'row',
//backgroundColor: 'cyan'
},
author: {
paddingLeft:20,
color: "black",
fontSize: 25
},
message: {
paddingLeft:20,
color: "black",
fontSize: 20
}
});