From 18243c642e6d636be510acb62e095509b5487679 Mon Sep 17 00:00:00 2001 From: pierrbt Date: Thu, 6 Nov 2025 14:32:22 +0100 Subject: [PATCH 1/3] fix: change tutorinsa links --- src/constants/Urls.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/constants/Urls.tsx b/src/constants/Urls.tsx index 3c02260b..5e07afef 100644 --- a/src/constants/Urls.tsx +++ b/src/constants/Urls.tsx @@ -31,6 +31,8 @@ const PROXIMO_IMAGES_ENDPOINT = const APP_IMAGES_ENDPOINT = STUDENT_SERVER + '~amicale_app/images/'; const PROXIWASH_ENDPOINT = 'https://www.proxiwash.com/laverie?code='; +const TUTORINSA_INSTAGRAM = 'tutor_insa_t'; + export default { amicale: { api: AMICALE_ENDPOINT, @@ -89,7 +91,8 @@ export default { bluemind: 'https://etud-mel.insa-toulouse.fr/webmail/', elusEtudiants: STUDENT_SERVER + '~eeinsat/', ent: 'https://ent.insa-toulouse.fr/', - tutorInsa: STUDENT_SERVER + '~tutorinsa/', + tutorInsa: 'https://www.instagram.com/' + TUTORINSA_INSTAGRAM, + tutorInsaDeepLink: 'instagram://user?username=' + TUTORINSA_INSTAGRAM, wiketud: 'https://wiki.etud.insa-toulouse.fr/', usefulLinks: 'https://wiki.etud.insa-toulouse.fr/books/liens-utiles', yearlyPlanning: From 70b20510306b75e87563e34eee290d2b1ac8ba37 Mon Sep 17 00:00:00 2001 From: pierrbt Date: Thu, 6 Nov 2025 14:32:49 +0100 Subject: [PATCH 2/3] feat: launch tutorinsa directly in instagram --- src/utils/Services.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/utils/Services.ts b/src/utils/Services.ts index 2b01dcb2..ad7457b6 100644 --- a/src/utils/Services.ts +++ b/src/utils/Services.ts @@ -21,7 +21,7 @@ import type { FullDashboardType } from '../screens/Home/HomeScreen'; import Urls from '../constants/Urls'; import { MainRoutes } from '../navigation/MainNavigator'; import { TabRoutes } from '../navigation/TabNavigator'; - +import { Linking } from 'react-native'; /** * Gets the given services list without items of the given ids * @@ -191,11 +191,18 @@ export function getStudentServices( title: "Tutor'INSA", subtitle: i18n.t('screens.services.descriptions.tutorInsa'), image: Urls.images.tutorInsa, - onPress: () => - onPress(MainRoutes.Website, { - host: Urls.websites.tutorInsa, - title: "Tutor'INSA", - }), + onPress: () => { + Linking.canOpenURL(Urls.websites.tutorInsaDeepLink) + .then((supported) => { + console.log(`Instagram deep link supported: ${supported}`); + if (supported) { + return Linking.openURL(Urls.websites.tutorInsaDeepLink); + } else { + return Linking.openURL(Urls.websites.tutorInsa); + } + }) + .catch(() => Linking.openURL(Urls.websites.tutorInsa)); + }, badgeFunction: (dashboard: FullDashboardType): number => dashboard.available_tutorials, }, From 98558aed9ad88ecf58eb27cf79bdc9c882f028a2 Mon Sep 17 00:00:00 2001 From: pierrbt Date: Thu, 20 Nov 2025 16:45:55 +0100 Subject: [PATCH 3/3] chore: run lint-fix --- src/utils/Services.ts | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/utils/Services.ts b/src/utils/Services.ts index ad7457b6..28af4dac 100644 --- a/src/utils/Services.ts +++ b/src/utils/Services.ts @@ -193,16 +193,16 @@ export function getStudentServices( image: Urls.images.tutorInsa, onPress: () => { Linking.canOpenURL(Urls.websites.tutorInsaDeepLink) - .then((supported) => { - console.log(`Instagram deep link supported: ${supported}`); - if (supported) { - return Linking.openURL(Urls.websites.tutorInsaDeepLink); - } else { - return Linking.openURL(Urls.websites.tutorInsa); - } - }) - .catch(() => Linking.openURL(Urls.websites.tutorInsa)); - }, + .then((supported: boolean) => { + console.log(`Instagram deep link supported: ${supported}`); + if (supported) { + return Linking.openURL(Urls.websites.tutorInsaDeepLink); + } else { + return Linking.openURL(Urls.websites.tutorInsa); + } + }) + .catch(() => Linking.openURL(Urls.websites.tutorInsa)); + }, badgeFunction: (dashboard: FullDashboardType): number => dashboard.available_tutorials, },