Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/constants/Urls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down
19 changes: 13 additions & 6 deletions src/utils/Services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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: 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,
},
Expand Down
Loading