From 34426e4d6dcd2e096bc49dd9ea7af7f6c5edff94 Mon Sep 17 00:00:00 2001 From: catalinmiron Date: Sun, 14 Jun 2015 21:53:08 +0300 Subject: [PATCH] Add the route for player #2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also rename author, since there’s no author :) it’s just player --- app/ShotDetails.js | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/app/ShotDetails.js b/app/ShotDetails.js index 8b27093..e0a6d91 100644 --- a/app/ShotDetails.js +++ b/app/ShotDetails.js @@ -8,6 +8,7 @@ var { StyleSheet, Text, TouchableOpacity, + TouchableHighlight, View, Component } = React; @@ -19,6 +20,7 @@ var Icon = require('FontAwesome'), ParallaxView = require('react-native-parallax-view'), Modal = require('react-native-modal'); +var Player = require('./Player'); var ShotDetails = React.createClass({ getInitialState: function() { @@ -40,7 +42,7 @@ var ShotDetails = React.createClass({ }, render: function() { - var shotAuthor = this.props.shot.player; + var player = this.props.shot.player; return ( - - - {this.props.shot.title} - by {shotAuthor.name} - + + + + {this.props.shot.title} + by {player.name} + + @@ -123,6 +128,14 @@ var ShotDetails = React.createClass({ end: 0 }); }, + + selectPlayer: function(player: Object) { + this.props.navigator.push({ + component: Player, + passProps: {player}, + title: player.name + }); + }, }); var styles = StyleSheet.create({ @@ -155,14 +168,14 @@ var styles = StyleSheet.create({ color: '#ea4c89', lineHeight: 18 }, - shotAuthorContent: { + playerContent: { fontSize: 12 }, - shotAuthor: { + player: { fontWeight: '900', lineHeight: 18 }, - shotAuthorAvatar: { + playerAvatar: { borderRadius: 40, width: 80, height: 80,