Browse Source

Fixed amicale category image

Arnaud Vergnet 3 years ago
parent
commit
3275b73708
1 changed files with 18 additions and 4 deletions
  1. 18
    4
      src/screens/Services/ServicesScreen.js

+ 18
- 4
src/screens/Services/ServicesScreen.js View File

24
 export type listItem = {
24
 export type listItem = {
25
     title: string,
25
     title: string,
26
     description: string,
26
     description: string,
27
-    image: string,
27
+    image: string | number,
28
     shouldLogin: boolean,
28
     shouldLogin: boolean,
29
     content: cardList,
29
     content: cardList,
30
 }
30
 }
31
 
31
 
32
+const AMICALE_LOGO = require("../../../assets/amicale.png");
33
+
32
 const CLUBS_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Clubs.png";
34
 const CLUBS_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Clubs.png";
33
 const PROFILE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/ProfilAmicaliste.png";
35
 const PROFILE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/ProfilAmicaliste.png";
34
 const VOTE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Vote.png";
36
 const VOTE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Vote.png";
151
             {
153
             {
152
                 title: i18n.t("servicesScreen.amicale"),
154
                 title: i18n.t("servicesScreen.amicale"),
153
                 description: "LOGIN",
155
                 description: "LOGIN",
154
-                image: AMICALE_IMAGE,
156
+                image: AMICALE_LOGO,
155
                 shouldLogin: true,
157
                 shouldLogin: true,
156
                 content: this.amicaleDataset
158
                 content: this.amicaleDataset
157
             },
159
             },
188
     /**
190
     /**
189
      * Gets the list title image for the list.
191
      * Gets the list title image for the list.
190
      *
192
      *
193
+     * If the source is a string, we are using an icon.
194
+     * If the source is a number, we are using an internal image.
195
+     *
191
      * @param props Props to pass to the component
196
      * @param props Props to pass to the component
192
-     * @param source The source image to display
197
+     * @param source The source image to display. Can be a string for icons or a number for local images
193
      * @returns {*}
198
      * @returns {*}
194
      */
199
      */
195
-    getListTitleImage(props, source: string) {
200
+    getListTitleImage(props, source: string | number) {
201
+        if (typeof source === "number")
196
             return <Avatar.Image
202
             return <Avatar.Image
197
                 {...props}
203
                 {...props}
198
                 size={48}
204
                 size={48}
199
                 source={source}
205
                 source={source}
200
                 style={{backgroundColor: 'transparent'}}
206
                 style={{backgroundColor: 'transparent'}}
201
             />
207
             />
208
+        else
209
+            return <Avatar.Icon
210
+                {...props}
211
+                size={48}
212
+                icon={source}
213
+                color={this.props.theme.colors.primary}
214
+                style={{backgroundColor: 'transparent'}}
215
+            />
202
     }
216
     }
203
 
217
 
204
     /**
218
     /**

Loading…
Cancel
Save