From 3275b73708a53dee1ab20aa3a510d7010868e29f Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Tue, 7 Jul 2020 18:49:40 +0200 Subject: [PATCH] Fixed amicale category image --- src/screens/Services/ServicesScreen.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/screens/Services/ServicesScreen.js b/src/screens/Services/ServicesScreen.js index ce8f2cd..653050c 100644 --- a/src/screens/Services/ServicesScreen.js +++ b/src/screens/Services/ServicesScreen.js @@ -24,11 +24,13 @@ type Props = { export type listItem = { title: string, description: string, - image: string, + image: string | number, shouldLogin: boolean, content: cardList, } +const AMICALE_LOGO = require("../../../assets/amicale.png"); + const CLUBS_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Clubs.png"; const PROFILE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/ProfilAmicaliste.png"; const VOTE_IMAGE = "https://etud.insa-toulouse.fr/~amicale_app/images/Vote.png"; @@ -151,7 +153,7 @@ class ServicesScreen extends React.Component { { title: i18n.t("servicesScreen.amicale"), description: "LOGIN", - image: AMICALE_IMAGE, + image: AMICALE_LOGO, shouldLogin: true, content: this.amicaleDataset }, @@ -188,17 +190,29 @@ class ServicesScreen extends React.Component { /** * Gets the list title image for the list. * + * If the source is a string, we are using an icon. + * If the source is a number, we are using an internal image. + * * @param props Props to pass to the component - * @param source The source image to display + * @param source The source image to display. Can be a string for icons or a number for local images * @returns {*} */ - getListTitleImage(props, source: string) { + getListTitleImage(props, source: string | number) { + if (typeof source === "number") return + else + return } /**