forked from vergnet/application-amicale
Display club managers status
This commit is contained in:
parent
784872ed96
commit
c148529b94
4 changed files with 20 additions and 4 deletions
|
@ -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>
|
||||
|
|
|
@ -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}
|
||||
/>}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue