You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.2 KiB
68 lines
2.2 KiB
import { ExerciceDTO } from "@/api/service/dto/dto.training";
|
|
import Text from "@/components/ui/Text";
|
|
import { AntDesign, MaterialCommunityIcons } from "@expo/vector-icons";
|
|
import { useRouter } from "expo-router";
|
|
import React from "react";
|
|
import { ImageBackground, TouchableOpacity, View } from "react-native";
|
|
|
|
interface WorkoutCardComponentProps {
|
|
exercise?: ExerciceDTO;
|
|
background?: string;
|
|
height?: number;
|
|
}
|
|
|
|
export default function WorkoutCardComponent({
|
|
exercise,
|
|
}: Readonly<WorkoutCardComponentProps>) {
|
|
const router = useRouter();
|
|
|
|
return (
|
|
<View className="h-full rounded-2xl overflow-hidden bg-black">
|
|
<ImageBackground
|
|
source={require("assets/images/Sigma-2.png")}
|
|
className="h-full w-full"
|
|
>
|
|
<View className="flex-row justify-between p-4">
|
|
<View className="flex-row space-x-4 h-44 items-top justify-center ">
|
|
<View className="flex-row items-top">
|
|
<Text className="text-white text-sm ml-1">
|
|
{exercise?.Duration} min
|
|
</Text>
|
|
</View>
|
|
<View className="flex-row justify-center">
|
|
<MaterialCommunityIcons
|
|
name="square-rounded"
|
|
size={8}
|
|
color="white"
|
|
/>
|
|
</View>
|
|
<View className="flex-row">
|
|
<Text className="text-white text-sm ml-1">
|
|
{exercise?.Name} kcal
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
</View>
|
|
|
|
<View className="absolute bottom-0 left-0 right-0 p-4 bg-opacity-50">
|
|
<Text className="text-white text-lg font-bold">{exercise?.Name}</Text>
|
|
<Text className="text-gray-300 text-sm">{exercise?.NbRep}</Text>
|
|
<View className="flex-row items-center mt-2">
|
|
<Text className="text-white text-xs bg-gray-800 py-1 px-3 rounded-full">
|
|
{exercise?.Name}
|
|
</Text>
|
|
</View>
|
|
</View>
|
|
<TouchableOpacity
|
|
className="absolute bottom-2 right-4 p-4 rounded-full"
|
|
onPress={() => {
|
|
router.push("/WorkoutScreen");
|
|
}}
|
|
>
|
|
<AntDesign name="play" size={50} color="orange" />
|
|
</TouchableOpacity>
|
|
</ImageBackground>
|
|
</View>
|
|
);
|
|
}
|