Display club managers status

This commit is contained in:
Arnaud Vergnet 2020-04-03 14:42:43 +02:00
parent 784872ed96
commit c148529b94
4 changed files with 20 additions and 4 deletions

View file

@ -66,14 +66,16 @@ class ClubDisplayScreen extends React.Component<Props, State> {
for (let i = 0; i < resp.length; i++) {
final.push(<Paragraph>{resp[i]}</Paragraph>)
}
const hasManagers = resp.length > 0;
return (
<Card style={{marginTop: 10, marginBottom: 10}}>
<Card.Title
title={i18n.t('clubs.managers')}
subtitle={i18n.t('clubs.managersSubtitle')}
subtitle={hasManagers ? i18n.t('clubs.managersSubtitle') : i18n.t('clubs.managersUnavailable')}
left={(props) => <Avatar.Icon
style={{backgroundColor: 'transparent'}}
{...props}
style={{backgroundColor: 'transparent'}}
color={hasManagers ? this.colors.success : this.colors.primary}
icon="account-tie"/>}
/>
<Card.Content>

View file

@ -64,6 +64,7 @@ class ClubListScreen extends React.Component<Props, State> {
getRenderItem = ({item}: Object) => {
const onPress = this.onListItemPress.bind(this, item);
const categoriesRender = this.getCategoriesRender.bind(this, item.category);
const hasManagers = item.responsibles.length > 0;
return (
<List.Item
title={item.name}
@ -74,6 +75,17 @@ class ClubListScreen extends React.Component<Props, State> {
style={{backgroundColor: 'transparent'}}
size={64}
source={{uri: item.logo}}/>}
right={(props) => <Avatar.Icon
{...props}
style={{
marginTop: 'auto',
marginBottom: 'auto',
backgroundColor: 'transparent',
}}
size={48}
icon={hasManagers ? "check-circle-outline" : "alert-circle-outline"}
color={hasManagers ? this.colors.success : this.colors.primary}
/>}
/>
);
};

View file

@ -245,7 +245,8 @@
"clubs": {
"clubList": "Club list",
"managers": "Managers",
"managersSubtitle": "These people make the club live"
"managersSubtitle": "These people make the club live",
"managersUnavailable": "This club has no one :("
},
"dialog": {
"ok": "OK",

View file

@ -246,7 +246,8 @@
"clubs": {
"clubList": "Liste des clubs",
"managers": "Responsables",
"managersSubtitle": "Ces personnes font vivre le club"
"managersSubtitle": "Ces personnes font vivre le club",
"managersUnavailable": "Ce club est tout seul :("
},
"dialog": {
"ok": "OK",