Skip to content

Commit

Permalink
chore: merge pull request #343 from imyanice/main
Browse files Browse the repository at this point in the history
ed: small tweaks to make everything as smooth as possible
  • Loading branch information
Vexcited authored Nov 9, 2024
2 parents 5469d38 + 420dd61 commit fb53791
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"restore-app-icon": "cp -a ./AppIcon.appiconset.backup/. ios/Papillon/Images.xcassets/AppIcon.appiconset/"
},
"dependencies": {
"@babel/runtime": "^7.26.0",
"@birdwingo/react-native-reanimated-graph": "^1.1.3",
"@candlefinance/app-icon": "^0.4.5",
"@notifee/react-native": "^7.8.2",
Expand All @@ -19,6 +20,7 @@
"@react-native-community/netinfo": "11.3.1",
"@react-native-cookies/cookies": "^6.2.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-native/assets-registry": "^0.76.1",
"@react-navigation/bottom-tabs": "^6.6.0",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
Expand Down Expand Up @@ -68,7 +70,7 @@
"lottie-react-native": "^6.7.0",
"lucide-react-native": "^0.378.0",
"openid-client": "^5.7.0",
"pawdirecte": "^1.5.0",
"pawdirecte": "^1.6.0",
"pawnilim": "^0.2.0",
"pawnote": "^1.0.3",
"pawrd": "^0.6.1",
Expand Down
17 changes: 9 additions & 8 deletions src/utils/format/format_pronote_initials.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
function parse_initials (content: string): string {
const initials = content.split(" ").map((word) => word[0].toUpperCase()).join("");
let formattedInitials = initials.slice(1);
if (formattedInitials.length === 0) {
if (content.split(" ").length === 1) formattedInitials = content;
else formattedInitials = "??";
}
function parse_initials (content: string) {
content = content.trimStart().trimEnd();
if (content === "") return "??";
let initials = content.split(" ").map((word) => word[0].toUpperCase()).join("");

return formattedInitials;
if (initials.length === 0) {
if (content.split(" ").length === 1) initials = content;
else initials = "??";
} else if (initials.length === 3) initials = initials.slice(1); // We assume it's in the format M. J. Dupont ou MMe. C. Dupont
return initials;
}

export default parse_initials;
2 changes: 1 addition & 1 deletion src/views/account/Grades/Atoms/GradeTitle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export const GradeTitle = ({ grade, subjectData }: GradeTitleProps) => {
marginBottom: 1,
}}
>
/{parseFloat(grade.outOf.value?.toString() || "20").toFixed(0)}
/{parseFloat(grade.outOf.value?.toString() || "20")}
</NativeText>
</View>
</View>
Expand Down

0 comments on commit fb53791

Please sign in to comment.