parent
a3e567f291
commit
90b1e450e1
@ -1,13 +1,13 @@
|
||||
import axios from 'axios';
|
||||
import axios from "axios";
|
||||
|
||||
const apiClient = axios.create({
|
||||
baseURL: 'https://codefirst.iut.uca.fr/containers/Optifit-optifit-ef-api/api/v1/',
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
'Accept': 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
// ajoute ici les headers supplémentaires, ex. Auth
|
||||
},
|
||||
baseURL:
|
||||
"https://codefirst.iut.uca.fr/containers/Optifit-optifit-ef-api/api/v1/",
|
||||
timeout: 10000,
|
||||
headers: {
|
||||
Accept: "application/json",
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
});
|
||||
|
||||
export default apiClient;
|
||||
|
@ -1,12 +0,0 @@
|
||||
import apiClient from "@/api/client";
|
||||
import { EXERCICES } from "@/api/endpoints";
|
||||
import { AbstractService } from "../abstract.service";
|
||||
|
||||
export class ExerciceService extends AbstractService {
|
||||
async getExercices() {
|
||||
return this.request(async () => {
|
||||
const response = await apiClient.get(EXERCICES.GETALL);
|
||||
return response.data.data;
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
import { EXERCICES } from "@/api/endpoints";
|
||||
import { Workout } from "@/model/Workout";
|
||||
import { AbstractService } from "../abstract.service";
|
||||
import { IExerciceInterface } from "./exercice.service.interface";
|
||||
|
||||
export class ExerciceAPIService
|
||||
extends AbstractService
|
||||
implements IExerciceInterface
|
||||
{
|
||||
async getExercices(): Promise<Workout[]> {
|
||||
const data = await this.request(EXERCICES.GETALL);
|
||||
return data.data.map((item: any) => Workout.fromJson(item));
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
export interface IExerciceInterface {
|
||||
getExercices(): Promise<any>;
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import { AbstractService } from "../abstract.service";
|
||||
import { IExerciceInterface } from "./exercice.service.interface";
|
||||
|
||||
export class ExerciceStubService
|
||||
extends AbstractService
|
||||
implements IExerciceInterface
|
||||
{
|
||||
async getExercices() {
|
||||
return [];
|
||||
}
|
||||
}
|
@ -1,14 +1,31 @@
|
||||
import apiClient from "@/api/client";
|
||||
import { AUTH } from "@/api/endpoints";
|
||||
import { User } from "@/model/User";
|
||||
import { setItemAsync } from "expo-secure-store";
|
||||
import { AbstractService as AbstractAPIService } from "../abstract.service";
|
||||
import { IUserService } from "./user.service.interface";
|
||||
|
||||
export class UserAPIService extends AbstractAPIService implements IUserService {
|
||||
async login(email: string, password: string): Promise<User> {
|
||||
return this.request(async () => {
|
||||
const response = await apiClient.get(AUTH.LOGIN);
|
||||
return response.data.data;
|
||||
const body = new URLSearchParams({
|
||||
grant_type: "password",
|
||||
client_id: email,
|
||||
client_secret: this.CLIENT_SECRET,
|
||||
email,
|
||||
password,
|
||||
scope: this.SCOPES,
|
||||
});
|
||||
|
||||
const res = await fetch(`${this.IDP_URL}/connect/token`, {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||
body: body.toString(),
|
||||
});
|
||||
|
||||
if (!res.ok) throw new Error(`Auth failed: ${res.status}`);
|
||||
const json = await res.json();
|
||||
|
||||
await setItemAsync(this.ACCESS_TOKEN_PATH, json.access_token);
|
||||
await setItemAsync(this.REFRESH_TOKEN_PATH, json.refresh_token);
|
||||
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
@ -1,16 +1,16 @@
|
||||
import {SafeAreaView, View, Text} from "react-native";
|
||||
import React from "react";
|
||||
import InternalError from "@/components/error/InternalErrorProblem";
|
||||
import React from "react";
|
||||
import { SafeAreaView, View } from "react-native";
|
||||
|
||||
export default function AddScreen() {
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<View>
|
||||
<InternalError/>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
);
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<View>
|
||||
<InternalError />
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
||||
//<Text className="m-7 font-extrabold">Welcome to Add Screen </Text>
|
||||
// <Text>We will do it soon</Text>
|
||||
// <Text>We will do it soon</Text>
|
||||
|
@ -1,19 +1,17 @@
|
||||
import { Stack } from "expo-router";
|
||||
import React from "react";
|
||||
import {Stack} from "expo-router";
|
||||
|
||||
export default function RootoLayout() {
|
||||
return (
|
||||
<Stack screenOptions={{
|
||||
headerShown: false,
|
||||
}}
|
||||
initialRouteName={"ExercicesScreen"}
|
||||
>
|
||||
<Stack.Screen name="ExercicesScreen" />
|
||||
return (
|
||||
<Stack
|
||||
screenOptions={{
|
||||
headerShown: false,
|
||||
}}
|
||||
initialRouteName={"ExercicesScreen"}
|
||||
>
|
||||
<Stack.Screen name="ExercicesScreen" />
|
||||
|
||||
<Stack.Screen name="WorkoutScreen"/>
|
||||
|
||||
</Stack>
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
<Stack.Screen name="WorkoutScreen" />
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
import {SafeAreaView, Text, View} from "react-native";
|
||||
import React from "react";
|
||||
import Blocked from "@/components/error/BlockedProblem";
|
||||
import React from "react";
|
||||
import { SafeAreaView, View } from "react-native";
|
||||
|
||||
export default function HelpsScreen() {
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<View>
|
||||
<Blocked/>
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
|
||||
);
|
||||
}
|
||||
return (
|
||||
<SafeAreaView>
|
||||
<View>
|
||||
<Blocked />
|
||||
</View>
|
||||
</SafeAreaView>
|
||||
);
|
||||
}
|
||||
|
@ -1,15 +1,14 @@
|
||||
import { Stack } from "expo-router";
|
||||
import React from "react";
|
||||
import {Stack} from "expo-router";
|
||||
import HelpsScreen from "@/app/(tabs)/(help)/HelpsScreen";
|
||||
|
||||
export default function RootoLayout() {
|
||||
return (
|
||||
<Stack screenOptions={{
|
||||
headerShown: false,
|
||||
}}>
|
||||
<Stack.Screen name="HelpsScreen" />
|
||||
</Stack>
|
||||
|
||||
);
|
||||
|
||||
}
|
||||
return (
|
||||
<Stack
|
||||
screenOptions={{
|
||||
headerShown: false,
|
||||
}}
|
||||
>
|
||||
<Stack.Screen name="HelpsScreen" />
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
@ -1,10 +1,6 @@
|
||||
import {SafeAreaView, Text, View} from "react-native";
|
||||
import React from "react";
|
||||
import HomeScreen from "@/app/(tabs)/(home)/HomeScreen";
|
||||
import React from "react";
|
||||
|
||||
export default function App() {
|
||||
|
||||
return (
|
||||
<HomeScreen/>
|
||||
);
|
||||
}
|
||||
return <HomeScreen />;
|
||||
}
|
||||
|
@ -1,37 +1,50 @@
|
||||
import Text from "@/components/ui/Text";
|
||||
import React, {forwardRef} from "react";
|
||||
import {Image, View, ViewProps} from "react-native";
|
||||
import BackButton from "@/components/BackButton";
|
||||
import Text from "@/components/ui/Text";
|
||||
import React, { forwardRef } from "react";
|
||||
import { Image, View, ViewProps } from "react-native";
|
||||
|
||||
import {Entypo} from "@expo/vector-icons";
|
||||
import { Entypo } from "@expo/vector-icons";
|
||||
|
||||
export interface ProblemProps extends ViewProps{
|
||||
picture: string;
|
||||
problem: string;
|
||||
description: string;
|
||||
information: string;
|
||||
isVisible?: boolean;
|
||||
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>
|
||||
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>
|
||||
<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>
|
||||
<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,113 +1,114 @@
|
||||
import {Text, TouchableOpacity, View} from "react-native";
|
||||
import {CurveType, LineChart} from "react-native-gifted-charts";
|
||||
import React, {useRef, useState} from "react";
|
||||
import React, { useRef, useState } from "react";
|
||||
import { Text, TouchableOpacity, View } from "react-native";
|
||||
import { CurveType, LineChart } from "react-native-gifted-charts";
|
||||
|
||||
export default function ActivitiesComponent() {
|
||||
const ref = useRef(null)
|
||||
const [dateSelected, setDateSelected] = useState('1d');
|
||||
const [lineData, setLineData] = useState([
|
||||
{value: 4},
|
||||
{value: 14},
|
||||
{value: 8},
|
||||
{value: 38},
|
||||
{value: 36},
|
||||
{value: 28},
|
||||
]);
|
||||
const ref = useRef(null);
|
||||
const [dateSelected, setDateSelected] = useState("1d");
|
||||
const [lineData, setLineData] = useState([
|
||||
{ value: 4 },
|
||||
{ value: 14 },
|
||||
{ value: 8 },
|
||||
{ value: 38 },
|
||||
{ value: 36 },
|
||||
{ value: 28 },
|
||||
]);
|
||||
|
||||
const months = ['1d','1w','1m','1y','All']
|
||||
const changeMonthSelected = (ind: number) => {
|
||||
const selectedMonth = months[ind];
|
||||
setDateSelected(selectedMonth);
|
||||
const months = ["1d", "1w", "1m", "1y", "All"];
|
||||
const changeMonthSelected = (ind: number) => {
|
||||
const selectedMonth = months[ind];
|
||||
setDateSelected(selectedMonth);
|
||||
|
||||
// Update lineData based on the selected month
|
||||
let newData: React.SetStateAction<{ value: number; }[]>;
|
||||
switch (selectedMonth) {
|
||||
case '1d':
|
||||
newData = [
|
||||
{value: 4},
|
||||
{value: 14},
|
||||
{value: 8},
|
||||
{value: 38},
|
||||
{value: 36},
|
||||
{value: 28},
|
||||
];
|
||||
break;
|
||||
case '1w':
|
||||
newData = [
|
||||
{value: 8},
|
||||
{value: 14},
|
||||
{value: 8},
|
||||
{value: 38},
|
||||
{value: 14},
|
||||
{value: 28},
|
||||
{value: 4},
|
||||
];
|
||||
break;
|
||||
case '1m':
|
||||
newData = [
|
||||
{value: 10},
|
||||
{value: 20},
|
||||
{value: 30},
|
||||
{value: 40},
|
||||
{value: 50},
|
||||
{value: 60},
|
||||
];
|
||||
break;
|
||||
case '1y':
|
||||
newData = [
|
||||
{value: 15},
|
||||
{value: 25},
|
||||
{value: 35},
|
||||
{value: 45},
|
||||
{value: 55},
|
||||
{value: 65},
|
||||
];
|
||||
break;
|
||||
case 'All':
|
||||
newData = [
|
||||
{value: 5},
|
||||
{value: 15},
|
||||
{value: 25},
|
||||
{value: 35},
|
||||
{value: 45},
|
||||
{value: 55},
|
||||
];
|
||||
break;
|
||||
default:
|
||||
newData = [];
|
||||
}
|
||||
setLineData(newData);
|
||||
};
|
||||
// Update lineData based on the selected month
|
||||
let newData: React.SetStateAction<{ value: number }[]>;
|
||||
switch (selectedMonth) {
|
||||
case "1d":
|
||||
newData = [
|
||||
{ value: 4 },
|
||||
{ value: 14 },
|
||||
{ value: 8 },
|
||||
{ value: 38 },
|
||||
{ value: 36 },
|
||||
{ value: 28 },
|
||||
];
|
||||
break;
|
||||
case "1w":
|
||||
newData = [
|
||||
{ value: 8 },
|
||||
{ value: 14 },
|
||||
{ value: 8 },
|
||||
{ value: 38 },
|
||||
{ value: 14 },
|
||||
{ value: 28 },
|
||||
{ value: 4 },
|
||||
];
|
||||
break;
|
||||
case "1m":
|
||||
newData = [
|
||||
{ value: 10 },
|
||||
{ value: 20 },
|
||||
{ value: 30 },
|
||||
{ value: 40 },
|
||||
{ value: 50 },
|
||||
{ value: 60 },
|
||||
];
|
||||
break;
|
||||
case "1y":
|
||||
newData = [
|
||||
{ value: 15 },
|
||||
{ value: 25 },
|
||||
{ value: 35 },
|
||||
{ value: 45 },
|
||||
{ value: 55 },
|
||||
{ value: 65 },
|
||||
];
|
||||
break;
|
||||
case "All":
|
||||
newData = [
|
||||
{ value: 5 },
|
||||
{ value: 15 },
|
||||
{ value: 25 },
|
||||
{ value: 35 },
|
||||
{ value: 45 },
|
||||
{ value: 55 },
|
||||
];
|
||||
break;
|
||||
default:
|
||||
newData = [];
|
||||
}
|
||||
setLineData(newData);
|
||||
};
|
||||
|
||||
return (
|
||||
<View className="bg-gray-200 rounded-2xl p-1 h-full">
|
||||
<View className=" m-2 flex-row justify-center rounded-2xl bg-white">
|
||||
{months.map((item, index) => {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
key={index}
|
||||
className={`w-16 h-10 flex items-center justify-center rounded-xl ${
|
||||
dateSelected === item
|
||||
? "bg-orange-500 border-2 border-orange-300"
|
||||
: "bg-transparent "
|
||||
}`}
|
||||
onPress={() => changeMonthSelected(index)}>
|
||||
<Text className="font-extrabold">{months[index]}</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
<LineChart
|
||||
scrollRef={ref}
|
||||
data={lineData}
|
||||
areaChart
|
||||
curved
|
||||
initialSpacing={0}
|
||||
rotateLabel
|
||||
isAnimated={true}
|
||||
startFillColor="orange"
|
||||
curveType={CurveType.QUADRATIC}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<View className="bg-gray-200 rounded-2xl p-1 h-full">
|
||||
<View className=" m-2 flex-row justify-center rounded-2xl bg-white">
|
||||
{months.map((item, index) => {
|
||||
return (
|
||||
<TouchableOpacity
|
||||
key={index}
|
||||
className={`w-16 h-10 flex items-center justify-center rounded-xl ${
|
||||
dateSelected === item
|
||||
? "bg-orange-500 border-2 border-orange-300"
|
||||
: "bg-transparent "
|
||||
}`}
|
||||
onPress={() => changeMonthSelected(index)}
|
||||
>
|
||||
<Text className="font-extrabold">{months[index]}</Text>
|
||||
</TouchableOpacity>
|
||||
);
|
||||
})}
|
||||
</View>
|
||||
<LineChart
|
||||
scrollRef={ref}
|
||||
data={lineData}
|
||||
areaChart
|
||||
curved
|
||||
initialSpacing={0}
|
||||
rotateLabel
|
||||
isAnimated={true}
|
||||
startFillColor="orange"
|
||||
curveType={CurveType.QUADRATIC}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
@ -1,51 +1,51 @@
|
||||
import {FlatList, TouchableOpacity,Text, View} from "react-native";
|
||||
import {useState} from "react";
|
||||
import dayjs from "dayjs";
|
||||
import { useState } from "react";
|
||||
import { FlatList, Text, TouchableOpacity, View } from "react-native";
|
||||
|
||||
export default function CalendarComponent() {
|
||||
const [selectedDay] = useState(dayjs().date());
|
||||
const [selectedDay] = useState(dayjs().date());
|
||||
|
||||
const days = Array.from({ length: 7 }, (_, index) => {
|
||||
const day = dayjs().add(index, "day");
|
||||
return {
|
||||
id: day.date(),
|
||||
label: day.format("ddd"),
|
||||
};
|
||||
});
|
||||
const days = Array.from({ length: 7 }, (_, index) => {
|
||||
const day = dayjs().add(index, "day");
|
||||
return {
|
||||
id: day.date(),
|
||||
label: day.format("ddd"),
|
||||
};
|
||||
});
|
||||
|
||||
return (
|
||||
<View className="bg-transparent">
|
||||
<FlatList
|
||||
horizontal
|
||||
data={days}
|
||||
keyExtractor={(item) => item.id.toString()}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
contentContainerStyle={{ gap: 12 }} // Espacement entre les items
|
||||
renderItem={({ item }) => (
|
||||
<TouchableOpacity
|
||||
className={`w-16 h-20 flex items-center justify-center rounded-xl ${
|
||||
selectedDay === item.id
|
||||
? "bg-orange-500 border-2 border-orange-300"
|
||||
: "bg-black"
|
||||
}`}
|
||||
>
|
||||
<Text
|
||||
className={`text-sm ${
|
||||
selectedDay === item.id ? "text-white" : "text-gray-400"
|
||||
}`}
|
||||
>
|
||||
{item.label}
|
||||
</Text>
|
||||
<Text
|
||||
className={`text-lg font-bold ${
|
||||
selectedDay === item.id ? "text-white" : "text-gray-200"
|
||||
}`}
|
||||
>
|
||||
{item.id}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<View className="bg-transparent">
|
||||
<FlatList
|
||||
horizontal
|
||||
data={days}
|
||||
keyExtractor={(item) => item.id.toString()}
|
||||
showsHorizontalScrollIndicator={false}
|
||||
contentContainerStyle={{ gap: 12 }} // Espacement entre les items
|
||||
renderItem={({ item }) => (
|
||||
<TouchableOpacity
|
||||
className={`w-16 h-20 flex items-center justify-center rounded-xl ${
|
||||
selectedDay === item.id
|
||||
? "bg-orange-500 border-2 border-orange-300"
|
||||
: "bg-black"
|
||||
}`}
|
||||
>
|
||||
<Text
|
||||
className={`text-sm ${
|
||||
selectedDay === item.id ? "text-white" : "text-gray-400"
|
||||
}`}
|
||||
>
|
||||
{item.label}
|
||||
</Text>
|
||||
<Text
|
||||
className={`text-lg font-bold ${
|
||||
selectedDay === item.id ? "text-white" : "text-gray-200"
|
||||
}`}
|
||||
>
|
||||
{item.id}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import React from "react";
|
||||
import {FEATURE_LOCKED} from "@/components/Errors";
|
||||
import Error from "@/app/(utility)/Error";
|
||||
//@ts-ignore
|
||||
import blockedPict from "@/assets/images/Blocked.png";
|
||||
import { FEATURE_LOCKED } from "@/components/Errors";
|
||||
import React from "react";
|
||||
|
||||
export default function Blocked() {
|
||||
return (
|
||||
<Error
|
||||
picture={blockedPict}
|
||||
problem="Fonctionnalité bloquée"
|
||||
description={FEATURE_LOCKED}
|
||||
information="Devenez PREMIUM pour débloquer"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Error
|
||||
picture={blockedPict}
|
||||
problem="Fonctionnalité bloquée"
|
||||
description={FEATURE_LOCKED}
|
||||
information="Devenez PREMIUM pour débloquer"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import React from "react";
|
||||
import {INTERNAL_ERROR} from "@/components/Errors";
|
||||
import Error from "@/app/(utility)/Error";
|
||||
//@ts-ignore
|
||||
import internalErrorPict from "@/assets/images/InternalError.png";
|
||||
import { INTERNAL_ERROR } from "@/components/Errors";
|
||||
import React from "react";
|
||||
|
||||
export default function InternalError() {
|
||||
return (
|
||||
<Error
|
||||
picture={internalErrorPict}
|
||||
problem="Problème interne"
|
||||
description={INTERNAL_ERROR}
|
||||
information="Contactez le support"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Error
|
||||
picture={internalErrorPict}
|
||||
problem="Problème interne"
|
||||
description={INTERNAL_ERROR}
|
||||
information="Contactez le support"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import React from "react";
|
||||
import {MAINTENANCE} from "@/components/Errors";
|
||||
import Error from "@/app/(utility)/Error";
|
||||
//@ts-ignore
|
||||
import maintenancePict from "@/assets/images/Maintenance.png";
|
||||
import { MAINTENANCE } from "@/components/Errors";
|
||||
import React from "react";
|
||||
|
||||
export default function Maintenance() {
|
||||
return (
|
||||
<Error
|
||||
picture={maintenancePict}
|
||||
problem="Maintenance"
|
||||
description={MAINTENANCE}
|
||||
information="Revenez plus tard"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Error
|
||||
picture={maintenancePict}
|
||||
problem="Maintenance"
|
||||
description={MAINTENANCE}
|
||||
information="Revenez plus tard"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import React from "react";
|
||||
import {NO_INTERNET} from "@/components/Errors";
|
||||
import Error from "@/app/(utility)/Error";
|
||||
//@ts-ignore
|
||||
import noInternetPict from "@/assets/images/NoInternet.png";
|
||||
import { NO_INTERNET } from "@/components/Errors";
|
||||
import React from "react";
|
||||
|
||||
export default function NoInternet() {
|
||||
return (
|
||||
<Error
|
||||
picture={noInternetPict}
|
||||
problem="Pas d'internet"
|
||||
description={NO_INTERNET}
|
||||
information="Réessayez plus tard"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Error
|
||||
picture={noInternetPict}
|
||||
problem="Pas d'internet"
|
||||
description={NO_INTERNET}
|
||||
information="Réessayez plus tard"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import React from "react";
|
||||
import {NOT_AUTHORIZED} from "@/components/Errors";
|
||||
import Error from "@/app/(utility)/Error";
|
||||
//@ts-ignore
|
||||
import notAllowedPict from "@/assets/images/NotAllowed.png";
|
||||
import { NOT_AUTHORIZED } from "@/components/Errors";
|
||||
import React from "react";
|
||||
|
||||
export default function NotAllowedProblem() {
|
||||
return (
|
||||
<Error
|
||||
picture={notAllowedPict}
|
||||
problem="Pas autorisé"
|
||||
description={NOT_AUTHORIZED}
|
||||
information="Connectez vous avec plus de privilèges"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Error
|
||||
picture={notAllowedPict}
|
||||
problem="Pas autorisé"
|
||||
description={NOT_AUTHORIZED}
|
||||
information="Connectez vous avec plus de privilèges"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,15 +1,16 @@
|
||||
import React from "react";
|
||||
import {NOT_FOUND} from "@/components/Errors";
|
||||
import Error from "@/app/(utility)/Error";
|
||||
//@ts-ignore
|
||||
import notFoundPict from "@/assets/images/NotFound.png";
|
||||
import { NOT_FOUND } from "@/components/Errors";
|
||||
import React from "react";
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<Error
|
||||
picture={notFoundPict}
|
||||
problem="Introuvable"
|
||||
description={NOT_FOUND}
|
||||
information="Status Code : 404"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<Error
|
||||
picture={notFoundPict}
|
||||
problem="Introuvable"
|
||||
description={NOT_FOUND}
|
||||
information="Status Code : 404"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -1,10 +1,118 @@
|
||||
export interface Workout {
|
||||
id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
duration: number;
|
||||
image: string;
|
||||
video: string;
|
||||
nbSeries: number;
|
||||
nbRepetitions: number;
|
||||
export class Workout {
|
||||
private _id?: string;
|
||||
private _name?: string;
|
||||
private _description?: string;
|
||||
private _duration?: number;
|
||||
private _image?: string;
|
||||
private _video?: string;
|
||||
private _nbSeries?: number;
|
||||
private _nbRepetitions?: number;
|
||||
|
||||
constructor({
|
||||
id,
|
||||
name,
|
||||
description,
|
||||
duration,
|
||||
image,
|
||||
video,
|
||||
nbSeries,
|
||||
nbRepetitions,
|
||||
}: {
|
||||
id?: string;
|
||||
name?: string;
|
||||
description?: string;
|
||||
duration?: number;
|
||||
image?: string;
|
||||
video?: string;
|
||||
nbSeries?: number;
|
||||
nbRepetitions?: number;
|
||||
} = {}) {
|
||||
this._id = id;
|
||||
this._name = name;
|
||||
this._description = description;
|
||||
this._duration = duration;
|
||||
this._image = image;
|
||||
this._video = video;
|
||||
this._nbSeries = nbSeries;
|
||||
this._nbRepetitions = nbRepetitions;
|
||||
}
|
||||
|
||||
// Getters
|
||||
get id(): string | undefined {
|
||||
return this._id;
|
||||
}
|
||||
|
||||
get name(): string | undefined {
|
||||
return this._name;
|
||||
}
|
||||
|
||||
get description(): string | undefined {
|
||||
return this._description;
|
||||
}
|
||||
|
||||
get duration(): number | undefined {
|
||||
return this._duration;
|
||||
}
|
||||
|
||||
get image(): string | undefined {
|
||||
return this._image;
|
||||
}
|
||||
|
||||
get video(): string | undefined {
|
||||
return this._video;
|
||||
}
|
||||
|
||||
get nbSeries(): number | undefined {
|
||||
return this._nbSeries;
|
||||
}
|
||||
|
||||
get nbRepetitions(): number | undefined {
|
||||
return this._nbRepetitions;
|
||||
}
|
||||
|
||||
// Setters
|
||||
set id(value: string | undefined) {
|
||||
this._id = value;
|
||||
}
|
||||
|
||||
set name(value: string | undefined) {
|
||||
this._name = value;
|
||||
}
|
||||
|
||||
set description(value: string | undefined) {
|
||||
this._description = value;
|
||||
}
|
||||
|
||||
set duration(value: number | undefined) {
|
||||
this._duration = value;
|
||||
}
|
||||
|
||||
set image(value: string | undefined) {
|
||||
this._image = value;
|
||||
}
|
||||
|
||||
set video(value: string | undefined) {
|
||||
this._video = value;
|
||||
}
|
||||
|
||||
set nbSeries(value: number | undefined) {
|
||||
this._nbSeries = value;
|
||||
}
|
||||
|
||||
set nbRepetitions(value: number | undefined) {
|
||||
this._nbRepetitions = value;
|
||||
}
|
||||
|
||||
static fromJson(json: any): Workout {
|
||||
return new Workout({
|
||||
id: json.id,
|
||||
name: json.name,
|
||||
description: json.description,
|
||||
duration: json.duration,
|
||||
image: json.image,
|
||||
video: json.video,
|
||||
nbSeries: json.nbSeries,
|
||||
nbRepetitions: json.nbRepetitions,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue