Compare commits
23 commits
3d482753ed
...
133df5bdb7
Author | SHA1 | Date | |
---|---|---|---|
|
133df5bdb7 | ||
|
c6bb1ccc86 | ||
|
3ff5a40f8d | ||
|
955eb11b84 | ||
|
47e749b528 | ||
|
2f94be64e5 | ||
|
a9a2b9150b | ||
|
a8b9fd49b7 | ||
|
2ed4fbd780 | ||
43cf7dc874 | |||
|
45f42902bc | ||
|
52fd1e943f | ||
09942b2fc5 | |||
|
9b26d045b3 | ||
|
e1bae05929 | ||
|
de98364082 | ||
|
973510fac0 | ||
f5c043dd7d | |||
ea7321eb9d | |||
dafd454a42 | |||
0dae9c08b5 | |||
d38f11d45f | |||
5a98f5506a |
|
@ -148,7 +148,7 @@ android {
|
||||||
applicationId 'fr.amicaleinsat.application'
|
applicationId 'fr.amicaleinsat.application'
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 41
|
versionCode 42
|
||||||
versionName "4.0.1"
|
versionName "4.0.1"
|
||||||
missingDimensionStrategy 'react-native-camera', 'general'
|
missingDimensionStrategy 'react-native-camera', 'general'
|
||||||
}
|
}
|
||||||
|
|
BIN
android/app/src/main/ic_launcher-playstore.png
Normal file
After Width: | Height: | Size: 28 KiB |
35
android/app/src/main/res/drawable/ic_launcher_foreground.xml
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
xmlns:aapt="http://schemas.android.com/aapt"
|
||||||
|
android:width="108dp"
|
||||||
|
android:height="108dp"
|
||||||
|
android:viewportWidth="108"
|
||||||
|
android:viewportHeight="108"
|
||||||
|
android:autoMirrored="true"
|
||||||
|
tools:ignore="VectorRaster">
|
||||||
|
<group android:scaleX="0.9327526"
|
||||||
|
android:scaleY="0.9327526"
|
||||||
|
android:translateX="-9.18"
|
||||||
|
android:translateY="-9.18">
|
||||||
|
<path
|
||||||
|
android:pathData="m66.726,45.46 l20.999,26.022 0.539,-27.06 84.903,83.371 -42.449,44.716 -83.531,-81.39z" android:strokeAlpha="0">
|
||||||
|
<aapt:attr name="android:fillColor">
|
||||||
|
<gradient
|
||||||
|
android:startY="60"
|
||||||
|
android:startX="60"
|
||||||
|
android:endY="100"
|
||||||
|
android:endX="100"
|
||||||
|
android:type="linear">
|
||||||
|
<item
|
||||||
|
android:color="#22000000"
|
||||||
|
android:offset="0.0" />
|
||||||
|
<item
|
||||||
|
android:color="#00000000"
|
||||||
|
android:offset="1.0" />
|
||||||
|
</gradient>
|
||||||
|
</aapt:attr>
|
||||||
|
</path>
|
||||||
|
<path android:fillColor="#fff"
|
||||||
|
android:pathData="m66.678,45.377 l19.491,45.744h-38.982zM76.093,44.347h12.186v31.47z" android:strokeAlpha="0"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
|
@ -0,0 +1,5 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@drawable/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
17
android/app/src/main/res/mipmap-anydpi/ic_notification.xml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:width="24dp"
|
||||||
|
android:height="24dp"
|
||||||
|
android:viewportWidth="24"
|
||||||
|
android:viewportHeight="24"
|
||||||
|
android:tint="#FFFFFF">
|
||||||
|
<group android:scaleX="0.12773363"
|
||||||
|
android:scaleY="0.12773363"
|
||||||
|
android:translateX="3.3479624"
|
||||||
|
android:translateY="3.3479624">
|
||||||
|
<path
|
||||||
|
android:pathData="m64.695,3.346 l56.134,131.74h-112.27zM91.81,0.379h35.096v90.634z"
|
||||||
|
android:strokeAlpha="0"
|
||||||
|
android:strokeWidth="2.88"
|
||||||
|
android:fillColor="#fff"/>
|
||||||
|
</group>
|
||||||
|
</vector>
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 5 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 823 B After Width: | Height: | Size: 340 B |
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 5.5 KiB |
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 969 B |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 6 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 3.2 KiB |
|
@ -0,0 +1,4 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#C32733</color>
|
||||||
|
</resources>
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 6 KiB |
BIN
assets/android.icon.round.png
Normal file
After Width: | Height: | Size: 13 KiB |
|
@ -128,7 +128,7 @@
|
||||||
"noGroupSelected": "No group selected. Please select your group using the big beautiful red button bellow.",
|
"noGroupSelected": "No group selected. Please select your group using the big beautiful red button bellow.",
|
||||||
"favorites": "Favorites",
|
"favorites": "Favorites",
|
||||||
"mascotDialog": {
|
"mascotDialog": {
|
||||||
"title": "Skipping classes is bad",
|
"title": "Don't skip class",
|
||||||
"message": "Here is Planex! You can set your class and your crush's to favorites in order to find them back easily!\n\nIf you mainly use Campus for Planex, go to the settings to make the app directly start on it!",
|
"message": "Here is Planex! You can set your class and your crush's to favorites in order to find them back easily!\n\nIf you mainly use Campus for Planex, go to the settings to make the app directly start on it!",
|
||||||
"ok": "Settings",
|
"ok": "Settings",
|
||||||
"cancel": "Later"
|
"cancel": "Later"
|
||||||
|
@ -346,23 +346,32 @@
|
||||||
"license": "License",
|
"license": "License",
|
||||||
"debug": "Debug",
|
"debug": "Debug",
|
||||||
"team": "Team",
|
"team": "Team",
|
||||||
"author": "Author and maintainer",
|
|
||||||
"authorMail": "Send an email",
|
|
||||||
"additionalDev": "Thanks",
|
|
||||||
"technologies": "Technologies",
|
"technologies": "Technologies",
|
||||||
"reactNative": "Made with React Native",
|
"reactNative": "Made with React Native",
|
||||||
"libs": "Libraries used"
|
"libs": "Libraries used",
|
||||||
|
"thanks": "Thanks",
|
||||||
|
"user": {
|
||||||
|
"youName": "You",
|
||||||
|
"you": "[NON TRADUIT] Toi aussi devient le prochaint dévelopeur à rejoindre la team, passe voir le git de l'application y'a tout plein d'info",
|
||||||
|
"arnaud": "[NON TRADUIT] Étudiant en IR (2020). C'est le créateur de cette magnifique application que t'utilise tout les jour. Et il est vraiment BG aussi.",
|
||||||
|
"yohan": "[NON TRADUIT] Étudiant en [Je sais pas quoi] (2020). Il nous aide à corriger les bug. Et j'imagine aussi qu'il est BG mais je le connait pas.",
|
||||||
|
"beranger": "[NON TRADUIT] Étudiant en AE (2020) et Président de l’Amicale au moment de la création et du lancement du projet. L’application, c’était son idée. Il a beaucoup aidé pour trouver des bugs, de nouvelles fonctionnalités et faire de la com.",
|
||||||
|
"celine": "[NON TRADUIT] Étudiante en GPE (2020). Sans elle, tout serait moins mignon. Elle a aidé pour écrire le texte, faire de la com, et aussi à créer la mascotte 🦊.",
|
||||||
|
"damien": "[NON TRADUIT] Étudiant en IR (2020) et créateur de la dernière version du site de l’Amicale. Grâce à son aide, intégrer les services de l’Amicale à l’application a été très simple.",
|
||||||
|
"titouan": "[NON TRADUIT] Étudiant en IR (2020). Il a beaucoup aidé pour trouver des bugs et proposer des nouvelles fonctionnalités.",
|
||||||
|
"theo": "[NON TRADUIT] Étudiant en AE (2020). Si l’application marche sur iOS, c’est grâce à son aide lors de ses nombreux tests."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"feedback": {
|
"feedback": {
|
||||||
"title": "Feedback",
|
"title": "Contribute",
|
||||||
"bugs": "Report Bugs",
|
"feedback": "Contact the dev",
|
||||||
"bugsSubtitle": "Did you find a bug? Let us know!",
|
"feedbackSubtitle": "A student like you!",
|
||||||
"bugsDescription": "Reporting bugs helps us make the app better. To do so, use one of the buttons below and be as precise as possible when describing your problem!",
|
"feedbackDescription": "Feedback or bugs, you are always welcome.\nChoose your preferred way from the buttons bellow.",
|
||||||
"feedbackSubtitle": "Let us know what you think!",
|
"contribute": "Contribute to the project",
|
||||||
"feedbackDescription": "Do you have a feature you want to be added/changed/removed, want to give your opinion on the app or simply chat with the dev? Use one of the links below!",
|
"contributeSubtitle": "With a possible \"implication citoyenne\"!",
|
||||||
"contactMeans": "Using Gitea is recommended, to use it simply login with your INSA account.",
|
"contributeDescription": "Everyone can help: communication, design or coding! You are free to contribute as you like.\nYou can find bellow a link to Trello for project organization, and a link to the source code on GitEtud.",
|
||||||
"homeButtonTitle": "Feedback/Bug report",
|
"homeButtonTitle": "Contribute to the project",
|
||||||
"homeButtonSubtitle": "Contact the devs"
|
"homeButtonSubtitle": "Your help is important"
|
||||||
},
|
},
|
||||||
"game": {
|
"game": {
|
||||||
"title": "So Awesome Game",
|
"title": "So Awesome Game",
|
||||||
|
@ -413,16 +422,16 @@
|
||||||
"text": "You can do much more with CAMPUS, but I can't explain everything here. Explore the app to find out!"
|
"text": "You can do much more with CAMPUS, but I can't explain everything here. Explore the app to find out!"
|
||||||
},
|
},
|
||||||
"slideDone": {
|
"slideDone": {
|
||||||
"title": "Your feedback is valuable!",
|
"title": "Contribute to the project!",
|
||||||
"text": "This app is the work of one student (with some help here and there), so your feedback is much appreciated!"
|
"text": "This app is the work of one student, so your feedback and your help are welcome!\nEveryone can help: communication, design or coding!"
|
||||||
},
|
},
|
||||||
"updateSlide0": {
|
"updateSlide0": {
|
||||||
"title": "New in this update!",
|
"title": "Hi you!",
|
||||||
"text": "Hello you! I'm here to help you around the app."
|
"text": "I'm new here and I will help you around the app. My thing is to give you lots of tips and tricks."
|
||||||
},
|
},
|
||||||
"updateSlide1": {
|
"updateSlide1": {
|
||||||
"title": "Contribute!",
|
"title": "Contribute to the project!",
|
||||||
"text": "Everyone is free to contribute to the project, from reporting bugs to implementing new features"
|
"text": "This app is the work of one student, so your feedback and your help are welcome!\nEveryone can help: communication, design or coding!"
|
||||||
},
|
},
|
||||||
"aprilFoolsSlide": {
|
"aprilFoolsSlide": {
|
||||||
"title": "New in this update!",
|
"title": "New in this update!",
|
||||||
|
|
|
@ -50,7 +50,7 @@
|
||||||
"paymentMethods": "Moyens de Paiement",
|
"paymentMethods": "Moyens de Paiement",
|
||||||
"paymentMethodsDescription": "Toute monnaie jusqu'à 10€.\nCarte bancaire acceptée.",
|
"paymentMethodsDescription": "Toute monnaie jusqu'à 10€.\nCarte bancaire acceptée.",
|
||||||
"washerProcedure": "Déposer le linge dans le tambour sans le tasser et en respectant les charges.\n\nFermer la porte de l'appareil.\n\nSélectionner un programme avec l'une des quatre touches de programme favori standard.\n\nAprès avoir payé à la centrale de commande, appuyer sur le bouton marqué START du lave-linge.\n\nDès que le programme est terminé, l’afficheur indique 'Programme terminé', appuyer sur le bouton jaune d’ouverture du hublot pour récupérer le linge.",
|
"washerProcedure": "Déposer le linge dans le tambour sans le tasser et en respectant les charges.\n\nFermer la porte de l'appareil.\n\nSélectionner un programme avec l'une des quatre touches de programme favori standard.\n\nAprès avoir payé à la centrale de commande, appuyer sur le bouton marqué START du lave-linge.\n\nDès que le programme est terminé, l’afficheur indique 'Programme terminé', appuyer sur le bouton jaune d’ouverture du hublot pour récupérer le linge.",
|
||||||
"washerTips": "Programme blanc/couleur : 6kg de linge sec (textiles en coton, lin, linge de corps, draps, jeans,serviettes de toilettes).\n\nProgramme nonrepassable : 3,5 kg de linge sec (textiles en fibres synthétiques, cotonet polyester mélangés).\n\nProgramme fin 30°C : 2,5 kg de linge sec (textiles délicats en fibres synthétiques, rayonne).\n\nProgramme laine 30°C : 2,5 kg de linge sec (textiles en laine et lainages lavables).",
|
"washerTips": "Programme blanc/couleur : 6kg de linge sec (textiles en coton, lin, linge de corps, draps, jeans,serviettes de toilettes).\n\nProgramme non repassable : 3,5 kg de linge sec (textiles en fibres synthétiques, coton et polyester mélangés).\n\nProgramme fin 30°C : 2,5 kg de linge sec (textiles délicats en fibres synthétiques, rayonne).\n\nProgramme laine 30°C : 2,5 kg de linge sec (textiles en laine et lainages lavables).",
|
||||||
"dryerProcedure": "Déposer le linge dans le tambour sans le tasser et en respectant les charges.\n\nFermer la porte de l'appareil.\n\nSélectionner un programme avec l'une des quatre touches de programme favori standard.\n\nAprès avoir payé à la centrale de commande, appuyer sur le bouton marqué START du lave-linge.",
|
"dryerProcedure": "Déposer le linge dans le tambour sans le tasser et en respectant les charges.\n\nFermer la porte de l'appareil.\n\nSélectionner un programme avec l'une des quatre touches de programme favori standard.\n\nAprès avoir payé à la centrale de commande, appuyer sur le bouton marqué START du lave-linge.",
|
||||||
"dryerTips": "La durée conseillée est de 35 minutes pour 14kg de linge. Vous pouvez choisir une durée plus courte si le sèche-linge n'est pas chargé.",
|
"dryerTips": "La durée conseillée est de 35 minutes pour 14kg de linge. Vous pouvez choisir une durée plus courte si le sèche-linge n'est pas chargé.",
|
||||||
"procedure": "Procédure",
|
"procedure": "Procédure",
|
||||||
|
@ -345,23 +345,32 @@
|
||||||
"license": "Licence",
|
"license": "Licence",
|
||||||
"debug": "Debug",
|
"debug": "Debug",
|
||||||
"team": "Équipe",
|
"team": "Équipe",
|
||||||
"author": "Auteur et mainteneur",
|
|
||||||
"authorMail": "Envoyer un mail",
|
|
||||||
"additionalDev": "Remerciements",
|
|
||||||
"technologies": "Technologies",
|
"technologies": "Technologies",
|
||||||
"reactNative": "Créé avec React Native",
|
"reactNative": "Créé avec React Native",
|
||||||
"libs": "Librairies utilisées"
|
"libs": "Librairies utilisées",
|
||||||
|
"thanks": "Remerciements",
|
||||||
|
"user": {
|
||||||
|
"youName": "Toi",
|
||||||
|
"you": "Toi aussi devient le prochaint dévelopeur à rejoindre la team, passe voir le git de l'application y'a tout plein d'info",
|
||||||
|
"arnaud": "Étudiant en IR (2020). C'est le créateur de cette magnifique application que t'utilise tout les jour. Et il est vraiment BG aussi.",
|
||||||
|
"yohan": "Étudiant en [Je sais pas quoi] (2020). Il nous aide à corriger les bug. Et j'imagine aussi qu'il est BG mais je le connait pas.",
|
||||||
|
"beranger": "Étudiant en AE (2020) et Président de l’Amicale au moment de la création et du lancement du projet. L’application, c’était son idée. Il a beaucoup aidé pour trouver des bugs, de nouvelles fonctionnalités et faire de la com.",
|
||||||
|
"celine": "Étudiante en GPE (2020). Sans elle, tout serait moins mignon. Elle a aidé pour écrire le texte, faire de la com, et aussi à créer la mascotte 🦊.",
|
||||||
|
"damien": "Étudiant en IR (2020) et créateur de la dernière version du site de l’Amicale. Grâce à son aide, intégrer les services de l’Amicale à l’application a été très simple.",
|
||||||
|
"titouan": "Étudiant en IR (2020). Il a beaucoup aidé pour trouver des bugs et proposer des nouvelles fonctionnalités.",
|
||||||
|
"theo": "Étudiant en AE (2020). Si l’application marche sur iOS, c’est grâce à son aide lors de ses nombreux tests."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"feedback": {
|
"feedback": {
|
||||||
"title": "Feedback",
|
"title": "Participer",
|
||||||
"bugs": "Rapporter des Bugs",
|
"feedback": "Contacte le développeur",
|
||||||
"bugsSubtitle": "Tu as trouvé un bug ?",
|
"feedbackSubtitle": "C'est un étudiant comme toi !",
|
||||||
"bugsDescription": "Rapporter les bugs m'aide à améliorer l'appli. Pour cela, merci d'utiliser un des boutons ci-dessous et de décrire ton problème le plus précisément possible !",
|
"feedbackDescription": "Que ce soit pour donner ton avis ou rapporter des bugs, tu es le bienvenue.\nUtilise le moyen de ton choix parmi les boutons ci-dessous.",
|
||||||
"feedbackSubtitle": "Dis moi ce que tu penses !",
|
"contribute": "Contribue au projet",
|
||||||
"feedbackDescription": "Tu veux voir une fonctionnalité ajoutée/modifiée/supprimée ? Tu veux donner ton opinion sur l'appli ou simplement discuter avec le développeur (c'est moi coucou) ? Utilise un des liens ci-dessous !",
|
"contributeSubtitle": "Avec une possible implication citoyenne !",
|
||||||
"contactMeans": "L'utilisation de Gitea est recommandée, pour l'utiliser, connecte toi avec tes identifiants INSA.",
|
"contributeDescription": "Il y en a pour tous les goûts : de la com', du design ou de la technique. Tu es libre de participer comme tu veux.\nTu trouveras ci-dessous un Trello de l'organisation du projet, ainsi que le code source sur GitEtud.",
|
||||||
"homeButtonTitle": "Feedback/Bugs",
|
"homeButtonTitle": "Participer au projet",
|
||||||
"homeButtonSubtitle": "Contacte le développeur de l'appli"
|
"homeButtonSubtitle": "Ton aide compte"
|
||||||
},
|
},
|
||||||
"game": {
|
"game": {
|
||||||
"title": "Jeu trop ouf",
|
"title": "Jeu trop ouf",
|
||||||
|
@ -412,16 +421,16 @@
|
||||||
"text": "Tu peux faire bien plus avec CAMPUS, mais je n'ai pas le temps de tout dire ici. Balade toi sur l'appli pour tout découvrir !"
|
"text": "Tu peux faire bien plus avec CAMPUS, mais je n'ai pas le temps de tout dire ici. Balade toi sur l'appli pour tout découvrir !"
|
||||||
},
|
},
|
||||||
"slideDone": {
|
"slideDone": {
|
||||||
"title": "Ton avis compte !",
|
"title": "Participe au projet !",
|
||||||
"text": "Cette appli à été réalisée par un seul étudiant (avec un peu d'aide par-ci par-là), donc tes retours sont les bienvenus !"
|
"text": "Cette appli à été réalisée par un seul étudiant, donc tes retours et ton aide sont les bienvenus !\nIl y en a pour tous les goûts : de la com', du design ou de la technique !"
|
||||||
},
|
},
|
||||||
"updateSlide0": {
|
"updateSlide0": {
|
||||||
"title": "Nouveau dans cette mise à jour !",
|
"title": "Coucou toi !",
|
||||||
"text": "Coucou toi ! Je suis là pour t'aider trouver à utiliser l'appli."
|
"text": "Je suis le petit nouveau qui t'accompagnera sur l'appli. Mon dada c'est de te donner plein d'astuces et d'infos."
|
||||||
},
|
},
|
||||||
"updateSlide1": {
|
"updateSlide1": {
|
||||||
"title": "Participe au projet !",
|
"title": "Participe au projet !",
|
||||||
"text": "Tout le monde peut participer, que ce soit pour trouver des bugs ou ajouter des nouvelles fonctionnalités."
|
"text": "Cette appli à été réalisée par un seul étudiant, donc tes retours et ton aide sont les bienvenus !\nIl y en a pour tous les goûts : de la com', du design ou de la technique !"
|
||||||
},
|
},
|
||||||
"aprilFoolsSlide": {
|
"aprilFoolsSlide": {
|
||||||
"title": "Nouveau dans cette mise à jour !",
|
"title": "Nouveau dans cette mise à jour !",
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {FlatList} from 'react-native';
|
||||||
|
|
||||||
export type OptionsDialogButtonType = {
|
export type OptionsDialogButtonType = {
|
||||||
title: string,
|
title: string,
|
||||||
|
icon?: string,
|
||||||
onPress: () => void,
|
onPress: () => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,10 +20,19 @@ type PropsType = {
|
||||||
|
|
||||||
class OptionsDialog extends React.PureComponent<PropsType> {
|
class OptionsDialog extends React.PureComponent<PropsType> {
|
||||||
getButtonRender = ({item}: {item: OptionsDialogButtonType}): React.Node => {
|
getButtonRender = ({item}: {item: OptionsDialogButtonType}): React.Node => {
|
||||||
return <Button onPress={item.onPress}>{item.title}</Button>;
|
return (
|
||||||
|
<Button onPress={item.onPress} icon={item.icon}>
|
||||||
|
{item.title}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
keyExtractor = (item: OptionsDialogButtonType): string => item.title;
|
keyExtractor = (item: OptionsDialogButtonType): string => {
|
||||||
|
if (item.icon != null) {
|
||||||
|
return item.title + item.icon;
|
||||||
|
}
|
||||||
|
return item.title;
|
||||||
|
};
|
||||||
|
|
||||||
render(): React.Node {
|
render(): React.Node {
|
||||||
const {props} = this;
|
const {props} = this;
|
||||||
|
|
|
@ -4,12 +4,12 @@ import * as React from 'react';
|
||||||
import {StyleSheet, View} from 'react-native';
|
import {StyleSheet, View} from 'react-native';
|
||||||
import i18n from 'i18n-js';
|
import i18n from 'i18n-js';
|
||||||
import {Avatar, Button, Card, TouchableRipple} from 'react-native-paper';
|
import {Avatar, Button, Card, TouchableRipple} from 'react-native-paper';
|
||||||
import {getFormattedEventTime, isDescriptionEmpty} from '../../utils/Planning';
|
import {getTimeOnlyString, isDescriptionEmpty} from '../../utils/Planning';
|
||||||
import CustomHTML from '../Overrides/CustomHTML';
|
import CustomHTML from '../Overrides/CustomHTML';
|
||||||
import type {EventType} from '../../screens/Home/HomeScreen';
|
import type {PlanningEventType} from '../../utils/Planning';
|
||||||
|
|
||||||
type PropsType = {
|
type PropsType = {
|
||||||
event?: EventType | null,
|
event?: PlanningEventType | null,
|
||||||
clickAction: () => void,
|
clickAction: () => void,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -62,19 +62,13 @@ class PreviewEventDashboardItem extends React.Component<PropsType> {
|
||||||
{hasImage ? (
|
{hasImage ? (
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={event.title}
|
title={event.title}
|
||||||
subtitle={getFormattedEventTime(
|
subtitle={getTimeOnlyString(event.date_begin)}
|
||||||
event.date_begin,
|
|
||||||
event.date_end,
|
|
||||||
)}
|
|
||||||
left={getImage}
|
left={getImage}
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={event.title}
|
title={event.title}
|
||||||
subtitle={getFormattedEventTime(
|
subtitle={getTimeOnlyString(event.date_begin)}
|
||||||
event.date_begin,
|
|
||||||
event.date_end,
|
|
||||||
)}
|
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{!isEmpty ? (
|
{!isEmpty ? (
|
||||||
|
|
|
@ -24,7 +24,7 @@ class MascotIntroEnd extends React.Component<null> {
|
||||||
<Mascot
|
<Mascot
|
||||||
style={{
|
style={{
|
||||||
...styles.center,
|
...styles.center,
|
||||||
height: '80%',
|
width: '80%',
|
||||||
}}
|
}}
|
||||||
emotion={MASCOT_STYLE.COOL}
|
emotion={MASCOT_STYLE.COOL}
|
||||||
animated
|
animated
|
||||||
|
|
|
@ -26,7 +26,7 @@ class MascotIntroWelcome extends React.Component<null> {
|
||||||
<Mascot
|
<Mascot
|
||||||
style={{
|
style={{
|
||||||
...styles.center,
|
...styles.center,
|
||||||
height: '80%',
|
width: '80%',
|
||||||
}}
|
}}
|
||||||
emotion={MASCOT_STYLE.NORMAL}
|
emotion={MASCOT_STYLE.NORMAL}
|
||||||
animated
|
animated
|
||||||
|
|
|
@ -1,17 +1,20 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {FlatList, Linking, Platform, Image} from 'react-native';
|
import {FlatList, Linking, Platform, Image, View} from 'react-native';
|
||||||
import i18n from 'i18n-js';
|
import i18n from 'i18n-js';
|
||||||
import {Avatar, Card, List, Title, withTheme} from 'react-native-paper';
|
import {Avatar, Card, List, withTheme} from 'react-native-paper';
|
||||||
import {StackNavigationProp} from '@react-navigation/stack';
|
import {StackNavigationProp} from '@react-navigation/stack';
|
||||||
|
import {Modalize} from "react-native-modalize";
|
||||||
import packageJson from '../../../package.json';
|
import packageJson from '../../../package.json';
|
||||||
import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
|
import CollapsibleFlatList from '../../components/Collapsible/CollapsibleFlatList';
|
||||||
import APP_LOGO from '../../../assets/android.icon.png';
|
import APP_LOGO from '../../../assets/android.icon.round.png';
|
||||||
import type {
|
import type {
|
||||||
CardTitleIconPropsType,
|
CardTitleIconPropsType,
|
||||||
ListIconPropsType,
|
ListIconPropsType,
|
||||||
} from '../../constants/PaperStyles';
|
} from '../../constants/PaperStyles';
|
||||||
|
import OptionsDialog from "../../components/Dialogs/OptionsDialog";
|
||||||
|
import type {OptionsDialogButtonType} from "../../components/Dialogs/OptionsDialog";
|
||||||
|
|
||||||
type ListItemType = {
|
type ListItemType = {
|
||||||
onPressCallback: () => void,
|
onPressCallback: () => void,
|
||||||
|
@ -20,6 +23,14 @@ type ListItemType = {
|
||||||
showChevron: boolean,
|
showChevron: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type AthorsItemType = {
|
||||||
|
name: string,
|
||||||
|
message: string,
|
||||||
|
btnTrool: OptionsDialogButtonType,
|
||||||
|
btnLinkedin: OptionsDialogButtonType,
|
||||||
|
btnMail: OptionsDialogButtonType,
|
||||||
|
};
|
||||||
|
|
||||||
const links = {
|
const links = {
|
||||||
appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
|
appstore: 'https://apps.apple.com/us/app/campus-amicale-insat/id1477722148',
|
||||||
playstore:
|
playstore:
|
||||||
|
@ -30,13 +41,13 @@ const links = {
|
||||||
'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/Changelog.md',
|
'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/Changelog.md',
|
||||||
license:
|
license:
|
||||||
'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/LICENSE',
|
'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/src/branch/master/LICENSE',
|
||||||
authorMail:
|
arnaudMail:
|
||||||
'mailto:vergnet@etud.insa-toulouse.fr?' +
|
'mailto:vergnet@etud.insa-toulouse.fr?' +
|
||||||
'subject=' +
|
'subject=' +
|
||||||
'Application Amicale INSA Toulouse' +
|
'Application Amicale INSA Toulouse' +
|
||||||
'&body=' +
|
'&body=' +
|
||||||
'Coucou !\n\n',
|
'Coucou !\n\n',
|
||||||
authorLinkedin: 'https://www.linkedin.com/in/arnaud-vergnet-434ba5179/',
|
arnaudLinkedin: 'https://www.linkedin.com/in/arnaud-vergnet-434ba5179/',
|
||||||
yohanMail:
|
yohanMail:
|
||||||
'mailto:ysimard@etud.insa-toulouse.fr?' +
|
'mailto:ysimard@etud.insa-toulouse.fr?' +
|
||||||
'subject=' +
|
'subject=' +
|
||||||
|
@ -64,6 +75,101 @@ function openWebLink(link: string) {
|
||||||
* Class defining an about screen. This screen shows the user information about the app and it's author.
|
* Class defining an about screen. This screen shows the user information about the app and it's author.
|
||||||
*/
|
*/
|
||||||
class AboutScreen extends React.Component<PropsType> {
|
class AboutScreen extends React.Component<PropsType> {
|
||||||
|
modalRef: Modalize | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data team
|
||||||
|
*/
|
||||||
|
teamUsers = {
|
||||||
|
arnaud: {
|
||||||
|
name: 'Arnaud VERGNET',
|
||||||
|
message: 'C vrément tro 1 bg !!',
|
||||||
|
icon: 'account-circle',
|
||||||
|
btnTrool: {
|
||||||
|
title: 'SWAG',
|
||||||
|
onPress: () => {
|
||||||
|
openWebLink(links.meme);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
btnLinkedin: {
|
||||||
|
title: 'Linkedin',
|
||||||
|
onPress: () => {
|
||||||
|
openWebLink(links.arnaudMail);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
btnMail: {
|
||||||
|
title: i18n.t('screens.about.authorMail'),
|
||||||
|
onPress: () => {
|
||||||
|
openWebLink(links.arnaudLinkedin);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
yohan: {
|
||||||
|
name: 'Yohan Simard',
|
||||||
|
message: 'Correction de quelques bugs',
|
||||||
|
icon: 'account-circle',
|
||||||
|
btnTrool: null,
|
||||||
|
btnLinkedin: {
|
||||||
|
title: 'Linkedin',
|
||||||
|
onPress: () => {
|
||||||
|
openWebLink(links.yohanLinkedin);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
btnMail: {
|
||||||
|
title: i18n.t('screens.about.authorMail'),
|
||||||
|
onPress: () => {
|
||||||
|
openWebLink(links.yohanMail);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Data thanks
|
||||||
|
*/
|
||||||
|
thanksUsers = {
|
||||||
|
beranger: {
|
||||||
|
name: 'Béranger Quintana Y Arciosana',
|
||||||
|
message: 'Étudiant en AE (2020) et Président de l’Amicale au moment de la création et du lancement du projet. L’application, c’était son idée. Il a beaucoup aidé pour trouver des bugs, de nouvelles fonctionnalités et faire de la com.',
|
||||||
|
icon: 'account-circle',
|
||||||
|
btnTrool: null,
|
||||||
|
btnLinkedin: null,
|
||||||
|
btnMail: null,
|
||||||
|
},
|
||||||
|
celine: {
|
||||||
|
name: 'Céline Tassin',
|
||||||
|
message: 'Étudiante en GPE (2020). Sans elle, tout serait moins mignon. Elle a aidé pour écrire le texte, faire de la com, et aussi à créer la mascotte 🦊.',
|
||||||
|
icon: 'account-circle',
|
||||||
|
btnTrool: null,
|
||||||
|
btnLinkedin: null,
|
||||||
|
btnMail: null,
|
||||||
|
},
|
||||||
|
damien: {
|
||||||
|
name: 'Damien Molina',
|
||||||
|
message: 'Étudiant en IR (2020) et créateur de la dernière version du site de l’Amicale. Grâce à son aide, intégrer les services de l’Amicale à l’application a été très simple.',
|
||||||
|
icon: 'account-circle',
|
||||||
|
btnTrool: null,
|
||||||
|
btnLinkedin: null,
|
||||||
|
btnMail: null,
|
||||||
|
},
|
||||||
|
titouan: {
|
||||||
|
name: 'Titouan Labourdette',
|
||||||
|
message: 'Étudiant en AE (2020) et Président de l’Amicale au moment de la création et du lancement du projet. L’application, c’était son idée. Il a beaucoup aidé pour trouver des bugs, de nouvelles fonctionnalités et faire de la com.',
|
||||||
|
icon: 'account-circle',
|
||||||
|
btnTrool: null,
|
||||||
|
btnLinkedin: null,
|
||||||
|
btnMail: null,
|
||||||
|
},
|
||||||
|
theo: {
|
||||||
|
name: 'Théo Tami',
|
||||||
|
message: 'Étudiant en IR (2020). Il a beaucoup aidé pour trouver des bugs et proposer des nouvelles fonctionnalités.',
|
||||||
|
icon: 'account-circle',
|
||||||
|
btnTrool: null,
|
||||||
|
btnLinkedin: null,
|
||||||
|
btnMail: null,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data to be displayed in the app card
|
* Data to be displayed in the app card
|
||||||
*/
|
*/
|
||||||
|
@ -115,60 +221,70 @@ class AboutScreen extends React.Component<PropsType> {
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data to be displayed in the author card
|
* Data to be displayed in the additional developer card
|
||||||
*/
|
*/
|
||||||
authorData = [
|
teamData = [
|
||||||
{
|
{
|
||||||
onPressCallback: () => {
|
onPressCallback: () => {
|
||||||
openWebLink(links.meme);
|
this.onListItemPress(this.teamUsers.arnaud);
|
||||||
},
|
},
|
||||||
icon: 'account-circle',
|
icon: this.teamUsers.arnaud.icon,
|
||||||
text: 'Arnaud VERGNET',
|
text: this.teamUsers.arnaud.name,
|
||||||
showChevron: false,
|
showChevron: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onPressCallback: () => {
|
onPressCallback: () => {
|
||||||
openWebLink(links.authorMail);
|
this.onListItemPress(this.teamUsers.yohan);
|
||||||
},
|
},
|
||||||
icon: 'email',
|
icon: this.teamUsers.yohan.icon,
|
||||||
text: i18n.t('screens.about.authorMail'),
|
text: this.teamUsers.yohan.name,
|
||||||
showChevron: true,
|
showChevron: false,
|
||||||
},
|
|
||||||
{
|
|
||||||
onPressCallback: () => {
|
|
||||||
openWebLink(links.authorLinkedin);
|
|
||||||
},
|
|
||||||
icon: 'linkedin',
|
|
||||||
text: 'Linkedin',
|
|
||||||
showChevron: true,
|
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Data to be displayed in the additional developer card
|
* Data to be displayed in the thanks card
|
||||||
*/
|
*/
|
||||||
additionalDevData = [
|
thanksData = [
|
||||||
{
|
{
|
||||||
onPressCallback: () => {},
|
onPressCallback: () => {
|
||||||
icon: 'account',
|
this.onListItemPress(this.thanksUsers.beranger);
|
||||||
text: 'Yohan SIMARD',
|
},
|
||||||
|
icon: this.thanksUsers.beranger.icon,
|
||||||
|
text: this.thanksUsers.beranger.name,
|
||||||
showChevron: false,
|
showChevron: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onPressCallback: () => {
|
onPressCallback: () => {
|
||||||
openWebLink(links.yohanMail);
|
this.onListItemPress(this.thanksUsers.celine);
|
||||||
},
|
},
|
||||||
icon: 'email',
|
icon: this.thanksUsers.celine.icon,
|
||||||
text: i18n.t('screens.about.authorMail'),
|
text: this.thanksUsers.celine.name,
|
||||||
showChevron: true,
|
showChevron: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
onPressCallback: () => {
|
onPressCallback: () => {
|
||||||
openWebLink(links.yohanLinkedin);
|
this.onListItemPress(this.thanksUsers.damien);
|
||||||
},
|
},
|
||||||
icon: 'linkedin',
|
icon: this.thanksUsers.damien.icon,
|
||||||
text: 'Linkedin',
|
text: this.thanksUsers.damien.name,
|
||||||
showChevron: true,
|
showChevron: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
onPressCallback: () => {
|
||||||
|
this.onListItemPress(this.thanksUsers.titouan);
|
||||||
|
},
|
||||||
|
icon: this.thanksUsers.titouan.icon,
|
||||||
|
text: this.thanksUsers.titouan.name,
|
||||||
|
showChevron: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
onPressCallback: () => {
|
||||||
|
this.onListItemPress(this.thanksUsers.theo);
|
||||||
|
},
|
||||||
|
icon: this.thanksUsers.theo.icon,
|
||||||
|
text: this.thanksUsers.theo.name,
|
||||||
|
showChevron: false,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -205,11 +321,59 @@ class AboutScreen extends React.Component<PropsType> {
|
||||||
{
|
{
|
||||||
id: 'team',
|
id: 'team',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: 'thanks',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'techno',
|
id: 'techno',
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
constructor(props: PropsType) {
|
||||||
|
super(props);
|
||||||
|
this.state = {
|
||||||
|
dialogVisible: false,
|
||||||
|
dialogTitle: '',
|
||||||
|
dialogMessage: '',
|
||||||
|
dialogButtons: [],
|
||||||
|
onDialogDismiss: () => {
|
||||||
|
this.setState({dialogVisible: false});
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Callback used when clicking an article in the list.
|
||||||
|
* It opens the modal to show detailed information about the article
|
||||||
|
*
|
||||||
|
* @param user TODO
|
||||||
|
*/
|
||||||
|
onListItemPress(user: AthorsItemType) {
|
||||||
|
const dialogBtn: Array<OptionsDialogButtonType> = [
|
||||||
|
{
|
||||||
|
title: 'OK',
|
||||||
|
onPress: () => {
|
||||||
|
this.onDialogDismiss();
|
||||||
|
},
|
||||||
|
}
|
||||||
|
];
|
||||||
|
if(user.btnMail != null) {
|
||||||
|
dialogBtn.push(user.btnMail);
|
||||||
|
}
|
||||||
|
if(user.btnLinkedin != null) {
|
||||||
|
dialogBtn.push(user.btnLinkedin);
|
||||||
|
}
|
||||||
|
if(user.btnTrool != null) {
|
||||||
|
dialogBtn.push(user.btnTrool);
|
||||||
|
}
|
||||||
|
this.setState({
|
||||||
|
dialogVisible: true,
|
||||||
|
dialogTitle: user.name,
|
||||||
|
dialogMessage: user.message,
|
||||||
|
dialogButtons: dialogBtn,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the app card showing information and links about the app.
|
* Gets the app card showing information and links about the app.
|
||||||
*
|
*
|
||||||
|
@ -255,18 +419,9 @@ class AboutScreen extends React.Component<PropsType> {
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Card.Content>
|
<Card.Content>
|
||||||
<Title>{i18n.t('screens.about.author')}</Title>
|
|
||||||
<FlatList
|
<FlatList
|
||||||
data={this.authorData}
|
data={this.teamData}
|
||||||
keyExtractor={this.keyExtractor}
|
keyExtractor={this.keyExtractor}
|
||||||
listKey="1"
|
|
||||||
renderItem={this.getCardItem}
|
|
||||||
/>
|
|
||||||
<Title>{i18n.t('screens.about.additionalDev')}</Title>
|
|
||||||
<FlatList
|
|
||||||
data={this.additionalDevData}
|
|
||||||
keyExtractor={this.keyExtractor}
|
|
||||||
listKey="2"
|
|
||||||
renderItem={this.getCardItem}
|
renderItem={this.getCardItem}
|
||||||
/>
|
/>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
|
@ -274,6 +429,31 @@ class AboutScreen extends React.Component<PropsType> {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the thanks card showing information and links about the team TODO
|
||||||
|
*
|
||||||
|
* @return {*}
|
||||||
|
*/
|
||||||
|
getThanksCard(): React.Node {
|
||||||
|
return (
|
||||||
|
<Card style={{marginBottom: 10}}>
|
||||||
|
<Card.Title
|
||||||
|
title={i18n.t('screens.about.thanks')}
|
||||||
|
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
||||||
|
<Avatar.Icon size={iconProps.size} icon="hand-heart" />
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Card.Content>
|
||||||
|
<FlatList
|
||||||
|
data={this.thanksData}
|
||||||
|
keyExtractor={this.keyExtractor}
|
||||||
|
renderItem={this.getCardItem}
|
||||||
|
/>
|
||||||
|
</Card.Content>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the techno card showing information and links about the technologies used in the app
|
* Gets the techno card showing information and links about the technologies used in the app
|
||||||
*
|
*
|
||||||
|
@ -281,16 +461,21 @@ class AboutScreen extends React.Component<PropsType> {
|
||||||
*/
|
*/
|
||||||
getTechnoCard(): React.Node {
|
getTechnoCard(): React.Node {
|
||||||
return (
|
return (
|
||||||
<Card style={{marginBottom: 10}}>
|
<Card style={{marginBottom: 10}}>
|
||||||
<Card.Content>
|
<Card.Title
|
||||||
<Title>{i18n.t('screens.about.technologies')}</Title>
|
title={i18n.t('screens.about.technologies')}
|
||||||
<FlatList
|
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
||||||
data={this.technoData}
|
<Avatar.Icon size={iconProps.size} icon="build" />
|
||||||
keyExtractor={this.keyExtractor}
|
)}
|
||||||
renderItem={this.getCardItem}
|
|
||||||
/>
|
/>
|
||||||
</Card.Content>
|
<Card.Content>
|
||||||
</Card>
|
<FlatList
|
||||||
|
data={this.technoData}
|
||||||
|
keyExtractor={this.keyExtractor}
|
||||||
|
renderItem={this.getCardItem}
|
||||||
|
/>
|
||||||
|
</Card.Content>
|
||||||
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,6 +543,8 @@ class AboutScreen extends React.Component<PropsType> {
|
||||||
return this.getAppCard();
|
return this.getAppCard();
|
||||||
case 'team':
|
case 'team':
|
||||||
return this.getTeamCard();
|
return this.getTeamCard();
|
||||||
|
case 'thanks':
|
||||||
|
return this.getThanksCard();
|
||||||
case 'techno':
|
case 'techno':
|
||||||
return this.getTechnoCard();
|
return this.getTechnoCard();
|
||||||
default:
|
default:
|
||||||
|
@ -374,12 +561,25 @@ class AboutScreen extends React.Component<PropsType> {
|
||||||
keyExtractor = (item: ListItemType): string => item.icon;
|
keyExtractor = (item: ListItemType): string => item.icon;
|
||||||
|
|
||||||
render(): React.Node {
|
render(): React.Node {
|
||||||
|
const {state} = this;
|
||||||
return (
|
return (
|
||||||
<CollapsibleFlatList
|
<View
|
||||||
style={{padding: 5}}
|
style={{
|
||||||
data={this.dataOrder}
|
height: '100%',
|
||||||
renderItem={this.getMainCard}
|
}}>
|
||||||
/>
|
<CollapsibleFlatList
|
||||||
|
style={{padding: 5}}
|
||||||
|
data={this.dataOrder}
|
||||||
|
renderItem={this.getMainCard}
|
||||||
|
/>
|
||||||
|
<OptionsDialog
|
||||||
|
visible={state.dialogVisible}
|
||||||
|
title={state.dialogTitle}
|
||||||
|
message={state.dialogMessage}
|
||||||
|
buttons={state.dialogButtons}
|
||||||
|
onDismiss={state.onDialogDismiss}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@ import MascotPopup from '../../components/Mascot/MascotPopup';
|
||||||
import DashboardManager from '../../managers/DashboardManager';
|
import DashboardManager from '../../managers/DashboardManager';
|
||||||
import type {ServiceItemType} from '../../managers/ServicesManager';
|
import type {ServiceItemType} from '../../managers/ServicesManager';
|
||||||
import {getDisplayEvent, getFutureEvents} from '../../utils/Home';
|
import {getDisplayEvent, getFutureEvents} from '../../utils/Home';
|
||||||
|
import type {PlanningEventType} from '../../utils/Planning';
|
||||||
// import DATA from "../dashboard_data.json";
|
// import DATA from "../dashboard_data.json";
|
||||||
|
|
||||||
const DATA_URL =
|
const DATA_URL =
|
||||||
|
@ -49,24 +50,12 @@ export type FeedItemType = {
|
||||||
page_id: string,
|
page_id: string,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type EventType = {
|
|
||||||
id: number,
|
|
||||||
title: string,
|
|
||||||
logo: string | null,
|
|
||||||
date_begin: string,
|
|
||||||
date_end: string,
|
|
||||||
description: string,
|
|
||||||
club: string,
|
|
||||||
category_id: number,
|
|
||||||
url: string,
|
|
||||||
};
|
|
||||||
|
|
||||||
export type FullDashboardType = {
|
export type FullDashboardType = {
|
||||||
today_menu: Array<{[key: string]: {...}}>,
|
today_menu: Array<{[key: string]: {...}}>,
|
||||||
proximo_articles: number,
|
proximo_articles: number,
|
||||||
available_dryers: number,
|
available_dryers: number,
|
||||||
available_washers: number,
|
available_washers: number,
|
||||||
today_events: Array<EventType>,
|
today_events: Array<PlanningEventType>,
|
||||||
available_tutorials: number,
|
available_tutorials: number,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -193,7 +182,7 @@ class HomeScreen extends React.Component<PropsType, StateType> {
|
||||||
* @param content
|
* @param content
|
||||||
* @return {*}
|
* @return {*}
|
||||||
*/
|
*/
|
||||||
getDashboardEvent(content: Array<EventType>): React.Node {
|
getDashboardEvent(content: Array<PlanningEventType>): React.Node {
|
||||||
const futureEvents = getFutureEvents(content);
|
const futureEvents = getFutureEvents(content);
|
||||||
const displayEvent = getDisplayEvent(futureEvents);
|
const displayEvent = getDisplayEvent(futureEvents);
|
||||||
// const clickPreviewAction = () =>
|
// const clickPreviewAction = () =>
|
||||||
|
|
|
@ -3,110 +3,130 @@
|
||||||
import * as React from 'react';
|
import * as React from 'react';
|
||||||
import {Avatar, Button, Card, Paragraph, withTheme} from 'react-native-paper';
|
import {Avatar, Button, Card, Paragraph, withTheme} from 'react-native-paper';
|
||||||
import i18n from 'i18n-js';
|
import i18n from 'i18n-js';
|
||||||
import {Linking} from 'react-native';
|
import {Linking, View} from 'react-native';
|
||||||
import type {CustomThemeType} from '../../managers/ThemeManager';
|
|
||||||
import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
|
import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
|
||||||
import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
|
import type {CardTitleIconPropsType} from '../../constants/PaperStyles';
|
||||||
|
|
||||||
type PropsType = {
|
|
||||||
theme: CustomThemeType,
|
|
||||||
};
|
|
||||||
|
|
||||||
const links = {
|
const links = {
|
||||||
bugsMail: `mailto:app@amicale-insat.fr?subject=[BUG] Application CAMPUS
|
bugsGit: 'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/',
|
||||||
&body=Coucou Arnaud ça bug c'est nul,\n\n
|
trello: 'https://trello.com/b/RMej49Uq/application-campus-insa',
|
||||||
Informations sur ton système si tu sais (iOS ou Android, modèle du tel, version):\n\n\n
|
|
||||||
Nature du problème :\n\n\n
|
|
||||||
Étapes pour reproduire ce pb :\n\n\n\n
|
|
||||||
Stp corrige le pb, bien cordialement.`,
|
|
||||||
bugsGit:
|
|
||||||
'https://git.etud.insa-toulouse.fr/vergnet/application-amicale/issues/new',
|
|
||||||
facebook: 'https://www.facebook.com/campus.insat',
|
facebook: 'https://www.facebook.com/campus.insat',
|
||||||
feedbackMail: `mailto:app@amicale-insat.fr?subject=[FEEDBACK] Application CAMPUS
|
feedbackMail: `mailto:app@amicale-insat.fr?subject=[FEEDBACK] Application CAMPUS
|
||||||
&body=Coucou Arnaud j'ai du feedback\n\n\n\nBien cordialement.`,
|
&body=Coucou Arnaud j'ai du feedback\n\n\n\nBien cordialement.`,
|
||||||
feedbackDiscord: 'https://discord.gg/W8MeTec',
|
feedbackDiscord: 'https://discord.gg/W8MeTec',
|
||||||
};
|
};
|
||||||
|
|
||||||
class FeedbackScreen extends React.Component<PropsType> {
|
class FeedbackScreen extends React.Component<null> {
|
||||||
/**
|
/**
|
||||||
* Gets link buttons
|
* Gets link buttons
|
||||||
*
|
*
|
||||||
* @param isBug True if buttons should redirect to bug report methods
|
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
static getButtons(isBug: boolean): React.Node {
|
static getButtons(isFeedback: boolean): React.Node {
|
||||||
return (
|
return (
|
||||||
<Card.Actions
|
<Card.Actions
|
||||||
style={{
|
style={{
|
||||||
flex: 1,
|
flex: 1,
|
||||||
flexWrap: 'wrap',
|
flexWrap: 'wrap',
|
||||||
}}>
|
}}>
|
||||||
<Button
|
{isFeedback ? (
|
||||||
icon="email"
|
<View
|
||||||
mode="contained"
|
style={{
|
||||||
style={{
|
flex: 1,
|
||||||
marginLeft: 'auto',
|
flexWrap: 'wrap',
|
||||||
marginTop: 5,
|
flexDirection: 'row',
|
||||||
}}
|
width: '100%',
|
||||||
onPress={() => {
|
}}>
|
||||||
Linking.openURL(isBug ? links.bugsMail : links.feedbackMail);
|
<Button
|
||||||
}}>
|
icon="email"
|
||||||
MAIL
|
mode="contained"
|
||||||
</Button>
|
style={{
|
||||||
<Button
|
marginLeft: 'auto',
|
||||||
icon={isBug ? 'git' : 'discord'}
|
marginRight: 'auto',
|
||||||
mode="contained"
|
marginTop: 5,
|
||||||
color={isBug ? '#609927' : '#7289da'}
|
}}
|
||||||
style={{
|
onPress={() => {
|
||||||
marginLeft: 'auto',
|
Linking.openURL(links.feedbackMail);
|
||||||
marginTop: 5,
|
}}>
|
||||||
}}
|
MAIL
|
||||||
onPress={() => {
|
</Button>
|
||||||
Linking.openURL(isBug ? links.bugsGit : links.feedbackDiscord);
|
<Button
|
||||||
}}>
|
icon="facebook"
|
||||||
{isBug ? 'GITEA' : 'Discord'}
|
mode="contained"
|
||||||
</Button>
|
color="#2e88fe"
|
||||||
<Button
|
style={{
|
||||||
icon="facebook"
|
marginLeft: 'auto',
|
||||||
mode="contained"
|
marginRight: 'auto',
|
||||||
color="#2e88fe"
|
marginTop: 5,
|
||||||
style={{
|
}}
|
||||||
marginLeft: 'auto',
|
onPress={() => {
|
||||||
marginTop: 5,
|
Linking.openURL(links.facebook);
|
||||||
}}
|
}}>
|
||||||
onPress={() => {
|
Facebook
|
||||||
Linking.openURL(links.facebook);
|
</Button>
|
||||||
}}>
|
<Button
|
||||||
Facebook
|
icon="discord"
|
||||||
</Button>
|
mode="contained"
|
||||||
|
color="#7289da"
|
||||||
|
style={{
|
||||||
|
marginLeft: 'auto',
|
||||||
|
marginRight: 'auto',
|
||||||
|
marginTop: 5,
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
Linking.openURL(links.feedbackDiscord);
|
||||||
|
}}>
|
||||||
|
Discord
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
) : (
|
||||||
|
<View
|
||||||
|
style={{
|
||||||
|
flex: 1,
|
||||||
|
flexWrap: 'wrap',
|
||||||
|
flexDirection: 'row',
|
||||||
|
width: '100%',
|
||||||
|
}}>
|
||||||
|
<Button
|
||||||
|
icon="git"
|
||||||
|
mode="contained"
|
||||||
|
color="#609927"
|
||||||
|
style={{
|
||||||
|
marginLeft: 'auto',
|
||||||
|
marginRight: 'auto',
|
||||||
|
marginTop: 5,
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
Linking.openURL(links.bugsGit);
|
||||||
|
}}>
|
||||||
|
GITETUD
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
icon="calendar"
|
||||||
|
mode="contained"
|
||||||
|
color="#026AA7"
|
||||||
|
style={{
|
||||||
|
marginLeft: 'auto',
|
||||||
|
marginRight: 'auto',
|
||||||
|
marginTop: 5,
|
||||||
|
}}
|
||||||
|
onPress={() => {
|
||||||
|
Linking.openURL(links.trello);
|
||||||
|
}}>
|
||||||
|
TRELLO
|
||||||
|
</Button>
|
||||||
|
</View>
|
||||||
|
)}
|
||||||
</Card.Actions>
|
</Card.Actions>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
render(): React.Node {
|
render(): React.Node {
|
||||||
const {theme} = this.props;
|
|
||||||
return (
|
return (
|
||||||
<CollapsibleScrollView style={{padding: 5}}>
|
<CollapsibleScrollView style={{padding: 5}}>
|
||||||
<Card>
|
<Card>
|
||||||
<Card.Title
|
<Card.Title
|
||||||
title={i18n.t('screens.feedback.bugs')}
|
title={i18n.t('screens.feedback.feedback')}
|
||||||
subtitle={i18n.t('screens.feedback.bugsSubtitle')}
|
|
||||||
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
|
||||||
<Avatar.Icon size={iconProps.size} icon="bug" />
|
|
||||||
)}
|
|
||||||
/>
|
|
||||||
<Card.Content>
|
|
||||||
<Paragraph>{i18n.t('screens.feedback.bugsDescription')}</Paragraph>
|
|
||||||
<Paragraph style={{color: theme.colors.primary}}>
|
|
||||||
{i18n.t('screens.feedback.contactMeans')}
|
|
||||||
</Paragraph>
|
|
||||||
</Card.Content>
|
|
||||||
{FeedbackScreen.getButtons(true)}
|
|
||||||
</Card>
|
|
||||||
|
|
||||||
<Card style={{marginTop: 20, marginBottom: 10}}>
|
|
||||||
<Card.Title
|
|
||||||
title={i18n.t('screens.feedback.title')}
|
|
||||||
subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
|
subtitle={i18n.t('screens.feedback.feedbackSubtitle')}
|
||||||
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
||||||
<Avatar.Icon size={iconProps.size} icon="comment" />
|
<Avatar.Icon size={iconProps.size} icon="comment" />
|
||||||
|
@ -117,6 +137,19 @@ class FeedbackScreen extends React.Component<PropsType> {
|
||||||
{i18n.t('screens.feedback.feedbackDescription')}
|
{i18n.t('screens.feedback.feedbackDescription')}
|
||||||
</Paragraph>
|
</Paragraph>
|
||||||
</Card.Content>
|
</Card.Content>
|
||||||
|
{FeedbackScreen.getButtons(true)}
|
||||||
|
<Card.Title
|
||||||
|
title={i18n.t('screens.feedback.contribute')}
|
||||||
|
subtitle={i18n.t('screens.feedback.contributeSubtitle')}
|
||||||
|
left={(iconProps: CardTitleIconPropsType): React.Node => (
|
||||||
|
<Avatar.Icon size={iconProps.size} icon="handshake" />
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
<Card.Content>
|
||||||
|
<Paragraph>
|
||||||
|
{i18n.t('screens.feedback.contributeDescription')}
|
||||||
|
</Paragraph>
|
||||||
|
</Card.Content>
|
||||||
{FeedbackScreen.getButtons(false)}
|
{FeedbackScreen.getButtons(false)}
|
||||||
</Card>
|
</Card>
|
||||||
</CollapsibleScrollView>
|
</CollapsibleScrollView>
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {View} from 'react-native';
|
||||||
import {Card} from 'react-native-paper';
|
import {Card} from 'react-native-paper';
|
||||||
import i18n from 'i18n-js';
|
import i18n from 'i18n-js';
|
||||||
import {StackNavigationProp} from '@react-navigation/stack';
|
import {StackNavigationProp} from '@react-navigation/stack';
|
||||||
import {getDateOnlyString, getFormattedEventTime} from '../../utils/Planning';
|
import {getDateOnlyString, getTimeOnlyString} from '../../utils/Planning';
|
||||||
import DateManager from '../../managers/DateManager';
|
import DateManager from '../../managers/DateManager';
|
||||||
import BasicLoadingScreen from '../../components/Screens/BasicLoadingScreen';
|
import BasicLoadingScreen from '../../components/Screens/BasicLoadingScreen';
|
||||||
import {apiRequest, ERROR_TYPE} from '../../utils/WebData';
|
import {apiRequest, ERROR_TYPE} from '../../utils/WebData';
|
||||||
|
@ -96,12 +96,9 @@ class PlanningDisplayScreen extends React.Component<PropsType, StateType> {
|
||||||
const {navigation} = this.props;
|
const {navigation} = this.props;
|
||||||
const {displayData} = this;
|
const {displayData} = this;
|
||||||
if (displayData == null) return null;
|
if (displayData == null) return null;
|
||||||
let subtitle = getFormattedEventTime(
|
let subtitle = getTimeOnlyString(displayData.date_begin);
|
||||||
displayData.date_begin,
|
|
||||||
displayData.date_end,
|
|
||||||
);
|
|
||||||
const dateString = getDateOnlyString(displayData.date_begin);
|
const dateString = getDateOnlyString(displayData.date_begin);
|
||||||
if (dateString !== null)
|
if (dateString !== null && subtitle != null)
|
||||||
subtitle += ` | ${DateManager.getInstance().getTranslatedDate(
|
subtitle += ` | ${DateManager.getInstance().getTranslatedDate(
|
||||||
dateString,
|
dateString,
|
||||||
)}`;
|
)}`;
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {
|
||||||
generateEventAgenda,
|
generateEventAgenda,
|
||||||
getCurrentDateString,
|
getCurrentDateString,
|
||||||
getDateOnlyString,
|
getDateOnlyString,
|
||||||
getFormattedEventTime,
|
getTimeOnlyString,
|
||||||
} from '../../utils/Planning';
|
} from '../../utils/Planning';
|
||||||
import CustomAgenda from '../../components/Overrides/CustomAgenda';
|
import CustomAgenda from '../../components/Overrides/CustomAgenda';
|
||||||
import {MASCOT_STYLE} from '../../components/Mascot/Mascot';
|
import {MASCOT_STYLE} from '../../components/Mascot/Mascot';
|
||||||
|
@ -198,7 +198,7 @@ class PlanningScreen extends React.Component<PropsType, StateType> {
|
||||||
<Divider />
|
<Divider />
|
||||||
<List.Item
|
<List.Item
|
||||||
title={item.title}
|
title={item.title}
|
||||||
description={getFormattedEventTime(item.date_begin, item.date_end)}
|
description={getTimeOnlyString(item.date_begin)}
|
||||||
left={(): React.Node => (
|
left={(): React.Node => (
|
||||||
<Avatar.Image
|
<Avatar.Image
|
||||||
source={{uri: item.logo}}
|
source={{uri: item.logo}}
|
||||||
|
@ -215,7 +215,7 @@ class PlanningScreen extends React.Component<PropsType, StateType> {
|
||||||
<Divider />
|
<Divider />
|
||||||
<List.Item
|
<List.Item
|
||||||
title={item.title}
|
title={item.title}
|
||||||
description={getFormattedEventTime(item.date_begin, item.date_end)}
|
description={getTimeOnlyString(item.date_begin)}
|
||||||
onPress={onPress}
|
onPress={onPress}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// @flow
|
// @flow
|
||||||
|
|
||||||
import {stringToDate} from './Planning';
|
import {stringToDate} from './Planning';
|
||||||
import type {EventType} from '../screens/Home/HomeScreen';
|
import type {PlanningEventType} from './Planning';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the time limit depending on the current day:
|
* Gets the time limit depending on the current day:
|
||||||
|
@ -20,20 +20,6 @@ export function getTodayEventTimeLimit(): Date {
|
||||||
return now;
|
return now;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the duration (in milliseconds) of an event
|
|
||||||
*
|
|
||||||
* @param event {EventType}
|
|
||||||
* @return {number} The number of milliseconds
|
|
||||||
*/
|
|
||||||
export function getEventDuration(event: EventType): number {
|
|
||||||
const start = stringToDate(event.date_begin);
|
|
||||||
const end = stringToDate(event.date_end);
|
|
||||||
let duration = 0;
|
|
||||||
if (start != null && end != null) duration = end - start;
|
|
||||||
return duration;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets events starting after the limit
|
* Gets events starting after the limit
|
||||||
*
|
*
|
||||||
|
@ -42,11 +28,11 @@ export function getEventDuration(event: EventType): number {
|
||||||
* @return {Array<Object>}
|
* @return {Array<Object>}
|
||||||
*/
|
*/
|
||||||
export function getEventsAfterLimit(
|
export function getEventsAfterLimit(
|
||||||
events: Array<EventType>,
|
events: Array<PlanningEventType>,
|
||||||
limit: Date,
|
limit: Date,
|
||||||
): Array<EventType> {
|
): Array<PlanningEventType> {
|
||||||
const validEvents = [];
|
const validEvents = [];
|
||||||
events.forEach((event: EventType) => {
|
events.forEach((event: PlanningEventType) => {
|
||||||
const startDate = stringToDate(event.date_begin);
|
const startDate = stringToDate(event.date_begin);
|
||||||
if (startDate != null && startDate >= limit) {
|
if (startDate != null && startDate >= limit) {
|
||||||
validEvents.push(event);
|
validEvents.push(event);
|
||||||
|
@ -55,44 +41,19 @@ export function getEventsAfterLimit(
|
||||||
return validEvents;
|
return validEvents;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the event with the longest duration in the given array.
|
|
||||||
* If all events have the same duration, return the first in the array.
|
|
||||||
*
|
|
||||||
* @param events
|
|
||||||
*/
|
|
||||||
export function getLongestEvent(events: Array<EventType>): EventType {
|
|
||||||
let longestEvent = events[0];
|
|
||||||
let longestTime = 0;
|
|
||||||
events.forEach((event: EventType) => {
|
|
||||||
const time = getEventDuration(event);
|
|
||||||
if (time > longestTime) {
|
|
||||||
longestTime = time;
|
|
||||||
longestEvent = event;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return longestEvent;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets events that have not yet ended/started
|
* Gets events that have not yet ended/started
|
||||||
*
|
*
|
||||||
* @param events
|
* @param events
|
||||||
*/
|
*/
|
||||||
export function getFutureEvents(events: Array<EventType>): Array<EventType> {
|
export function getFutureEvents(
|
||||||
|
events: Array<PlanningEventType>,
|
||||||
|
): Array<PlanningEventType> {
|
||||||
const validEvents = [];
|
const validEvents = [];
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
events.forEach((event: EventType) => {
|
events.forEach((event: PlanningEventType) => {
|
||||||
const startDate = stringToDate(event.date_begin);
|
const startDate = stringToDate(event.date_begin);
|
||||||
const endDate = stringToDate(event.date_end);
|
if (startDate != null && startDate > now) validEvents.push(event);
|
||||||
if (startDate != null) {
|
|
||||||
if (startDate > now) validEvents.push(event);
|
|
||||||
else if (endDate != null) {
|
|
||||||
if (endDate > now || endDate < startDate)
|
|
||||||
// Display event if it ends the following day
|
|
||||||
validEvents.push(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
return validEvents;
|
return validEvents;
|
||||||
}
|
}
|
||||||
|
@ -101,23 +62,19 @@ export function getFutureEvents(events: Array<EventType>): Array<EventType> {
|
||||||
* Gets the event to display in the preview
|
* Gets the event to display in the preview
|
||||||
*
|
*
|
||||||
* @param events
|
* @param events
|
||||||
* @return {EventType | null}
|
* @return {PlanningEventType | null}
|
||||||
*/
|
*/
|
||||||
export function getDisplayEvent(events: Array<EventType>): EventType | null {
|
export function getDisplayEvent(
|
||||||
|
events: Array<PlanningEventType>,
|
||||||
|
): PlanningEventType | null {
|
||||||
let displayEvent = null;
|
let displayEvent = null;
|
||||||
if (events.length > 1) {
|
if (events.length > 1) {
|
||||||
const eventsAfterLimit = getEventsAfterLimit(
|
const eventsAfterLimit = getEventsAfterLimit(
|
||||||
events,
|
events,
|
||||||
getTodayEventTimeLimit(),
|
getTodayEventTimeLimit(),
|
||||||
);
|
);
|
||||||
if (eventsAfterLimit.length > 0) {
|
if (eventsAfterLimit.length > 0) [displayEvent] = eventsAfterLimit;
|
||||||
if (eventsAfterLimit.length === 1) [displayEvent] = eventsAfterLimit;
|
else [displayEvent] = events;
|
||||||
else displayEvent = getLongestEvent(events);
|
} else if (events.length === 1) [displayEvent] = events;
|
||||||
} else {
|
|
||||||
displayEvent = getLongestEvent(events);
|
|
||||||
}
|
|
||||||
} else if (events.length === 1) {
|
|
||||||
[displayEvent] = events;
|
|
||||||
}
|
|
||||||
return displayEvent;
|
return displayEvent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,13 @@
|
||||||
export type PlanningEventType = {
|
export type PlanningEventType = {
|
||||||
id: number,
|
id: number,
|
||||||
title: string,
|
title: string,
|
||||||
logo: string,
|
|
||||||
date_begin: string,
|
date_begin: string,
|
||||||
date_end: string,
|
|
||||||
description: string,
|
|
||||||
club: string,
|
club: string,
|
||||||
category_id: number,
|
category_id: number,
|
||||||
|
description: string,
|
||||||
|
place: string,
|
||||||
url: string,
|
url: string,
|
||||||
|
logo: string | null,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Regex used to check date string validity
|
// Regex used to check date string validity
|
||||||
|
@ -120,50 +120,6 @@ export function getTimeOnlyString(dateString: string): string | null {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns a string corresponding to the event start and end times in the following format:
|
|
||||||
*
|
|
||||||
* HH:MM - HH:MM
|
|
||||||
*
|
|
||||||
* If the end date is not specified or is equal to start time, only start time will be shown.
|
|
||||||
*
|
|
||||||
* If the end date is not on the same day, 23:59 will be shown as end time
|
|
||||||
*
|
|
||||||
* @param start Start time in YYYY-MM-DD HH:MM:SS format
|
|
||||||
* @param end End time in YYYY-MM-DD HH:MM:SS format
|
|
||||||
* @return {string} Formatted string or "/ - /" on error
|
|
||||||
*/
|
|
||||||
export function getFormattedEventTime(start: string, end: string): string {
|
|
||||||
let formattedStr = '/ - /';
|
|
||||||
const startDate = stringToDate(start);
|
|
||||||
const endDate = stringToDate(end);
|
|
||||||
|
|
||||||
if (
|
|
||||||
startDate !== null &&
|
|
||||||
endDate !== null &&
|
|
||||||
startDate.getTime() !== endDate.getTime()
|
|
||||||
) {
|
|
||||||
formattedStr = `${String(startDate.getHours()).padStart(2, '0')}:${String(
|
|
||||||
startDate.getMinutes(),
|
|
||||||
).padStart(2, '0')} - `;
|
|
||||||
if (
|
|
||||||
endDate.getFullYear() > startDate.getFullYear() ||
|
|
||||||
endDate.getMonth() > startDate.getMonth() ||
|
|
||||||
endDate.getDate() > startDate.getDate()
|
|
||||||
)
|
|
||||||
formattedStr += '23:59';
|
|
||||||
else
|
|
||||||
formattedStr += `${String(endDate.getHours()).padStart(2, '0')}:${String(
|
|
||||||
endDate.getMinutes(),
|
|
||||||
).padStart(2, '0')}`;
|
|
||||||
} else if (startDate !== null)
|
|
||||||
formattedStr = `${String(startDate.getHours()).padStart(2, '0')}:${String(
|
|
||||||
startDate.getMinutes(),
|
|
||||||
).padStart(2, '0')}`;
|
|
||||||
|
|
||||||
return formattedStr;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if the given description can be considered empty.
|
* Checks if the given description can be considered empty.
|
||||||
* <br>
|
* <br>
|
||||||
|
|