Compare commits
No commits in common. "2e4fa2089564ddbf9447d0b5e5d937197b23e2d8" and "71f39a64cc103d948131c3d36bf2891edb115ed8" have entirely different histories.
2e4fa20895
...
71f39a64cc
7 changed files with 19 additions and 57 deletions
|
|
@ -32,6 +32,7 @@ class AuthenticatedScreen extends React.Component<Props, State> {
|
||||||
this.props.navigation.addListener('focus', this.onScreenFocus);
|
this.props.navigation.addListener('focus', this.onScreenFocus);
|
||||||
this.fetchedData = new Array(this.props.links.length);
|
this.fetchedData = new Array(this.props.links.length);
|
||||||
this.errors = new Array(this.props.links.length);
|
this.errors = new Array(this.props.links.length);
|
||||||
|
this.fetchData(); // TODO remove in prod (only use for fast refresh)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -236,16 +236,6 @@ function ProfileStackComponent() {
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ClubStack.Screen
|
|
||||||
name="club-information"
|
|
||||||
component={ClubDisplayScreen}
|
|
||||||
options={({navigation}) => {
|
|
||||||
return {
|
|
||||||
title: i18n.t('screens.clubDisplayScreen'),
|
|
||||||
...TransitionPresets.ModalSlideFromBottomIOS,
|
|
||||||
};
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</ProfileStack.Navigator>
|
</ProfileStack.Navigator>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -300,7 +290,7 @@ function ClubStackComponent() {
|
||||||
component={ClubDisplayScreen}
|
component={ClubDisplayScreen}
|
||||||
options={({navigation}) => {
|
options={({navigation}) => {
|
||||||
return {
|
return {
|
||||||
title: i18n.t('screens.clubDisplayScreen'),
|
title: "",
|
||||||
...TransitionPresets.ModalSlideFromBottomIOS,
|
...TransitionPresets.ModalSlideFromBottomIOS,
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
@ -310,7 +300,7 @@ function ClubStackComponent() {
|
||||||
component={ClubAboutScreen}
|
component={ClubAboutScreen}
|
||||||
options={({navigation}) => {
|
options={({navigation}) => {
|
||||||
return {
|
return {
|
||||||
title: i18n.t('screens.about'),
|
title: "ABOUT",
|
||||||
...TransitionPresets.ModalSlideFromBottomIOS,
|
...TransitionPresets.ModalSlideFromBottomIOS,
|
||||||
};
|
};
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,6 @@ class ClubDisplayScreen extends React.Component<Props, State> {
|
||||||
getScreen = (data: Object) => {
|
getScreen = (data: Object) => {
|
||||||
console.log('fetchedData passed to screen:');
|
console.log('fetchedData passed to screen:');
|
||||||
console.log(data);
|
console.log(data);
|
||||||
console.log("Using fake data");
|
|
||||||
data = FakeClub;
|
data = FakeClub;
|
||||||
this.updateHeaderTitle(data);
|
this.updateHeaderTitle(data);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ class ProfileScreen extends React.Component<Props, State> {
|
||||||
return this.getPersonalCard();
|
return this.getPersonalCard();
|
||||||
case '1':
|
case '1':
|
||||||
return this.getClubCard();
|
return this.getClubCard();
|
||||||
default:
|
case '2':
|
||||||
return this.getMembershipCar();
|
return this.getMembershipCar();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -164,39 +164,20 @@ class ProfileScreen extends React.Component<Props, State> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
openClubDetailsScreen(id: number) {
|
|
||||||
this.props.navigation.navigate("club-information", {clubId: id});
|
|
||||||
}
|
|
||||||
|
|
||||||
clubListItem = ({item}: Object) => {
|
|
||||||
const onPress = () => this.openClubDetailsScreen(0); // TODO get club id
|
|
||||||
const isManager = false; // TODO detect if manager
|
|
||||||
let description = i18n.t("profileScreen.isMember");
|
|
||||||
let icon = (props) => <List.Icon {...props} icon="chevron-right"/>;
|
|
||||||
if (isManager) {
|
|
||||||
description = i18n.t("profileScreen.isManager");
|
|
||||||
icon = (props) => <List.Icon {...props} icon="star" color={this.colors.primary}/>;
|
|
||||||
}
|
|
||||||
return <List.Item
|
|
||||||
title={item.name}
|
|
||||||
description={description}
|
|
||||||
left={icon}
|
|
||||||
onPress={onPress}
|
|
||||||
/>;
|
|
||||||
};
|
|
||||||
|
|
||||||
clubKeyExtractor = (item: Object) => item.name;
|
|
||||||
|
|
||||||
getClubList(list: Array<string>) {
|
getClubList(list: Array<string>) {
|
||||||
let dataset = [];
|
let dataset = [];
|
||||||
for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
dataset.push({name: list[i]});
|
dataset.push({name: list[i]});
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
//$FlowFixMe
|
|
||||||
<FlatList
|
<FlatList
|
||||||
renderItem={this.clubListItem}
|
renderItem={({item}) =>
|
||||||
keyExtractor={this.clubKeyExtractor}
|
<List.Item
|
||||||
|
title={item.name}
|
||||||
|
left={props => <List.Icon {...props} icon="chevron-right"/>}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
keyExtractor={item => item.name}
|
||||||
data={dataset}
|
data={dataset}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,7 @@ const FAKE_TEAMS2 = {
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
type Props = {
|
type Props = {}
|
||||||
navigation: Object
|
|
||||||
}
|
|
||||||
|
|
||||||
type State = {
|
type State = {
|
||||||
hasVoted: boolean,
|
hasVoted: boolean,
|
||||||
|
|
@ -137,12 +135,9 @@ export default class VoteScreen extends React.Component<Props, State> {
|
||||||
return null;
|
return null;
|
||||||
};
|
};
|
||||||
|
|
||||||
getScreen = (data: Array<Object | null>) => {
|
getScreen = (data: Array<Object>) => {
|
||||||
// data[0] = FAKE_TEAMS2;
|
data[0] = FAKE_TEAMS2;
|
||||||
// data[1] = FAKE_DATE;
|
data[1] = FAKE_DATE;
|
||||||
|
|
||||||
if (data[1] === null)
|
|
||||||
data[1] = {date_begin: null};
|
|
||||||
|
|
||||||
if (data[0] !== null) {
|
if (data[0] !== null) {
|
||||||
this.teams = data[0].teams;
|
this.teams = data[0].teams;
|
||||||
|
|
|
||||||
|
|
@ -220,10 +220,8 @@
|
||||||
"personalInformation": "Personal information",
|
"personalInformation": "Personal information",
|
||||||
"noData": "No data",
|
"noData": "No data",
|
||||||
"editInformation": "Edit Information",
|
"editInformation": "Edit Information",
|
||||||
"clubs": "Your clubs",
|
"clubs": "Clubs",
|
||||||
"clubsSubtitle": "Click on a club to show its information",
|
"clubsSubtitle": "Clubs you are part of",
|
||||||
"isMember": "Member",
|
|
||||||
"isManager": "Manager",
|
|
||||||
"membership": "Membership Fee",
|
"membership": "Membership Fee",
|
||||||
"membershipSubtitle": "Allows you to take part in various activities",
|
"membershipSubtitle": "Allows you to take part in various activities",
|
||||||
"membershipPayed": "Payed",
|
"membershipPayed": "Payed",
|
||||||
|
|
|
||||||
|
|
@ -220,10 +220,8 @@
|
||||||
"personalInformation": "Informations Personnelles",
|
"personalInformation": "Informations Personnelles",
|
||||||
"noData": "Pas de données",
|
"noData": "Pas de données",
|
||||||
"editInformation": "Modifier les informations",
|
"editInformation": "Modifier les informations",
|
||||||
"clubs": "Vos clubs",
|
"clubs": "Clubs",
|
||||||
"clubsSubtitle": "Cliquez sur un club pour afficher ses informations",
|
"clubsSubtitle": "Liste de vos clubs",
|
||||||
"isMember": "Membre",
|
|
||||||
"isManager": "Responsable",
|
|
||||||
"membership": "Cotisation",
|
"membership": "Cotisation",
|
||||||
"membershipSubtitle": "Permet de participer à diverses activités",
|
"membershipSubtitle": "Permet de participer à diverses activités",
|
||||||
"membershipPayed": "Payée",
|
"membershipPayed": "Payée",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue