Browse Source

Display club managers status

Arnaud Vergnet 4 years ago
parent
commit
c148529b94

+ 4
- 2
screens/Amicale/ClubDisplayScreen.js View File

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

+ 12
- 0
screens/Amicale/ClubListScreen.js View File

@@ -64,6 +64,7 @@ class ClubListScreen extends React.Component<Props, State> {
64 64
     getRenderItem = ({item}: Object) => {
65 65
         const onPress = this.onListItemPress.bind(this, item);
66 66
         const categoriesRender = this.getCategoriesRender.bind(this, item.category);
67
+        const hasManagers = item.responsibles.length > 0;
67 68
         return (
68 69
             <List.Item
69 70
                 title={item.name}
@@ -74,6 +75,17 @@ class ClubListScreen extends React.Component<Props, State> {
74 75
                     style={{backgroundColor: 'transparent'}}
75 76
                     size={64}
76 77
                     source={{uri: item.logo}}/>}
78
+                right={(props) => <Avatar.Icon
79
+                    {...props}
80
+                    style={{
81
+                        marginTop: 'auto',
82
+                        marginBottom: 'auto',
83
+                        backgroundColor: 'transparent',
84
+                    }}
85
+                    size={48}
86
+                    icon={hasManagers ? "check-circle-outline" : "alert-circle-outline"}
87
+                    color={hasManagers ? this.colors.success : this.colors.primary}
88
+                />}
77 89
             />
78 90
         );
79 91
     };

+ 2
- 1
translations/en.json View File

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

+ 2
- 1
translations/fr.json View File

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

Loading…
Cancel
Save