Skip to content

Commit e167ba1

Browse files
committed
v2.1.2
ajout edt hors-ligne depuis homescreen update dependances
1 parent 992b396 commit e167ba1

File tree

4 files changed

+51
-40
lines changed

4 files changed

+51
-40
lines changed

App.js

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ import { setAppIcon } from "@hugofnm/expo-dynamic-app-icon";
7676
// ---------------------------------------------
7777

7878
// IMPORTANT !!!
79-
var appVersion = '2.1.1';
79+
var appVersion = '2.1.2';
8080
var isBeta = false;
8181
// IMPORTANT !!!
8282

@@ -1254,7 +1254,11 @@ function HomeScreen({ navigation }) {
12541254
async function getMyCal(navigation) {
12551255
setSelectable(false);
12561256
setLoading(true);
1257-
calendar = await getCalendar();
1257+
if (nextEvent.summary == "ADE Indisponible") {
1258+
calendar = await getCalendarFromCache();
1259+
} else {
1260+
calendar = await getCalendar();
1261+
}
12581262
setSelectable(true);
12591263
setLoading(false);
12601264
navigation.navigate('ShowEDT');
@@ -1377,7 +1381,7 @@ function HomeScreen({ navigation }) {
13771381
</View>
13781382
<Text style={{ textAlign: 'left' }} variant="displayLarge">Salut ! 👋</Text>
13791383
<Text style={{ textAlign: 'left', marginBottom: 16 }} variant='titleMedium'>Tu es connecté·e·s sous le compte de : {"\n"}{username} - {name}</Text>
1380-
<Chip style={{ height: 48, marginBottom: 8, justifyContent: 'center', flexDirection: 'row'}} textStyle={{ paddingVertical: 8 }} disabled={!selectable} onPress={ () => handleLogin("notes") } icon="school" >Notes (Intracursus)</Chip>
1384+
<Chip style={{ height: 48, marginBottom: 8, justifyContent: 'center', flexDirection: 'row'}} textStyle={{ paddingVertical: 8 }} disabled={!selectable} onPress={ () => handleLogin("notes") } icon="school" >Notes (I.U.T.)</Chip>
13811385
<Chip style={{ height: 48, marginBottom: 8, justifyContent: 'center', flexDirection: 'row'}} textStyle={{ paddingVertical: 8 }} disabled={!selectable} onPress={ () => navigation.navigate(ShowENT) } icon="briefcase-variant" >Espace Numérique de Travail</Chip>
13821386

13831387
<Card style={{ marginBottom: 16 }} disabled={!selectable} onPress={ () => getMyCal(navigation) }>
@@ -1387,8 +1391,14 @@ function HomeScreen({ navigation }) {
13871391
<Text variant="bodyMedium" numberOfLines={1}>{nextEvent.location}</Text>
13881392
</Card.Content>
13891393
<Card.Actions>
1390-
<Chip disabled={!selectable} onPress={ () => getNextEvent("force") } icon="refresh" >Rafraîchir</Chip>
1391-
<Chip disabled={!selectable} onPress={ () => getMyCal(navigation) } icon="calendar" >Emploi du temps</Chip>
1394+
<Chip style={{ marginRight: 4 }} disabled={!selectable} onPress={() => getNextEvent("force")} icon="refresh">Rafraîchir</Chip>
1395+
{ nextEvent.summary != "ADE Indisponible" ? (
1396+
<>
1397+
<Chip disabled={!selectable} onPress={() => getMyCal(navigation)} icon="calendar">Emploi du temps</Chip>
1398+
</>
1399+
) : (
1400+
<Chip disabled={!selectable} onPress={() => getMyCal(navigation)} icon="calendar-alert">EDT (Hors-ligne)</Chip>
1401+
)}
13921402
</Card.Actions>
13931403
</Card>
13941404

@@ -1984,7 +1994,7 @@ function ShowGrades({ navigation }) {
19841994
}
19851995

19861996
// Page d'affichage de l'emploi du temps
1987-
function ShowEDT({ navigation }) {
1997+
function ShowEDT({ navigation }) {
19881998
const [cal, setCalendar] = useState(calendar);
19891999
const [view, setView] = useState("threeDays");
19902000
const [viewIcon, setViewIcon] = useState("magnify-minus");
@@ -2012,13 +2022,14 @@ function ShowEDT({ navigation }) {
20122022
);
20132023

20142024
useEffect(() => {
2025+
async function calCache() {
2026+
setCalendar(await getCalendarFromCache());
2027+
}
2028+
20152029
if(cal == null) {
2016-
async function readJSONonAwait() {
2017-
return await readJSONFromFile();
2018-
}
2019-
cal = JSON.parse(readJSONonAwait());
2020-
setCalendar(cal);
2030+
calCache();
20212031
}
2032+
20222033
setTimeout(() => goToToday(), 500);
20232034
}, []);
20242035

@@ -2426,9 +2437,9 @@ function IconConfig({ navigation }) {
24262437
<ScrollView style={{ paddingLeft: 25, paddingRight: 25 }}>
24272438
<Text style={{ marginTop: 16, textAlign: 'left' }} variant="titleMedium">Choisissez votre icône :</Text>
24282439
<Chip style={{ height: 36, justifyContent: 'center', marginTop: 16, borderBottomLeftRadius: 0, borderBottomRightRadius: 0 }} disabled > Icônes officielles </Chip>
2429-
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icon.png')}/>} onPress={ () => changeIconHome("unicenotes") }> Par défaut </Chip>
2440+
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icon.png')}/>} onPress={ () => changeIconHome("unicenotes") }> Par défaut | ✅ iOS 18 </Chip>
24302441
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icons/icon_magnet.png')}/>} onPress={ () => changeIconHome("magnet") }> Magnet </Chip>
2431-
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icons/icon_ardente.png')}/>} onPress={ () => changeIconHome("ardente") }> Ardente </Chip>
2442+
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icons/icon_ardente.png')}/>} onPress={ () => changeIconHome("ardente") }> Ardente | ✅ iOS 18 </Chip>
24322443
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icons/icon_beach.png')}/>} onPress={ () => changeIconHome("beach") }> Beach </Chip>
24332444
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icons/icon_monaco.png')}/>} onPress={ () => changeIconHome("monaco") }> Monaco </Chip>
24342445
<Chip style={{ height: 48, justifyContent: 'center', borderRadius: 0, marginTop: 1 }} textStyle={{ paddingVertical: 8 }} avatar={<Image size={24} source={require('./assets/icons/icon_melted.png')}/>} onPress={ () => changeIconHome("melted") }> Melted </Chip>
@@ -2749,16 +2760,16 @@ function EDTConfig({ navigation }) {
27492760
<Text style={{ marginLeft: 25, marginRight: 25, marginTop: 8, textAlign: 'left' }} variant="titleMedium">EDT affiché : {adeid}</Text>
27502761
<Divider style={{ marginTop: 16, marginBottom: 16 }} />
27512762
<ScrollView style={{ paddingLeft: 25, paddingRight: 25, marginBottom: 16 }}>
2752-
<Text style={{ marginBottom: 8, textAlign: 'left' }} variant="labelLarge">Entrez un numéro étudiant pour changer l'emploi du temps affiché :</Text>
2753-
<TextInput style={{ marginTop: 8, marginBottom: 8 }} keyboardType='number-pad' maxLength={ 12 } label="Numéro étudiant" value={tempAde} onChangeText={setTempAde} right={<TextInput.Icon icon="content-save" onPress={() => selectCursus(tempAde, true)} />} />
2763+
<Text style={{ textAlign: 'left' }} variant="labelLarge">Entrez un numéro étudiant pour changer l'emploi du temps affiché :</Text>
2764+
<TextInput style={{ marginTop: 8, marginBottom: 8 }} mode='outlined' keyboardType='number-pad' maxLength={ 12 } label="Numéro étudiant" value={tempAde} onChangeText={setTempAde} right={<TextInput.Icon icon="content-save" onPress={() => selectCursus(tempAde, true)} />} />
27542765
<Text style={{ marginTop: 8, textAlign: 'left' }} variant="labelLarge">Ou cliquez ci-dessous pour restaurer votre emploi du temps individuel.</Text>
27552766
<Chip style={{ height: 48, justifyContent: 'center', marginTop: 16 }} textStyle={{ paddingVertical: 8 }} icon="information" onPress={() => selectCursus(userADEData.uid, true)}> Restaurer votre numéro : {userADEData.uid} </Chip>
27562767
<Card style={{ marginTop: 16 }}>
27572768
<Card.Title left={(props) => <Avatar.Icon {...props} icon="information" />} />
27582769
<Card.Content>
27592770
<Text style={{ textAlign: 'left' }} variant="bodyLarge">
27602771
{userADEData.uid == "demo" || userADEData.uid == "" || userADEData.uid == null ?
2761-
"Veuillez vous connecter (sur l'onglet Notes) afin de récupérer votre numéro étudiant." :
2772+
"Votre numéro étudiant est celui indiqué sur votre carte étudiant. \nOu sinon, veuillez vous connecter (sur l'onglet Notes) afin de récupérer votre numéro étudiant." :
27622773
"L'emploi du temps individuel comprend les cours de votre cursus (TD, ...) ainsi que les cours de groupes dont vous faites partie (TP, ...). "}
27632774
</Text>
27642775
</Card.Content>

app.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"expo": {
33
"name": "UniceNotes",
44
"slug": "unicenotes",
5-
"version": "2.1.1",
5+
"version": "2.1.2",
66
"githubUrl": "https://github.com/UniceApps/UniceNotes",
77
"orientation": "portrait",
88
"icon": "./assets/icon.png",
@@ -26,14 +26,14 @@
2626
"CADisableMinimumFrameDurationOnPhone": true
2727
},
2828
"bundleIdentifier": "fr.hugofnm.unicenotes",
29-
"buildNumber": "10.2.1",
29+
"buildNumber": "10.3.1",
3030
"config": {
3131
"usesNonExemptEncryption": false
3232
}
3333
},
3434
"android": {
3535
"package": "fr.hugofnm.unicenotes",
36-
"versionCode": 31
36+
"versionCode": 33
3737
},
3838
"extra": {
3939
"eas": {

package-lock.json

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "unicenotes",
3-
"version": "2.1.0",
3+
"version": "2.1.2",
44
"scripts": {
55
"start": "expo start --dev-client",
66
"android": "expo run:android",
@@ -20,7 +20,7 @@
2020
"@react-navigation/native": "^6.1.2",
2121
"@react-navigation/native-stack": "^6.9.8",
2222
"@shopify/flash-list": "1.6.4",
23-
"expo": "~51.0.35",
23+
"expo": "~51.0.36",
2424
"expo-application": "~5.9.1",
2525
"expo-av": "~14.0.7",
2626
"expo-constants": "~16.0.2",
@@ -36,7 +36,7 @@
3636
"expo-linking": "~6.3.1",
3737
"expo-local-authentication": "~14.0.1",
3838
"expo-network": "~6.0.1",
39-
"expo-notifications": "~0.28.17",
39+
"expo-notifications": "~0.28.18",
4040
"expo-quick-actions": "^2.0.0",
4141
"expo-secure-store": "~13.0.2",
4242
"expo-sharing": "~12.0.1",

0 commit comments

Comments
 (0)