Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mutiples fixes #294

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1bd4274
fixe(Timetable): Salle widget cours #279
Gabriel29306 Oct 10, 2024
1aba2ab
fix(lessonDocument): use safe area insets
Gabriel29306 Oct 11, 2024
33b8a35
refactor(lessonDocument): Change animation to "slide_from_bottom"
Gabriel29306 Oct 11, 2024
16a0091
refactor(lessonDocument): new line between classes
Gabriel29306 Oct 11, 2024
9440bf1
fix(lessonDocument): Center subject's icon #256
Gabriel29306 Oct 11, 2024
082ada8
fix(expo): expo-font configuration
Gabriel29306 Oct 11, 2024
57d895e
fix(typo): semiBold => semibold
Gabriel29306 Oct 11, 2024
e680b1e
chore(deps): upgrade deps
Gabriel29306 Oct 12, 2024
0abac57
refactor(extract_pronote_name.ts/upperFirst): Allow multiple familly …
Gabriel29306 Oct 12, 2024
3f1d072
refactor: remove unecessary
Gabriel29306 Oct 12, 2024
621cd38
fix: link icon instead of file
Gabriel29306 Oct 13, 2024
1c448db
fix(Widget/LastGrade): center icon + Round icon back
Gabriel29306 Oct 13, 2024
6fc7957
fix(Settings): fix "Soutenir Papillon" buttun overrided by "Quoi de n…
Gabriel29306 Oct 13, 2024
2106541
refactor(SettingsTabs): Ensuring Home tab is in the correct position
Gabriel29306 Oct 13, 2024
5251ac4
Merge branch 'main' of https://github.com/PapillonApp/Papillon into m…
Gabriel29306 Oct 14, 2024
5165f7b
fix(news): infinite loading
Gabriel29306 Oct 17, 2024
a4c7ec8
fix(Homework/Document): use safe area insets
Gabriel29306 Oct 17, 2024
4f3a6d8
fix(Homework/Document): center subject icon
Gabriel29306 Oct 17, 2024
9912ef1
feat: set animation from bottom
Gabriel29306 Oct 17, 2024
7e26d29
feat(SettingsTabs): Automatic reorder tabs when enabled
Gabriel29306 Oct 17, 2024
98ff9f0
chore: upgrade deps
Gabriel29306 Oct 17, 2024
62a37db
fix(NewsItem): use safe area insets
Gabriel29306 Oct 17, 2024
ff805a1
fix conflicts
Gabriel29306 Oct 17, 2024
2b95fb4
fixs
Gabriel29306 Oct 17, 2024
2c65edc
fix: use safe area insets
Gabriel29306 Oct 17, 2024
d22d096
fix: use safe area insets
Gabriel29306 Oct 17, 2024
dd50eee
refactor: Change donation button for Android only
Gabriel29306 Oct 17, 2024
ed8bad8
fix(GradeItem): center subject's emoji
Gabriel29306 Oct 18, 2024
2e7a2a6
fix: `account.personalization?.magicEnabled` => `account.personalizat…
Gabriel29306 Oct 20, 2024
5edcdb7
Perf: Remove redondant instruction
Gabriel29306 Oct 20, 2024
4724ee3
Merge branch 'main' into mutiples-fixes
Gabriel29306 Oct 22, 2024
1f817e5
Merge branch 'main' of https://github.com/PapillonApp/Papillon into m…
Gabriel29306 Oct 26, 2024
93afc11
chore: update modules
Gabriel29306 Oct 28, 2024
00285ec
fix: lint
Gabriel29306 Oct 28, 2024
033d0c4
chore: Resolve conflicts + lint
Gabriel29306 Oct 28, 2024
cdbd823
chore: fix conflicts +lint + update pawdirecte
Gabriel29306 Oct 28, 2024
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
13 changes: 12 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,18 @@
]
},
"plugins": [
"expo-font",
[
"expo-font",
{
"fonts": [
"assets/fonts/FixelText-Bold.ttf",
"assets/fonts/FixelText-Light.ttf",
"assets/fonts/FixelText-Medium.ttf",
"assets/fonts/FixelText-Regular.ttf",
"assets/fonts/FixelText-SemiBold.ttf"
]
}
],
"expo-barcode-scanner",
[
"expo-location",
Expand Down
7,325 changes: 3,886 additions & 3,439 deletions package-lock.json

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
"@babel/runtime": "^7.25.7",
"@birdwingo/react-native-reanimated-graph": "^1.1.3",
"@candlefinance/app-icon": "^0.4.5",
"@notifee/react-native": "^7.8.2",
"@notifee/react-native": "^7.9.0",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-community/netinfo": "11.3.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-native/assets-registry": "^0.75.4",
"@react-navigation/bottom-tabs": "^6.6.0",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
"@react-navigation/stack": "^6.4.0",
"@react-navigation/bottom-tabs": "^6.6.1",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@react-navigation/stack": "^6.4.1",
"axios": "^1.7.7",
"buffer": "^6.0.3",
"cal-parser": "^1.0.2",
"date-fns": "^3.6.0",
"expo": "^51.0.36",
"expo": "~51.0.17",
"expo-asset": "^10.0.10",
"expo-auth-session": "~5.5.2",
"expo-av": "~14.0.6",
Expand All @@ -39,7 +39,7 @@
"expo-clipboard": "~6.0.3",
"expo-constants": "~16.0.2",
"expo-crypto": "~13.0.2",
"expo-dev-menu": "^5.0.16",
"expo-dev-menu": "^5.0.22",
"expo-device": "~6.0.2",
"expo-file-system": "~17.0.1",
"expo-font": "~12.0.7",
Expand All @@ -54,39 +54,39 @@
"expo-navigation-bar": "~3.0.7",
"expo-sensors": "~13.0.9",
"expo-sharing": "~12.0.1",
"expo-splash-screen": "~0.27.6",
"expo-splash-screen": "^0.27.6",
"expo-status-bar": "~1.12.1",
"expo-system-ui": "~3.0.7",
"expo-task-manager": "~11.8.2",
"expo-web-browser": "~13.0.3",
"html-entities": "^2.5.2",
"html-react-parser": "^5.1.12",
"html-react-parser": "^5.1.18",
"html-to-text": "^9.0.5",
"js-base64": "^3.7.7",
"lodash": "^4.17.21",
"lottie-react-native": "^6.7.0",
"lottie-react-native": "^6.7.2",
"lucide-react-native": "^0.378.0",
"openid-client": "^5.7.0",
"pawdirecte": "^1.5.0",
"pawnilim": "^0.2.0",
"pawnote": "^1.0.3",
"pawnote": "^1.2.2",
"pawrd": "^0.4.0",
"react": "18.2.0",
"react-native": "^0.74.3",
"react-native": "^0.74.6",
"react-native-barcode-svg": "^0.0.15",
"react-native-draggable-flatlist": "^4.0.1",
"react-native-draglist": "^3.6.1",
"react-native-gesture-handler": "^2.16.1",
"react-native-infinite-pager": "^0.3.16",
"react-native-draglist": "^3.6.2",
"react-native-gesture-handler": "^2.20.2",
"react-native-infinite-pager": "^0.3.18",
"react-native-pager-view": "6.3.0",
"react-native-parsed-text": "^0.0.22",
"react-native-pressable-scale": "^2.1.0",
"react-native-qrcode-svg": "^6.3.1",
"react-native-qrcode-svg": "^6.3.12",
"react-native-reanimated": "~3.10.1",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "4.10.5",
"react-native-screens": "3.31.1",
"react-native-svg": "^15.2.0",
"react-native-svg": "^15.8.0",
"react-native-url-polyfill": "^2.0.0",
"react-native-view-shot": "3.8.0",
"react-native-webview": "13.8.6",
Expand All @@ -95,23 +95,23 @@
"text-encoding": "^0.7.0",
"turbawself": "^1.1.1",
"uphf-api": "^2.2.0",
"zustand": "^4.5.2"
"zustand": "^4.5.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@stylistic/eslint-plugin": "^2.1.0",
"@babel/core": "^7.26.0",
"@stylistic/eslint-plugin": "^2.9.0",
"@types/base-64": "^1.0.2",
"@types/html-to-text": "^9.0.4",
"@types/lodash": "^4.17.7",
"@types/lodash": "^4.17.12",
"@types/react": "~18.2.45",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-plugin-react": "^7.37.2",
"eslint-plugin-react-native": "^4.1.0",
"expo": "~51.0.17",
"react-native-svg-transformer": "^1.5.0",
"typescript": "^5.3.3"
"typescript": "^5.6.3"
},
"private": true
}
14 changes: 7 additions & 7 deletions src/components/Home/AccountSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import Reanimated, {
LinearTransition, useAnimatedStyle,
ZoomIn,
ZoomOut,
SharedValue
} from "react-native-reanimated";

import { useCurrentAccount } from "@/stores/account";
import { defaultProfilePicture } from "@/utils/ui/default-profile-picture";
import PapillonSpinner from "../Global/PapillonSpinner";
import { animPapillon } from "@/utils/ui/animations";
import Animated from "react-native-reanimated";
import { BlurView } from "expo-blur";

const ReanimatedBlurView = Reanimated.createAnimatedComponent(BlurView);
Expand All @@ -23,7 +23,7 @@ const AccountSwitcher: React.FC<{
small?: boolean,
opened?: boolean,
modalOpen?: boolean,
translationY?: Reanimated.SharedValue<number>,
translationY?: SharedValue<number>,
loading?: boolean,
}> = ({ small, opened, modalOpen, translationY, loading }) => {
const theme = useTheme();
Expand All @@ -38,20 +38,20 @@ const AccountSwitcher: React.FC<{
borderWidth: 1,
borderRadius: 80,
borderColor: interpolateColor(
translationY.value,
translationY?.value ?? 200,
[200, 251],
["#ffffff50", colors.border],
),
backgroundColor: interpolateColor(
translationY.value,
translationY?.value ?? 200,
[200, 251],
["#ffffff30", "transparent"],
),
}));

const textAnimatedStyle = useAnimatedStyle(() => ({
color: interpolateColor(
translationY.value,
translationY?.value ?? 200,
[200, 251],
["#FFF", colors.text],
),
Expand All @@ -61,10 +61,10 @@ const AccountSwitcher: React.FC<{
}));


const AnimatedChevronDown = Animated.createAnimatedComponent(ChevronDown);
const AnimatedChevronDown = Reanimated.createAnimatedComponent(ChevronDown);
const iconAnimatedStyle = useAnimatedStyle(() => ({
color: interpolateColor(
translationY.value,
translationY?.value ?? 200,
[200, 251],
["#FFF", colors.text],
),
Expand Down
19 changes: 12 additions & 7 deletions src/router/helpers/types.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import {AddonLogs as AddonLog, AddonPlacementManifest} from "@/addons/types";
import { AddonLogs as AddonLog, AddonPlacementManifest } from "@/addons/types";
import type { Chat } from "@/services/shared/Chat";
import type {Grade, GradesPerSubject} from "@/services/shared/Grade";
import type { Grade, GradesPerSubject } from "@/services/shared/Grade";
import { Homework } from "@/services/shared/Homework";
import type { AccountService } from "@/stores/account/types";
import { Log } from "@/utils/logger/logger";
import type { CurrentPosition } from "@/utils/native/location";
import type { NativeStackScreenProps } from "@react-navigation/native-stack";
import type pronote from "pawnote";
import type React from "react";
import type { School as SkolengoSchool} from "scolengo-api/types/models/School";
import {Information} from "@/services/shared/Information";
import type { School as SkolengoSchool } from "scolengo-api/types/models/School";

export type RouteParameters = {
// welcome.index
Expand Down Expand Up @@ -78,8 +76,15 @@ export type RouteParameters = {
Homeworks?: { outsideNav?: boolean };
HomeworksDocument: { homework: Homework };

News?: { outsideNav?: boolean, isED: boolean };
NewsItem: { message: string, important: boolean, isED: boolean };
News?: {
outsideNav?: boolean,
isED: boolean
};
NewsItem: {
message: string,
important: boolean,
isED: boolean
};

Grades?: { outsideNav?: boolean };
GradeSubject: { subject: GradesPerSubject, allGrades: Grade[] };
Expand Down
3 changes: 3 additions & 0 deletions src/router/screens/views/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default [
headerTitle: "Item",
presentation: "modal",
headerShown: false,
animation: "slide_from_bottom"
}),
createScreen("AddonLogs", AddonLogs, {
headerTitle: "Logs",
Expand All @@ -55,11 +56,13 @@ export default [
headerTitle: "Cours",
presentation: "modal",
headerShown: false,
animation: "slide_from_bottom"
}),
createScreen("HomeworksDocument", HomeworksDocument, {
headerTitle: "Devoir",
presentation: "modal",
headerShown: false,
animation: "slide_from_bottom"
}),
createScreen("GradeSubject", GradeSubjectScreen, {
headerTitle: "Détail de la matière",
Expand Down
12 changes: 6 additions & 6 deletions src/services/ecoledirecte/attendance.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import ecoledirecte, {AttendanceItem, AttendanceItemKind} from "pawdirecte";
import ecoledirecte, { AttendanceItem, AttendanceItemKind } from "pawdirecte";
import type { EcoleDirecteAccount } from "@/stores/account/types";
import { ErrorServiceUnauthenticated } from "../shared/errors";
import type { Attendance } from "../shared/Attendance";
import {dateStringAsTimeInterval, getDuration} from "@/services/ecoledirecte/time-interval";
import {Punishment} from "@/services/shared/Punishment";
import {Absence} from "@/services/shared/Absence";
import {Delay} from "@/services/shared/Delay";
import { dateStringAsTimeInterval, getDuration } from "@/services/ecoledirecte/time-interval";
import { Punishment } from "@/services/shared/Punishment";
import { Absence } from "@/services/shared/Absence";
import { Delay } from "@/services/shared/Delay";

const decodeDelay = (item: AttendanceItem): Delay => {
const timeInterval = dateStringAsTimeInterval(item.displayDate);
Expand Down Expand Up @@ -50,7 +50,7 @@ const decodePunishment = (item: AttendanceItem): Punishment => {
exclusion: false,
homework: {
documents: [],
text: item.todo
text: item.todo ? "Fait" : "À faire"
},
nature: "",
reason: {
Expand Down
8 changes: 6 additions & 2 deletions src/utils/format/extract_pronote_name.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
function upperFirst (str: string): string {
return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
let result = str.split(/[-\s]/);
result.forEach((value: string, index: number) => {
result[index] = value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
});
return result.join(" ");
}

function upperName (name: string): string {
return name.split("-").map(upperFirst).join("-");
}

export default function extract_pronote_name (fullName: string) {
const regex = /^([\p{L} \-]+) ([\p{L}\-]+.*)$/u;
const regex = /^([\p{L} -]+) ([\p{L}-]+.*)$/u;
const match = fullName.match(regex);

if (match) {
Expand Down
6 changes: 5 additions & 1 deletion src/utils/ui/corner-radius.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ const radiuses = [
{
devices: "ipad (10th generation)",
radius: 22.0
},
{
devices: "sm-f721b",
radius: 41.51
}
];

Expand All @@ -54,4 +58,4 @@ const getCorners = (): number => {
return corner ? corner.radius : 0;
};

export default getCorners;
export default getCorners;
4 changes: 2 additions & 2 deletions src/utils/ui/default-profile-picture.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AccountService } from "@/stores/account/types";

export const defaultProfilePicture = (service: AccountService, accountProvider: string) => {
export const defaultProfilePicture = (service?: AccountService, accountProvider?: string) => {
switch (accountProvider) {
case "Université de Rennes":
return require("../../../assets/images/service_rennes1.png");
Expand All @@ -24,4 +24,4 @@ export const defaultProfilePicture = (service: AccountService, accountProvider:
}

return require("../../../assets/images/service_unknown.png");
};
};
19 changes: 4 additions & 15 deletions src/views/account/Grades/Grades.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,8 @@ import { useTheme } from "@react-navigation/native";
import { ChevronDown } from "lucide-react-native";
import React from "react";
import { lazy, Suspense, useEffect, useMemo, useRef, useState } from "react";
import {
ActivityIndicator,
Platform,
RefreshControl,
ScrollView,
View,
} from "react-native";
import Reanimated, {
FadeInUp,
FadeOut,
FadeOutDown,
LinearTransition,
} from "react-native-reanimated";
import { ActivityIndicator, Platform, RefreshControl, ScrollView, View } from "react-native";
import Reanimated, { FadeInUp, FadeOut, FadeOutDown, LinearTransition } from "react-native-reanimated";
import { useSafeAreaInsets } from "react-native-safe-area-context";

const GradesAverageGraph = lazy(() => import("./Graph/GradesAverage"));
Expand Down Expand Up @@ -133,7 +122,7 @@ const Grades: Screen<"Grades"> = ({ route, navigation }) => {
}, [selectedPeriod, grades]);

return (
<>
<View style={{marginTop: outsideNav ? insets.top : undefined, flex: 1}}>
<PapillonModernHeader outsideNav={outsideNav}>
<PapillonPicker
delay={0}
Expand Down Expand Up @@ -242,7 +231,7 @@ const Grades: Screen<"Grades"> = ({ route, navigation }) => {
</Suspense>
</ScrollView>
)}
</>
</View>
);
};

Expand Down
Loading
Loading