Skip to content

Commit

Permalink
Merge pull request #73 from jbkuczma/v2.3
Browse files Browse the repository at this point in the history
v2.3
  • Loading branch information
jbkuczma authored May 6, 2018
2 parents 80984c2 + 3fb357f commit bc3b8a1
Show file tree
Hide file tree
Showing 25 changed files with 749 additions and 111 deletions.
Binary file added App/Assets/icons/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 41 additions & 51 deletions App/NBAreact.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,31 @@
import React, { Component } from 'react'
import { Text, View, Image } from 'react-native'
import { StackNavigator, TabNavigator } from 'react-navigation'
import { StackNavigator, TabNavigator, NavigationActions } from 'react-navigation'

import ScoresScreen from './components/ScoresScreen'
import GameDetailScreen from './components/GameDetailScreen'
import StandingsScreen from './components/StandingsScreen'
import TeamScreen from './components/TeamScreen'
import PlayerScreen from './components/PlayerScreen'
import PlayerGameDetailScreen from './components/PlayerGameDetailScreen'
import TeamStats from './components/GameDetailScreen/TeamStats'
import BoxScore from './components/GameDetailScreen/BoxScore'
import PlayByPlay from './components/GameDetailScreen/PlayByPlay'
import LeagueLeaders from './components/LeagueLeaders'

import SearchBar from './components/common/SearchBar'

const defaultNavigationOptions = {
headerTintColor: '#D3D3D3',
headerStyle: {
backgroundColor: '#171717',
borderBottomWidth: 0
},
headerTitleStyle: {
fontSize: 18,
}
}

const GameDetailNavigator = TabNavigator({
'Team Stats': { screen: TeamStats },
'Boxscore': { screen: BoxScore },
Expand Down Expand Up @@ -53,16 +65,7 @@ const ScoresStack = StackNavigator({
},
Game: {
screen: GameDetailNavigator,
navigationOptions: {
headerTintColor: '#D3D3D3',
headerStyle: {
backgroundColor: '#171717',
borderBottomWidth: 0
},
headerTitleStyle: {
fontSize: 18,
}
}
navigationOptions: defaultNavigationOptions
}
})

Expand All @@ -73,42 +76,19 @@ const StandingsStack = StackNavigator({
},
Team: {
screen: TeamScreen,
navigationOptions: {
headerTintColor: '#D3D3D3',
headerStyle: {
backgroundColor: '#171717',
borderBottomWidth: 0
},
headerTitleStyle: {
fontSize: 18,
}
}
navigationOptions: defaultNavigationOptions
},
Player: {
screen: PlayerScreen,
navigationOptions: {
headerTintColor: '#D3D3D3',
headerStyle: {
backgroundColor: '#171717',
borderBottomWidth: 0
},
headerTitleStyle: {
fontSize: 18,
}
}
navigationOptions: defaultNavigationOptions
},
Game: {
screen: GameDetailNavigator,
navigationOptions: {
headerTintColor: '#D3D3D3',
headerStyle: {
backgroundColor: '#171717',
borderBottomWidth: 0
},
headerTitleStyle: {
fontSize: 18,
}
}
navigationOptions: defaultNavigationOptions
},
PlayerGameDetail: {
screen: PlayerGameDetailScreen,
navigationOptions: defaultNavigationOptions
}
})

Expand All @@ -123,16 +103,11 @@ const LeagueLeadersStack = StackNavigator({
},
Player: {
screen: PlayerScreen,
navigationOptions: {
headerTintColor: '#D3D3D3',
headerStyle: {
backgroundColor: '#171717',
borderBottomWidth: 0
},
headerTitleStyle: {
fontSize: 18,
}
}
navigationOptions: defaultNavigationOptions
},
PlayerGameDetail: {
screen: PlayerGameDetailScreen,
navigationOptions: defaultNavigationOptions
}
})

Expand All @@ -157,6 +132,21 @@ export default TabNavigator({

return <Image source={iconName} style={[ iconStyle, { tintColor: tintColor }]} />
},

// NOTE: this works as intended however there are side effects that I'm not comfortable releasing yet
// tabBarOnPress: ({ scene, jumpToIndex }) => {
// const { route, focused, index } = scene
// if (focused) {
// if (route.index > 0) {
// const { routeName, key } = route.routes[1]
// navigation.dispatch(
// NavigationActions.back({ key })
// )
// }
// } else {
// jumpToIndex(index)
// }
// },
}),
tabBarOptions: {
activeTintColor: '#F7971E',
Expand Down
4 changes: 3 additions & 1 deletion App/components/GameDetailScreen/BoxScore/BoxScore.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ class BoxScore extends Component<Props> {
}
{
!this.state.loading && this.state.boxscore.activePlayers && this.props.playersInLeague &&
this._createBoxscoreTable(this.state.boxscore)
<ScrollView horizontal={true} contentContainerStyle={{justifyContent: 'center', alignItems: 'center',flexDirection: 'column'}}>
{ this._createBoxscoreTable(this.state.boxscore) }
</ScrollView>
}
{
!this.state.loading && !this.state.boxscore.activePlayers &&
Expand Down
3 changes: 2 additions & 1 deletion App/components/GameDetailScreen/BoxScore/PlayerBoxCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ const styles = StyleSheet.create({
},
boxscoreText: {
textAlign: 'center',
color: '#D3D3D3'
color: '#D3D3D3',
fontFamily: 'Rubik-Light'
},
boxscoreStatNameView: {
width: 140,
Expand Down
3 changes: 2 additions & 1 deletion App/components/GameDetailScreen/PlayByPlay/PlayByPlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ const styles = StyleSheet.create({
},
playByPlayText: {
textAlign: 'center',
color: '#D3D3D3'
color: '#D3D3D3',
fontFamily: 'Rubik-Light'
}
})

Expand Down
20 changes: 15 additions & 5 deletions App/components/GameDetailScreen/TeamStats/TeamStats.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
import React, { Component } from 'react'
import { Text, View, StatusBar, StyleSheet, ScrollView, Dimensions } from 'react-native'
import { Text, View, StatusBar, StyleSheet, ScrollView, Dimensions, TouchableOpacity, Image } from 'react-native'
import { connect } from 'react-redux'
import NBA from '../../../utils/nba'
import TeamMap from '../../../utils/TeamMap'
import Loader from '../../common/Loader'
import RefreshButton from '../../common/RefreshButton'
import LeadTracker from './LeadTracker'
import TeamStatsTable from './TeamStatsTable'
import QuarterScores from './QuarterScores'

class TeamStats extends Component<Props> {

static navigationOptions = ({ navigation }) => ({
headerTitle: `${navigation.state.params.title}`
headerTitle: `${navigation.state.params.title}`,
headerRight: (
<RefreshButton
handleRefresh={navigation.state.params.handleRefresh}
/>
)
})

constructor() {
Expand All @@ -27,10 +33,12 @@ class TeamStats extends Component<Props> {
}

componentDidMount() {
// we can now call fetchGameStats via navigation.state.params.handleRefresh
this.props.navigation.setParams({ handleRefresh: this.fetchGameStats })
this.fetchGameStats()
}

fetchGameStats() {
fetchGameStats = () => {
Promise.all([
this.nba.getBoxscore(this.props.gameID, this.props.date),
this.nba.getLeadTrackerForGame(this.props.gameID, this.props.date),
Expand Down Expand Up @@ -104,12 +112,14 @@ class TeamStats extends Component<Props> {
const styles = StyleSheet.create({
text: {
textAlign: 'center',
color: '#D3D3D3'
color: '#D3D3D3',
fontFamily: 'Rubik-Light'
},
text18pt: {
textAlign: 'center',
color: '#D3D3D3',
fontSize: 18
fontSize: 18,
fontFamily: 'Rubik-Light'
},
defaultCenteredView: {
flex: 1,
Expand Down
3 changes: 2 additions & 1 deletion App/components/GameDetailScreen/TeamStats/TeamStatsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ class TeamStatsTable extends Component<Props> {
const styles = StyleSheet.create({
text: {
textAlign: 'center',
color: '#D3D3D3'
color: '#D3D3D3',
// fontFamily: 'Rubik-Light'
}
})

Expand Down
Loading

0 comments on commit bc3b8a1

Please sign in to comment.