Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
* Added: Licenses
* Updated: Footer
* Updated: Profile
  • Loading branch information
EvanBacon committed Jul 8, 2018
1 parent 1e68eee commit 1f35332
Show file tree
Hide file tree
Showing 20 changed files with 704 additions and 335 deletions.
69 changes: 35 additions & 34 deletions AppNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import LeaderboardScreen from './ExpoParty/screens/LeaderboardScreen';
import ProfileScreen from './ExpoParty/screens/ProfileScreen';
import ReportScreen from './ExpoParty/screens/ReportScreen';
import GameScreen from './screens/GameScreen';

import Licenses from './components/Licenses';
const themedHeaderProps = {
headerTintColor: 'white',
headerStyle: {
Expand All @@ -17,39 +17,39 @@ const themedHeaderProps = {
headerTitleStyle: { color: 'white' },
};

const PartyTabNavigator = LeaderboardScreen;
// const PartyTabNavigator = createMaterialBottomTabNavigator(
// {
// Achievement: {
// screen: AchievementScreen,
// navigationOptions: () => ({
// tabBarColor: '#9013FE',
// tabBarIcon: tabBarIcon('star'),
// }),
// },
// Leaderboard: {
// screen: LeaderboardScreen,
// navigationOptions: () => ({
// tabBarColor: '#2962ff',
// tabBarIcon: tabBarIcon('show-chart'),
// }),
// },
// },
// {
// shifting: true,
// const PartyTabNavigator = LeaderboardScreen;
const PartyTabNavigator = createMaterialBottomTabNavigator(
{
Leaderboard: {
screen: LeaderboardScreen,
navigationOptions: () => ({
tabBarColor: '#2962ff',
tabBarIcon: tabBarIcon('show-chart'),
}),
},
Achievement: {
screen: AchievementScreen,
navigationOptions: () => ({
tabBarColor: '#9013FE',
tabBarIcon: tabBarIcon('star'),
}),
},
},
{
shifting: true,

// initialRouteName: 'Leaderboard',
// activeTintColor: '#f0edf6',
// inactiveTintColor: '#3e2465',
// barStyle: { backgroundColor: '#694fad' },
initialRouteName: 'Leaderboard',
activeTintColor: '#f0edf6',
inactiveTintColor: '#3e2465',
barStyle: { backgroundColor: '#694fad' },

// mode: 'modal',
// title: Constants.manifest.name,
// cardStyle: {
// backgroundColor: 'transparent',
// },
// },
// );
mode: 'modal',
title: Constants.manifest.name,
cardStyle: {
backgroundColor: 'transparent',
},
},
);

const ModalStack = createStackNavigator(
{
Expand All @@ -60,15 +60,16 @@ const ModalStack = createStackNavigator(
title: `Expo ${Constants.manifest.name}`,
},
},
Licenses,
Report: ReportScreen,
Profile: ProfileScreen,
},
{
navigationOptions: {
...themedHeaderProps,
},
// initialRouteName: 'Game',
initialRouteName: 'Leaderboard',
initialRouteName: 'Game',
// initialRouteName: 'Leaderboard',
// mode: 'modal',
// headerMode: 'none',
cardStyle: {
Expand Down
45 changes: 0 additions & 45 deletions ExpoParty/Navigator.js

This file was deleted.

13 changes: 7 additions & 6 deletions ExpoParty/components/List/Item.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ export default class Item extends React.Component {
const { index, onPress, style, ...props } = this.props;
let item = this.props.item || {};

const { name, score, rank, image } = item;

const { displayName, score, photoURL, rank: brokenRank, timestamp } = item;
let rank = index + 1;
console.log('FphotoURLphotoURLphotoURL', photoURL);
return (
<TouchableHighlight
underlayColor={'#eeeeee'}
Expand All @@ -23,15 +24,15 @@ export default class Item extends React.Component {
>
<View style={styles.container}>
<View style={{ flexDirection: 'row' }}>
<Text style={styles.rank}>{rank || index + 1}</Text>
<Text style={styles.rank}>{rank}</Text>
<Avatar
textStyle={{ fontWeight: 'bold' }}
avatarStyle={{ marginRight: 16 }}
name={name}
image={image}
name={displayName}
avatar={photoURL}
/>
<View>
<Text style={styles.text}>{name}</Text>
<Text style={styles.text}>{displayName}</Text>
<Text style={styles.subtitle}>{score} Points</Text>
</View>
</View>
Expand Down
10 changes: 5 additions & 5 deletions ExpoParty/components/List/UserCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export default class UserCell extends React.Component {
return <View />;
}

const { name, score, rank, image } = item;

const { displayName: name, score, rank, photoURL: image } = item;
const _rank = rank || index + 1;
return (
<TouchableHighlight
underlayColor={'#eeeeee'}
Expand All @@ -37,12 +37,12 @@ export default class UserCell extends React.Component {
textStyle={{ fontWeight: 'bold' }}
avatarStyle={{ marginRight: 16 }}
name={name}
image={image}
avatar={image}
/>
<View styles={{ alignItems: 'flex-start' }}>
<Text style={styles.rank}>{rank || index + 1}</Text>
<Text style={styles.rank}>{name}</Text>
<Text style={styles.text}>
{name} <Text style={styles.subtitle}>{score} Points</Text>
<Text style={styles.subtitle}>{score} Points</Text>
</Text>
</View>
</View>
Expand Down
33 changes: 29 additions & 4 deletions ExpoParty/components/List/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { FlatList, View, StyleSheet } from 'react-native';
import { FlatList, Text, View, StyleSheet } from 'react-native';

import { Platform, Dimensions } from 'react-native';
import { Constants } from 'expo';
Expand Down Expand Up @@ -33,6 +33,20 @@ class List extends React.Component {
}

keyExtractor = (item, index) => `item-${index}`;

get footer() {
if (this.props.noMore) {
return null;
}

return footerProps => (
<Footer
{...footerProps}
item={this.props.userItem}
onPress={this.props.onPressFooter}
/>
);
}
render() {
const {
style,
Expand All @@ -42,17 +56,28 @@ class List extends React.Component {
onPressFooter,
onPress,
headerButtonTitle,
noMore,
...props
} = this.props;
return (
<View style={{ flex: 1 }}>
<FlatList
style={[style, styles.container]}
keyExtractor={this.keyExtractor}
ListFooterComponent={footerProps => (
<Footer {...footerProps} item={userItem} onPress={onPressFooter} />
)}
ListFooterComponent={this.footer}
ItemSeparatorComponent={Separator}
ListEmptyComponent={
<View
style={{
justifyContent: 'center',
flex: 1,
height: Dimensions.get('window').height,
alignItems: 'center',
}}
>
<Text style={{ fontSize: 24 }}>Coming Soon</Text>
</View>
}
renderItem={this.renderItem}
{...props}
/>
Expand Down
78 changes: 39 additions & 39 deletions ExpoParty/screens/AchievementScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,45 @@ import UserAchievementsItem from '../components/UserAchievementsItem';
import connectAchievementToast from '../connectAchievementToast';

const data = [
{
name: '1st Gold',
subtitle: 'Finish a level with a gold record.',
points: 50,
image: null,
complete: true,
},
{
name: '1st Silver',
subtitle: 'Finish a level with a silver record.',
points: 25,
image: null,
complete: false,
},
{
name: '1st Bronze',
subtitle: 'Finish a level with a bronze record.',
points: 10,
image: null,
},
{
name: 'get your s-w-a-g-agger up',
subtitle: 'Finish a level with all the apples.',
points: 100,
image: null,
complete: true,
},
{
name: 'just like a fender bender',
subtitle: 'Finish a level with all the apples.',
points: 10,
image: null,
},
{
name: 'red like dodgeball',
subtitle: 'Finish a level with all the apples.',
points: 50,
image: null,
},
// {
// name: '1st Gold',
// subtitle: 'Finish a level with a gold record.',
// points: 50,
// image: null,
// complete: true,
// },
// {
// name: '1st Silver',
// subtitle: 'Finish a level with a silver record.',
// points: 25,
// image: null,
// complete: false,
// },
// {
// name: '1st Bronze',
// subtitle: 'Finish a level with a bronze record.',
// points: 10,
// image: null,
// },
// {
// name: 'get your s-w-a-g-agger up',
// subtitle: 'Finish a level with all the apples.',
// points: 100,
// image: null,
// complete: true,
// },
// {
// name: 'just like a fender bender',
// subtitle: 'Finish a level with all the apples.',
// points: 10,
// image: null,
// },
// {
// name: 'red like dodgeball',
// subtitle: 'Finish a level with all the apples.',
// points: 50,
// image: null,
// },
].map((user, index) => {
return {
...user,
Expand Down
Loading

0 comments on commit 1f35332

Please sign in to comment.