Compare commits

...

7 Commits

@ -1,13 +1,16 @@
import {SafeAreaView, View, Text} from "react-native";
import React from "react";
import InternalError from "@/components/error/InternalErrorProblem";
export default function AddScreen() {
return (
<SafeAreaView>
<View>
<Text className="m-7 font-extrabold">Welcome to Add Screen </Text>
<Text>We will do it soon</Text>
<InternalError/>
</View>
</SafeAreaView>
);
}
//<Text className="m-7 font-extrabold">Welcome to Add Screen </Text>
// <Text>We will do it soon</Text>

@ -1,12 +1,12 @@
import {SafeAreaView, Text, View} from "react-native";
import React from "react";
import Blocked from "@/components/error/BlockedProblem";
export default function HelpsScreen() {
return (
<SafeAreaView>
<View>
<Text className="m-7 font-extrabold">Welcome to Help Screen </Text>
<Text>We will do it soon</Text>
<Blocked/>
</View>
</SafeAreaView>

@ -0,0 +1,37 @@
import Text from "@/components/ui/Text";
import React, {forwardRef} from "react";
import {Image, View, ViewProps} from "react-native";
import BackButton from "@/components/BackButton";
import {Entypo} from "@expo/vector-icons";
export interface ProblemProps extends ViewProps{
picture: string;
problem: string;
description: string;
information: string;
isVisible?: boolean;
}
export default forwardRef<any, ProblemProps> (({className, ...Props}, ref) => {
return (
<View className={"gap-4 justify-between h-3/4" + " " + className} {...Props} ref={ref}>
<View className="flex-row justify-between items-center p-4">
<BackButton/>
</View>
<View className="flex-row justify-center">
<Image className="aspect-square w-3/5 h-3/5" source={Props.picture}/>
</View>
<Text position="center" weight="bold" size="3xl"> {Props.problem} </Text>
<Text size="lg" position="center" className="text-gray-400"> {Props.description} </Text>
<View className="flex-row justify-center">
<View className="flex-row items-center border-2 rounded-2xl bg-red-300 border-red-600 p-4">
<Entypo name="warning" size={30} color="red"/>
<Text size="lg" position="center"> {Props.information} </Text>
</View>
</View>
</View>
);
});

@ -1,55 +1,19 @@
import {Link, router, Stack, usePathname, useRouter} from 'expo-router';
import {Button, SafeAreaView, StyleSheet, Text, View} from 'react-native';
import React from "react";
import {
Image,
SafeAreaView,
StatusBar,
Text,
TouchableOpacity,
View,
} from "react-native";
export default function NotFoundScreen() {
return (
<SafeAreaView className="flex-1 bg-white">
<StatusBar barStyle="dark-content" />
{/* Back Button Area */}
<View className="p-4 absolute top-11 left-0 z-10">
<Text className="text-2xl text-gray-300"></Text>
</View>
{/* Main Content */}
<View className="flex-1 items-center justify-center px-5">
{/* Magnifying Glass Image */}
<Image
source={{
uri: "https://hebbkx1anhila5yf.public.blob.vercel-storage.com/Capture%20d%E2%80%99e%CC%81cran%202025-01-21%20a%CC%80%2008.21.49-5FFPPKCnwJH2QV30OeJup36tsu0CGA.png",
}}
className="w-[200px] h-[200px] mb-10"
resizeMode="contain"
/>
{/* Error Text */}
<Text className="text-4xl font-bold text-gray-800 mb-4">Not Found</Text>
{/* Error Message */}
<Text className="text-lg text-gray-600 text-center mb-6">
Whoops! Coach S can't find this page :(
</Text>
{/* Status Code */}
<View className="bg-red-100/20 py-2 px-4 rounded-lg flex-row items-center mb-10">
<Text className="text-red-400 text-base">
:warning: Status Code: 404
</Text>
</View>
export default function NotFoundScreen() {
const pathname = usePathname();
const router = useRouter();
{/* Home Button */}
<TouchableOpacity className="bg-[#F4804F] py-4 px-8 rounded-full flex-row items-center absolute bottom-10 left-5 right-5">
<Text className="text-white text-lg font-semibold text-center flex-1">
Take Me Home
</Text>
</TouchableOpacity>
return (
<SafeAreaView>
<Stack.Screen options={{ title: 'Oops!' }} />
<View>
<Text>This screen {pathname} doesn't exist: {pathname}</Text>
<Button title="Retour Home" onPress={() => router.replace("/")}/>
<Text>Go to home screen!</Text>
</View>
</SafeAreaView>
);

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

@ -1,3 +1,10 @@
export const EMPTY_FIELD = "Un des champs est vide !";
export const INVALID_EMAIL = "Adresse mail invalide !";
export const NOT_MATCHING_PASSWORD = "Les mots de passe sont différents";
export const NOT_FOUND = "Ressource introuvable :<";
export const NO_INTERNET = "Pas de connexion à internet";
export const INTERNAL_ERROR = "Erreur interne, veuillez nous pardonner";
export const MAINTENANCE = "Le serveur est en maintenance, veuillez réessayer plus tard";
export const NOT_AUTHORIZED = "Vous n'êtes pas autorisé à accéder à cette ressource";
export const FEATURE_LOCKED = "Cette fonctionnalité est verrouillée";

@ -2,7 +2,8 @@ import { Workout } from "@/model/Workout";
import { AntDesign, MaterialCommunityIcons } from "@expo/vector-icons";
import { useRouter } from "expo-router";
import React from "react";
import { ImageBackground, Text, TouchableOpacity, View } from "react-native";
import Text from "@/components/ui/Text"
import {ImageBackground, TouchableOpacity, View} from "react-native";
interface WorkoutCardComponentProps {
exercise?: Workout;

@ -0,0 +1,15 @@
import React from "react";
import {FEATURE_LOCKED} from "@/components/Errors";
import Error from "@/app/(utility)/Error";
import blockedPict from "@/assets/images/Blocked.png";
export default function Blocked() {
return (
<Error
picture={blockedPict}
problem="Fonctionnalité bloquée"
description={FEATURE_LOCKED}
information="Devenez PREMIUM pour débloquer"
/>
);
}

@ -0,0 +1,15 @@
import React from "react";
import {INTERNAL_ERROR} from "@/components/Errors";
import Error from "@/app/(utility)/Error";
import internalErrorPict from "@/assets/images/InternalError.png";
export default function InternalError() {
return (
<Error
picture={internalErrorPict}
problem="Problème interne"
description={INTERNAL_ERROR}
information="Contactez le support"
/>
);
}

@ -0,0 +1,15 @@
import React from "react";
import {MAINTENANCE} from "@/components/Errors";
import Error from "@/app/(utility)/Error";
import maintenancePict from "@/assets/images/Maintenance.png";
export default function Maintenance() {
return (
<Error
picture={maintenancePict}
problem="Maintenance"
description={MAINTENANCE}
information="Revenez plus tard"
/>
);
}

@ -0,0 +1,15 @@
import React from "react";
import {NO_INTERNET} from "@/components/Errors";
import Error from "@/app/(utility)/Error";
import noInternetPict from "@/assets/images/NoInternet.png";
export default function NoInternet() {
return (
<Error
picture={noInternetPict}
problem="Pas d'internet"
description={NO_INTERNET}
information="Réessayez plus tard"
/>
);
}

@ -0,0 +1,15 @@
import React from "react";
import {NOT_AUTHORIZED} from "@/components/Errors";
import Error from "@/app/(utility)/Error";
import notAllowedPict from "@/assets/images/NotAllowed.png";
export default function NotAllowedProblem() {
return (
<Error
picture={notAllowedPict}
problem="Pas autorisé"
description={NOT_AUTHORIZED}
information="Connectez vous avec plus de privilèges"
/>
);
}

@ -0,0 +1,15 @@
import React from "react";
import {NOT_FOUND} from "@/components/Errors";
import Error from "@/app/(utility)/Error";
import notFoundPict from "@/assets/images/NotFound.png";
export default function NotFound() {
return (
<Error
picture={notFoundPict}
problem="Introuvable"
description={NOT_FOUND}
information="Status Code : 404"
/>
);
}

26
package-lock.json generated

@ -55,6 +55,7 @@
"@babel/core": "^7.25.2",
"@types/jest": "^29.5.12",
"@types/react": "~19.0.10",
"@types/react-native": "^0.72.8",
"@types/react-test-renderer": "^19.0.0",
"@types/validator": "^13.12.2",
"jest": "^29.2.1",
@ -3707,6 +3708,31 @@
"csstype": "^3.0.2"
}
},
"node_modules/@types/react-native": {
"version": "0.72.8",
"resolved": "https://registry.npmjs.org/@types/react-native/-/react-native-0.72.8.tgz",
"integrity": "sha512-St6xA7+EoHN5mEYfdWnfYt0e8u6k2FR0P9s2arYgakQGFgU1f9FlPrIEcj0X24pLCF5c5i3WVuLCUdiCYHmOoA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@react-native/virtualized-lists": "^0.72.4",
"@types/react": "*"
}
},
"node_modules/@types/react-native/node_modules/@react-native/virtualized-lists": {
"version": "0.72.8",
"resolved": "https://registry.npmjs.org/@react-native/virtualized-lists/-/virtualized-lists-0.72.8.tgz",
"integrity": "sha512-J3Q4Bkuo99k7mu+jPS9gSUSgq+lLRSI/+ahXNwV92XgJ/8UgOTxu2LPwhJnBk/sQKxq7E8WkZBnBiozukQMqrw==",
"dev": true,
"license": "MIT",
"dependencies": {
"invariant": "^2.2.4",
"nullthrows": "^1.1.1"
},
"peerDependencies": {
"react-native": "*"
}
},
"node_modules/@types/react-test-renderer": {
"version": "19.1.0",
"resolved": "https://registry.npmjs.org/@types/react-test-renderer/-/react-test-renderer-19.1.0.tgz",

@ -62,6 +62,7 @@
"@babel/core": "^7.25.2",
"@types/jest": "^29.5.12",
"@types/react": "~19.0.10",
"@types/react-native": "^0.72.8",
"@types/react-test-renderer": "^19.0.0",
"@types/validator": "^13.12.2",
"jest": "^29.2.1",

Loading…
Cancel
Save