60 lines
No EOL
1.4 KiB
TypeScript
60 lines
No EOL
1.4 KiB
TypeScript
import { ImageProps, StyleSheet, Text, View } from 'react-native'
|
|
import React from 'react'
|
|
import FavImgBackground from "../components/FavImgBackground";
|
|
|
|
|
|
interface FavoritesItemCardProps {
|
|
id: string;
|
|
image_item: ImageProps;
|
|
name: string;
|
|
donutname: string;
|
|
type: string;
|
|
calories: string
|
|
average_rating: number;
|
|
ratings_count: string;
|
|
description: string;
|
|
favourite: boolean;
|
|
ToggleFavouriteItem: any;
|
|
}
|
|
|
|
const FavCard: React.FC<FavoritesItemCardProps> = ({
|
|
id,
|
|
image_item,
|
|
name,
|
|
donutname,
|
|
type,
|
|
calories,
|
|
average_rating,
|
|
ratings_count,
|
|
description,
|
|
favourite,
|
|
ToggleFavouriteItem,
|
|
}) => {
|
|
|
|
|
|
return (
|
|
<View style={{overflow: 'hidden'}}>
|
|
<FavImgBackground
|
|
EnableBackHandler={false}
|
|
id={id}
|
|
image_item={image_item}
|
|
name={name}
|
|
donutname={donutname}
|
|
type={type}
|
|
calories={calories}
|
|
average_rating={average_rating}
|
|
ratings_count={ratings_count}
|
|
description={description}
|
|
favourite={favourite}
|
|
ToggleFavourite={ToggleFavouriteItem}
|
|
/>
|
|
<View style={{paddingHorizontal: 20, borderBottomWidth:1, borderColor: '#EEEEEE'}}>
|
|
<Text style={{fontSize: 16, color: 'gray', marginVertical: 30}}>{description}</Text>
|
|
</View>
|
|
</View>
|
|
)
|
|
}
|
|
|
|
export default FavCard
|
|
|
|
const styles = StyleSheet.create({}) |