diff --git a/src/modules/events/EventDetails.js b/src/modules/events/EventDetails.js
index cb14817..2978738 100644
--- a/src/modules/events/EventDetails.js
+++ b/src/modules/events/EventDetails.js
@@ -1,5 +1,5 @@
import React, { Component } from 'react';
-import {StyleSheet, ScrollView, Text, Platform, View, Image} from "react-native";
+import {Linking, StyleSheet, ScrollView, Text, Platform, View, Image, TouchableHighlight, Button} from "react-native";
import HTMLView from 'react-native-htmlview';
import moment from "moment";
@@ -7,36 +7,85 @@ export default class EventDetails extends Component {
_formatTime(time) {
moment.locale('nb');
- return moment(time).format('llll');
+ return moment(time).format('HH:mm');
+ }
+
+ _formatMonth(time) {
+ moment.locale('nb');
+ return moment(time).format('MMM');
+ }
+
+ _formatDay(time) {
+ moment.locale('nb');
+ return moment(time).format('DD');
+ }
+
+ _formatYear(time) {
+ moment.locale('nb');
+ return moment(time).format('YYYY');
+ }
+
+ _onUrlPress(link) {
+ Linking.openURL(link);
}
render() {
const item = this.props.item;
+ let image = null;
+ if (item.thumbnail.medium_large) {
+ image = ;
+ }
+ let price = null;
+ if (item.price_regular && item.price_regular) {
+ price = Pris: {item.price_regular} - Medlemer: {item.price_member};
+ }
+ let faceButton = null;
+ if (item.facebook_url) {
+ faceButton = this._onUrlPress(item.facebook_url)}>
+
+ ;
+ }
+ let ticket = null;
+ if (item.ticket_url) {
+ ticket =
+ ;
+ }
return (
-
-
-
- {item.title.decoded}
- {this._formatTime(item.start_time)}
-
-
-
+
+ {image}
+
+ {item.title.decoded}
+
+
+ {this._formatDay(item.start_time)}
+ {this._formatMonth(item.start_time)}
+ {this._formatYear(item.start_time)}
+
+
+ {item.venue}
+ kl. {this._formatTime(item.start_time)}
+ {price}
+
+ {faceButton}
+
+ {ticket}
+
+
+
)
}
}
const styles = StyleSheet.create({
header: {
- fontSize: 16,
+ fontSize: 20,
fontWeight: 'bold',
color: '#000',
},
- paragraph: {
- fontSize: 16,
- color: '#000',
- paddingBottom: 10,
- lineHeight: 25,
- },
card: {
borderColor: '#e1e8ee',
borderWidth: 1,
@@ -62,9 +111,67 @@ const styles = StyleSheet.create({
fontSize: 14,
color: '#666'
},
+ info: {
+ color: '#000',
+ },
content: {
- paddingTop: 10,
+ paddingTop: 20,
+ },
+ date: {
+ borderColor: '#e1e8ee',
+ borderWidth: 1,
+ ...Platform.select({
+ ios: {
+ shadowColor: 'rgba(0,0,0, .2)',
+ shadowOffset: {height: 0, width: 0},
+ shadowOpacity: 2,
+ shadowRadius: 2,
+ },
+ android: {
+ elevation: 2,
+ },
+ }),
+ marginTop: 10,
+ backgroundColor: '#eee',
+ },
+ day: {
+ paddingTop: 5,
+ fontSize: 20,
+ color: '#000',
+ textAlign: 'center',
+ },
+ month: {
+ textAlign: 'center',
+ paddingBottom: 5,
+ },
+ year: {
+ fontSize: 10,
+ color: '#fff',
+ backgroundColor: '#f58220',
+ textAlign: 'center',
+ paddingRight: 20,
+ paddingBottom: 3,
+ paddingLeft: 20,
+ paddingTop: 3,
+ },
+ infoContainer: {
+ flex: 3,
+ marginLeft: 20,
+ marginTop: 20,
+ },
+ faceButton: {
+ marginTop: 10,
+ flex: 1,
+ },
+ faceIcon: {
+ height: 70,
+ width: 70,
+ alignSelf: 'flex-end',
+ },
+ ticketButton: {
+ paddingTop: 20,
}
+
});
//FIXME: Ninja margin