diff --git a/components/SideMenu.js b/components/SideMenu.js index 6de1858..503ac3b 100644 --- a/components/SideMenu.js +++ b/components/SideMenu.js @@ -10,8 +10,9 @@ const deviceHeight = Dimensions.get("window").height; const drawerCover = require("../assets/drawer-cover.png"); -const WIKETUD_LINK = "https://www.etud.insa-toulouse.fr/wiketud/index.php/Accueil"; +const WIKETUD_LINK = "https://www.etud.insa-toulouse.fr/wiketud"; const Amicale_LINK = "https://www.etud.insa-toulouse.fr/~amicale"; +const TIMETABLE_LINK = "http://planex.insa-toulouse.fr"; type Props = { navigation: Object, @@ -73,14 +74,23 @@ export default class SideBar extends React.Component { route: "amicale", icon: "web", bg: "#477EEA", + link: Amicale_LINK + // types: "11" + }, + { + name: i18n.t('screens.timetable'), + route: "timetable", + icon: "timetable", + bg: "#477EEA", + link: TIMETABLE_LINK // types: "11" }, - { name: "Wiketud", route: "wiketud", - icon: "web", + icon: "wikipedia", bg: "#477EEA", + link: WIKETUD_LINK // types: "11" }, { @@ -129,12 +139,10 @@ export default class SideBar extends React.Component { noBorder={item.name !== 'Wiketud' && item.name !== 'Proximo'} // Display a separator before settings and Amicale selected={this.state.active === item.route} onPress={() => { - if (item.name !== 'Wiketud' && item.name !== 'Amicale') + if (item.link !== undefined) + Linking.openURL(item.link).catch((err) => console.error('Error opening link', err)); + else this.navigateToScreen(item.route); - else if (item.name === 'Wiketud') - Linking.openURL(WIKETUD_LINK).catch((err) => console.error('Error opening link', err)); - else if (item.name === 'Amicale') - Linking.openURL(Amicale_LINK).catch((err) => console.error('Error opening link', err)); }} > diff --git a/translations/en.json b/translations/en.json index 30aa158..cbd3904 100644 --- a/translations/en.json +++ b/translations/en.json @@ -4,6 +4,7 @@ "planning": "Planning", "proxiwash": "Proxiwash", "proximo": "Proximo", + "timetable": "Timetable", "settings": "Settings", "about": "About" }, diff --git a/translations/fr.json b/translations/fr.json index 891b5b1..285bfd5 100644 --- a/translations/fr.json +++ b/translations/fr.json @@ -4,6 +4,7 @@ "planning": "Planning", "proxiwash": "Proxiwash", "proximo": "Proximo", + "timetable": "Emploi du temps", "settings": "Paramètres", "about": "À Propos" }, diff --git a/utils/WebDataManager.js b/utils/WebDataManager.js index b8629e4..0bca315 100644 --- a/utils/WebDataManager.js +++ b/utils/WebDataManager.js @@ -29,12 +29,14 @@ export default class WebDataManager { showUpdateToast(successString, errorString) { let isSuccess = this.isDataObjectValid(); - Toast.show({ - text: isSuccess ? successString : errorString, - buttonText: 'OK', - type: isSuccess ? "success" : "danger", - duration: 2000 - }) + if (!isSuccess) { + Toast.show({ + text: isSuccess ? successString : errorString, + buttonText: 'OK', + type: isSuccess ? "success" : "danger", + duration: 2000 + }); + } } }