diff --git a/.gitignore b/.gitignore index f4e4fba5..153adfb9 100644 --- a/.gitignore +++ b/.gitignore @@ -53,4 +53,7 @@ yarn.lock secrets.json .vscode/ -.idea/ \ No newline at end of file +.idea/ + +.claude/ +.codex/ \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index c9e126b9..f64a4df6 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -7,6 +7,8 @@ + + @@ -21,6 +23,7 @@ + diff --git a/app.config.ts b/app.config.ts index d0553bb4..9f499681 100644 --- a/app.config.ts +++ b/app.config.ts @@ -13,12 +13,6 @@ export default { scheme: ["papillon", "izly", "skoapp-prod"], platforms: ["ios", "android"], userInterfaceStyle: "automatic", - newArchEnabled: true, - splash: { - image: "./assets/images/splash.png", - resizeMode: "cover", - backgroundColor: "#003A21", - }, ios: { appStoreUrl: "https://apps.apple.com/us/app/papillon-lappli-scolaire/id6477761165", @@ -94,11 +88,6 @@ export default { monochromeImage: "./assets/images/monochrome-icon.png", }, edgeToEdgeEnabled: true, - splash: { - image: "./assets/images/splash_android.png", - resizeMode: "cover", - backgroundColor: "#003A21", - }, supportsTablet: true, predictiveBackGestureEnabled: true }, @@ -109,12 +98,21 @@ export default { }, plugins: [ "expo-router", + "expo-status-bar", "expo-font", "expo-video", "expo-audio", "expo-localization", "expo-asset", "@react-native-community/datetimepicker", + [ + "expo-splash-screen", + { + "backgroundColor": "#29947A", + "image": "./assets/images/logotype.png", + "imageWidth": 240 + } + ], [ "expo-image-picker", { diff --git a/app/(dev)/request.tsx b/app/(dev)/request.tsx index 0db288dd..1734e98d 100644 --- a/app/(dev)/request.tsx +++ b/app/(dev)/request.tsx @@ -2,7 +2,7 @@ import React, { useEffect, useState, useMemo } from "react"; import { View } from "react-native"; import { useLocalSearchParams } from "expo-router"; import * as Clipboard from "expo-clipboard"; -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { useNetworkStore } from "@/stores/logs"; import Button from "@/ui/components/Button"; diff --git a/app/(dev)/requests.tsx b/app/(dev)/requests.tsx index 6ae6a7e8..860e26bf 100644 --- a/app/(dev)/requests.tsx +++ b/app/(dev)/requests.tsx @@ -10,7 +10,7 @@ import List from "@/ui/new/List"; import Typography from "@/ui/new/Typography"; import adjust from "@/utils/adjustColor"; import { Papicons } from "@getpapillon/papicons"; -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { router, useLocalSearchParams } from "expo-router" import { useState } from "react"; import { View } from "react-native"; diff --git a/app/(features)/(cards)/specific.tsx b/app/(features)/(cards)/specific.tsx index 1edd8398..4f366b6a 100644 --- a/app/(features)/(cards)/specific.tsx +++ b/app/(features)/(cards)/specific.tsx @@ -1,7 +1,6 @@ import { useCallback, useEffect, useState, useMemo } from "react"; import { Platform, ScrollView, View } from "react-native"; -import { useHeaderHeight } from "@react-navigation/elements"; -import { useTheme } from "@react-navigation/native"; +import { useHeaderHeight, useTheme } from "expo-router/react-navigation"; import { LinearGradient } from "expo-linear-gradient"; import { router, useLocalSearchParams } from "expo-router"; import { Switch } from "react-native-gesture-handler"; diff --git a/app/(features)/(news)/specific.tsx b/app/(features)/(news)/specific.tsx index 75b68612..31a1fdac 100644 --- a/app/(features)/(news)/specific.tsx +++ b/app/(features)/(news)/specific.tsx @@ -14,7 +14,7 @@ import { VARIANTS } from "@/ui/components/Typography"; import HTMLView from 'react-native-htmlview'; import * as WebBrowser from 'expo-web-browser'; -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { NativeHeaderPressable, NativeHeaderSide } from "@/ui/components/NativeHeader"; import { MenuView } from "@react-native-menu/menu"; import Icon from "@/ui/components/Icon"; diff --git a/app/(features)/attendance.tsx b/app/(features)/attendance.tsx index 64e3774c..2afaa99b 100644 --- a/app/(features)/attendance.tsx +++ b/app/(features)/attendance.tsx @@ -3,7 +3,7 @@ import { NativeHeaderHighlight, NativeHeaderPressable, NativeHeaderSide, NativeH import { router, useLocalSearchParams } from "expo-router"; import { Platform, ScrollView, View } from "react-native"; import { Papicons } from "@getpapillon/papicons" -import { useTheme } from "@react-navigation/native"; +import { useTheme, useHeaderHeight } from "expo-router/react-navigation"; import { Dynamic } from "@/ui/components/Dynamic"; import { MenuView } from "@react-native-menu/menu"; import { Period } from "@/services/shared/grade"; @@ -11,7 +11,6 @@ import { getPeriodName, getPeriodNumber, isPeriodWithNumber } from "@/utils/serv import { useMemo, useState } from "react"; import { Attendance } from "@/services/shared/attendance"; import Stack from "@/ui/components/Stack"; -import { useHeaderHeight } from "@react-navigation/elements"; import AnimatedNumber from "@/ui/components/AnimatedNumber"; import adjust from "@/utils/adjustColor"; import { error } from "@/utils/logger/logger"; diff --git a/app/(modals)/address.tsx b/app/(modals)/address.tsx index d29df087..870af9cd 100644 --- a/app/(modals)/address.tsx +++ b/app/(modals)/address.tsx @@ -1,5 +1,5 @@ import { Papicons } from "@getpapillon/papicons"; -import { useTheme } from "@react-navigation/native"; +import { useTheme, useHeaderHeight } from "expo-router/react-navigation"; import * as Linking from "expo-linking"; import * as Location from "expo-location"; import * as React from "react"; @@ -22,7 +22,6 @@ import Item, { Leading, Trailing } from "@/ui/components/Item"; import List from "@/ui/components/List"; import Search from "@/ui/components/Search"; import Typography from "@/ui/components/Typography"; -import { useHeaderHeight } from "@react-navigation/elements"; import AndroidBackButton, { AndroidBackButtonStyles } from "@/utils/theme/AndroidBackButton"; import Icon from "@/ui/components/Icon"; diff --git a/app/(modals)/course.tsx b/app/(modals)/course.tsx index a406d520..a7cdd17c 100644 --- a/app/(modals)/course.tsx +++ b/app/(modals)/course.tsx @@ -1,5 +1,5 @@ import { Papicons } from '@getpapillon/papicons'; -import { useRoute, useTheme } from "@react-navigation/native"; +import { useRoute, useTheme } from "expo-router/react-navigation"; import { formatDistanceStrict, formatDistanceToNow } from 'date-fns' import * as DateLocale from 'date-fns/locale'; import i18n, { t } from "i18next"; diff --git a/app/(modals)/grade.tsx b/app/(modals)/grade.tsx index 9add0c20..4c103805 100644 --- a/app/(modals)/grade.tsx +++ b/app/(modals)/grade.tsx @@ -1,5 +1,5 @@ import { Papicons } from '@getpapillon/papicons'; -import { useRoute, useTheme } from "@react-navigation/native"; +import { useRoute, useTheme } from "expo-router/react-navigation"; import { t } from "i18next"; import React from "react"; import { Platform, View } from "react-native"; diff --git a/app/(modals)/news.tsx b/app/(modals)/news.tsx index 759f1a13..35791c33 100644 --- a/app/(modals)/news.tsx +++ b/app/(modals)/news.tsx @@ -13,7 +13,7 @@ import { VARIANTS } from "@/ui/components/Typography"; import HTMLView from 'react-native-htmlview'; import * as WebBrowser from 'expo-web-browser'; -import { useTheme } from "@react-navigation/native"; +import { useTheme, HeaderBackButton } from "expo-router/react-navigation"; import { NativeHeaderPressable, NativeHeaderSide } from "@/ui/components/NativeHeader"; import { MenuView } from "@react-native-menu/menu"; import Icon from "@/ui/components/Icon"; @@ -25,7 +25,6 @@ import { cleanHtmlForArticle } from "@/utils/news/cleanUpHTMLNews"; import { news } from "pawnote"; import Avatar from "@/ui/components/Avatar"; import { getInitials } from "@/utils/chats/initials"; -import { HeaderBackButton } from "@react-navigation/elements"; import { runsIOS26 } from "@/ui/utils/IsLiquidGlass"; import { IconNames, Papicons } from "@getpapillon/papicons"; import { getAttachmentIcon } from "@/utils/news/getAttachmentIcon"; diff --git a/app/(modals)/notifications.tsx b/app/(modals)/notifications.tsx index 44e79dd8..9fdaba64 100644 --- a/app/(modals)/notifications.tsx +++ b/app/(modals)/notifications.tsx @@ -1,5 +1,5 @@ import { Papicons } from "@getpapillon/papicons"; -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { useTranslation } from "react-i18next"; import Stack from "@/ui/components/Stack"; diff --git a/app/(modals)/profile.tsx b/app/(modals)/profile.tsx index 810fcb5a..10d7ec1e 100644 --- a/app/(modals)/profile.tsx +++ b/app/(modals)/profile.tsx @@ -1,7 +1,6 @@ import { Papicons } from "@getpapillon/papicons"; import { MenuView, NativeActionEvent } from "@react-native-menu/menu"; -import { useHeaderHeight } from "@react-navigation/elements"; -import { useTheme } from "@react-navigation/native"; +import { useHeaderHeight, useTheme } from "expo-router/react-navigation"; import * as ImagePicker from "expo-image-picker" import { router } from "expo-router"; import React, { useEffect, useState } from "react"; diff --git a/app/(modals)/task.tsx b/app/(modals)/task.tsx index 40561a4e..80ca6da5 100644 --- a/app/(modals)/task.tsx +++ b/app/(modals)/task.tsx @@ -1,5 +1,5 @@ import { Papicons } from "@getpapillon/papicons"; -import { useRoute, useTheme } from "@react-navigation/native"; +import { useRoute, useTheme } from "expo-router/react-navigation"; import { LinearGradient } from "expo-linear-gradient"; import * as WebBrowser from "expo-web-browser"; import { t } from "i18next"; diff --git a/app/(modals)/wallpaper.tsx b/app/(modals)/wallpaper.tsx index 5171c140..0b04577d 100644 --- a/app/(modals)/wallpaper.tsx +++ b/app/(modals)/wallpaper.tsx @@ -4,7 +4,7 @@ import { Wallpaper } from "@/stores/settings/types" import AnimatedPressable from "@/ui/components/AnimatedPressable" import Stack from "@/ui/components/Stack" import Typography from "@/ui/components/Typography" -import { useTheme } from "@react-navigation/native" +import { useTheme } from "expo-router/react-navigation" import React, { useEffect, useState } from "react" import { FlatList, Image, Platform, RefreshControl, View } from "react-native" import { File, Directory, Paths } from 'expo-file-system'; @@ -155,13 +155,12 @@ const WallpaperModal = () => { ( @@ -208,7 +207,7 @@ const WallpaperModal = () => { fetchCollections(true)} - progressViewOffset={72} + progressViewOffset={128} /> } /> diff --git a/app/(modals)/wrapped/stories/consent.tsx b/app/(modals)/wrapped/stories/consent.tsx index c3ce5d6c..1af58f48 100644 --- a/app/(modals)/wrapped/stories/consent.tsx +++ b/app/(modals)/wrapped/stories/consent.tsx @@ -1,5 +1,5 @@ import { Papicons } from '@getpapillon/papicons'; -import { useTheme } from '@react-navigation/native'; +import { useTheme } from "expo-router/react-navigation"; import { LiquidGlassView } from '@sbaiahmed1/react-native-blur'; import React, { memo, useCallback, useState } from 'react'; import { Dimensions, FlatList, StyleSheet, Switch, View } from 'react-native'; diff --git a/app/(new)/event.tsx b/app/(new)/event.tsx index f34af91c..57adce96 100644 --- a/app/(new)/event.tsx +++ b/app/(new)/event.tsx @@ -1,5 +1,5 @@ import DateTimePicker, { DateTimePickerAndroid } from '@react-native-community/datetimepicker'; -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import * as Localization from "expo-localization"; import { useRouter } from "expo-router"; import { CalendarDays, Check, Clock4Icon, MapPinIcon, TypeIcon, User2Icon, X } from "lucide-react-native"; diff --git a/app/(onboarding)/ageSelection.tsx b/app/(onboarding)/ageSelection.tsx index 016e19b3..1c9007dc 100644 --- a/app/(onboarding)/ageSelection.tsx +++ b/app/(onboarding)/ageSelection.tsx @@ -1,5 +1,4 @@ -import { useHeaderHeight } from "@react-navigation/elements"; -import { useTheme } from "@react-navigation/native"; +import { useHeaderHeight, useTheme } from "expo-router/react-navigation"; import { useNavigation } from "expo-router"; import React, { useState } from "react"; import { FlatList, StatusBar, View } from "react-native"; diff --git a/app/(onboarding)/components/LoginView.tsx b/app/(onboarding)/components/LoginView.tsx index d06f4760..46f2a246 100644 --- a/app/(onboarding)/components/LoginView.tsx +++ b/app/(onboarding)/components/LoginView.tsx @@ -1,4 +1,4 @@ -import { useTheme } from '@react-navigation/native'; +import { useTheme } from "expo-router/react-navigation"; import React from 'react'; import { Alert, Image, View } from 'react-native'; import { useTranslation } from "react-i18next"; diff --git a/app/(onboarding)/components/OnboardingSelector.tsx b/app/(onboarding)/components/OnboardingSelector.tsx index 0c8ea4f8..10cc019d 100644 --- a/app/(onboarding)/components/OnboardingSelector.tsx +++ b/app/(onboarding)/components/OnboardingSelector.tsx @@ -1,5 +1,5 @@ import { Papicons } from "@getpapillon/papicons"; -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { LinearGradient } from "expo-linear-gradient"; import React from "react"; import { View } from "react-native"; diff --git a/app/(onboarding)/components/OnboardingWebView.tsx b/app/(onboarding)/components/OnboardingWebView.tsx index a67a320e..4ac1f265 100644 --- a/app/(onboarding)/components/OnboardingWebView.tsx +++ b/app/(onboarding)/components/OnboardingWebView.tsx @@ -1,5 +1,5 @@ import { Papicons } from "@getpapillon/papicons"; -import { useTheme } from "@react-navigation/native"; +import { useTheme, useHeaderHeight } from "expo-router/react-navigation"; import React from "react"; import { Platform, View } from "react-native"; import { useSafeAreaInsets } from "react-native-safe-area-context"; @@ -7,7 +7,6 @@ import WebView from "react-native-webview"; import { Dynamic } from "@/ui/components/Dynamic"; import Typography from "@/ui/new/Typography"; -import { useHeaderHeight } from "@react-navigation/elements"; import AndroidBackButton from "@/utils/theme/AndroidBackButton"; export default function OnboardingWebView({ webViewRef, ...props }: React.ComponentProps) { diff --git a/app/(onboarding)/restaurants/alise.tsx b/app/(onboarding)/restaurants/alise.tsx index 0aa306cd..38e321c4 100644 --- a/app/(onboarding)/restaurants/alise.tsx +++ b/app/(onboarding)/restaurants/alise.tsx @@ -15,7 +15,7 @@ import { useAlert } from "@/ui/components/AlertProvider"; import { t } from "i18next"; import OnboardingInput from "@/components/onboarding/OnboardingInput"; import { useSafeAreaInsets } from "react-native-safe-area-context"; -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { Alise } from "@/services/alise"; import { authenticateWithCredentials } from "alise-api"; import { initializeAccountManager } from "@/services/shared"; diff --git a/app/(onboarding)/restaurants/ard.tsx b/app/(onboarding)/restaurants/ard.tsx index 94ff368d..e6741cb5 100644 --- a/app/(onboarding)/restaurants/ard.tsx +++ b/app/(onboarding)/restaurants/ard.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { router, useLocalSearchParams, useNavigation } from "expo-router"; import { t } from "i18next"; import LottieView from "lottie-react-native"; diff --git a/app/(onboarding)/restaurants/izly.tsx b/app/(onboarding)/restaurants/izly.tsx index b4103bd7..55188fed 100644 --- a/app/(onboarding)/restaurants/izly.tsx +++ b/app/(onboarding)/restaurants/izly.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { router, useLocalSearchParams, useNavigation } from "expo-router"; import { login, tokenize } from "ezly"; import LottieView from "lottie-react-native"; diff --git a/app/(onboarding)/restaurants/method.tsx b/app/(onboarding)/restaurants/method.tsx index 27330b4b..9953a284 100644 --- a/app/(onboarding)/restaurants/method.tsx +++ b/app/(onboarding)/restaurants/method.tsx @@ -1,6 +1,5 @@ import { Papicons } from "@getpapillon/papicons"; -import { useHeaderHeight } from "@react-navigation/elements"; -import { useRoute, useTheme } from "@react-navigation/native"; +import { useHeaderHeight, useRoute, useTheme } from "expo-router/react-navigation"; import { useRouter } from "expo-router"; import React, { useMemo, useState } from "react"; import { Image, ScrollView, View } from "react-native"; diff --git a/app/(onboarding)/restaurants/turboself.tsx b/app/(onboarding)/restaurants/turboself.tsx index 6a8c3b95..dcf293e6 100644 --- a/app/(onboarding)/restaurants/turboself.tsx +++ b/app/(onboarding)/restaurants/turboself.tsx @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-require-imports */ -import { useTheme } from "@react-navigation/native"; +import { useTheme } from "expo-router/react-navigation"; import { router, useLocalSearchParams, useNavigation } from 'expo-router'; import LottieView from 'lottie-react-native'; import React, { useEffect, useMemo, useState } from 'react'; diff --git a/app/(onboarding)/restaurants/turboselfHost.tsx b/app/(onboarding)/restaurants/turboselfHost.tsx index fe05620d..b337572e 100644 --- a/app/(onboarding)/restaurants/turboselfHost.tsx +++ b/app/(onboarding)/restaurants/turboselfHost.tsx @@ -22,7 +22,7 @@ import Button from '@/ui/components/Button'; import uuid from '@/utils/uuid/uuid'; import { useAccountStore } from '@/stores/account'; import { Services } from '@/stores/account/types'; -import { useTheme } from '@react-navigation/native'; +import { useTheme } from "expo-router/react-navigation"; import AnimatedPressable from '@/ui/components/AnimatedPressable'; import OnboardingBackButton from "@/components/onboarding/OnboardingBackButton"; import { useTranslation } from 'react-i18next'; diff --git a/app/(onboarding)/serviceSelection.tsx b/app/(onboarding)/serviceSelection.tsx index f51eb024..738d3538 100644 --- a/app/(onboarding)/serviceSelection.tsx +++ b/app/(onboarding)/serviceSelection.tsx @@ -1,6 +1,5 @@ import { Papicons } from "@getpapillon/papicons"; -import { useHeaderHeight } from "@react-navigation/elements"; -import { useRoute, useTheme } from "@react-navigation/native"; +import { useHeaderHeight, useRoute, useTheme } from "expo-router/react-navigation"; import { useRouter } from "expo-router"; import React, { useMemo, useState } from "react"; import { Image, ScrollView, View } from "react-native"; @@ -17,7 +16,10 @@ import Typography from "@/ui/new/Typography"; import { PapillonZoomIn, PapillonZoomOut } from "@/ui/utils/Transition"; import adjust from "@/utils/adjustColor"; -import { GetSupportedServices } from './utils/constants'; +import { + GetSupportedRestaurants, + GetSupportedServices, +} from "./utils/constants"; export default function ServiceSelection() { const headerHeight = useHeaderHeight(); @@ -32,36 +34,57 @@ export default function ServiceSelection() { const [selectedService, setSelectedService] = useState(null); - const services = GetSupportedServices((path: { pathname: string, options?: UnknownInputParams }) => { - router.push({ - pathname: path.pathname as unknown as RelativePathString, - params: path.options ?? {} as unknown as UnknownInputParams - }); - }); + const services = GetSupportedServices( + (path: { pathname: string; options?: UnknownInputParams }) => { + router.push({ + pathname: path.pathname as unknown as RelativePathString, + params: path.options ?? ({} as unknown as UnknownInputParams), + }); + } + ); + + const restaurantServices = GetSupportedRestaurants( + (path: { pathname: string; options?: UnknownInputParams }) => { + router.push({ + pathname: path.pathname as unknown as RelativePathString, + params: path.options ?? ({} as unknown as UnknownInputParams), + }); + } + ); const filteredServices = useMemo(() => { - return services.filter((service) => service.type.includes(type)); + return services.filter(service => service.type.includes(type)); }, [services, type]); const titleString = useMemo(() => { switch (type) { - case "univ": - return t("ONBOARDING_SERVICE_SELECTION_TITLE_UNIV"); - default: - return t("ONBOARDING_SERVICE_SELECTION_TITLE_SCHOOL"); + case "univ": + return t("ONBOARDING_SERVICE_SELECTION_TITLE_UNIV"); + default: + return t("ONBOARDING_SERVICE_SELECTION_TITLE_SCHOOL"); } }, [type, t]); - - const hasServiceRoute = services.find(service => service.name === selectedService)?.route || services.find(service => service.name === selectedService)?.onPress; + const hasServiceRoute = + services.find(service => service.name === selectedService)?.route || + services.find(service => service.name === selectedService)?.onPress || + restaurantServices.find(service => service.name === selectedService)?.onPress; const loginToService = (serviceName: string) => { - const serviceRoute = services.find(service => service.name === serviceName)?.route; - if(!serviceRoute) { + const service = services.find(service => service.name === serviceName); + + if (!service) { + const restaurantService = restaurantServices.find(service => service.name === serviceName); + + restaurantService?.onPress(); + return; + } + + if (!service?.route) { services.find(service => service.name === serviceName)?.onPress(); return; } - const newRoute = './services/' + serviceRoute; + const newRoute = "./services/" + service?.route; router.push(newRoute); }; @@ -73,21 +96,21 @@ export default function ServiceSelection() { flexGrow: 1, gap: 10, paddingTop: headerHeight + 32, - paddingBottom: insets.bottom + 20 + paddingBottom: insets.bottom + 20, }} > - + - {t("ONBOARDING_UNSUPPORTED_TITLE")} - {t("ONBOARDING_UNSUPPORTED_DESCRIPTION")} + + {t("ONBOARDING_UNSUPPORTED_TITLE")} + + + {t("ONBOARDING_UNSUPPORTED_DESCRIPTION")} +