-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEvent.js
More file actions
65 lines (60 loc) · 1.3 KB
/
Event.js
File metadata and controls
65 lines (60 loc) · 1.3 KB
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
import React, { Component } from "react";
import {
StyleSheet,
Platform,
Image,
Text,
View,
ScrollView,
BackHandler,
} from "react-native";
import Icon from 'react-native-vector-icons/FontAwesome';
class Event extends Component {
componentDidMount() {
this.backHandler = BackHandler.addEventListener('hardwareBackPress', () => {
this.props.onCancel(); // works best when the goBack is async
return true;
});
}
componentWillUnmount() {
this.backHandler.remove();
}
render() {
const { title, desc, date, onCancel } = this.props;
return(
<ScrollView style={styles.container}>
<Text style={styles.title}> {title} </Text>
<Text style={styles.description}> {desc}</Text>
<Text style={styles.dateStyle}> The Event Starts on: {date} </Text>
</ScrollView>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
width: "100%",
height: "100%",
borderRadius: 4,
borderWidth: 0.5,
borderColor: "#d6d7da"
},
title: {
fontSize: 36,
margin: 20,
alignSelf: "flex-start",
fontWeight: "bold"
},
description: {
fontSize: 24,
margin: 20,
alignSelf: "flex-start",
},
dateStyle: {
fontSize: 18,
margin: 20,
alignSelf: "flex-start",
color: "#32CD32"
},
});
export default Event;