import { faStar } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome"; import { useNavigation } from "@react-navigation/native"; import React from "react"; import { Image, Platform, StyleSheet, Text, TouchableOpacity, View, } from "react-native"; const ProductCard = ({ product }) => { const navigation = useNavigation(); return ( navigation.navigate("Product", { product })} > {product.name} ₱{product.price} {product.promo ? ( {" "} {product.price - product.price * 0.3}{" "} (-{product.promo}%) ) : null} min. order: {product.min} {product.per} {product.sold} sold {product.rate ? ( {product.rate} ({product.raterTotal}) ) : null} ); }; const styles = StyleSheet.create({ container: { // flex: 1, // backgroundColor: "#ff3333", width: "95%", margin: 5, borderRadius: 6, borderColor: "#dddd", overflow: "hidden", }, wrapper: { width: "100%", // height: 200, alignItems: "center", justifyContent: "center", // backgroundColor: "#ffaa00", }, header: { fontSize: 14, fontWeight: "700", textTransform: "uppercase", }, text: { fontSize: 13, fontWeight: "600", textTransform: "capitalize", color: "#333", letterSpacing: 0.5, }, priceCon: { flexDirection: "row", paddingVertical: 4, }, textPrice: { fontSize: 16, fontWeight: "600", textTransform: "capitalize", color: "#ffaa00", }, textPricePromo: { fontSize: 16, fontWeight: "600", textTransform: "capitalize", textDecorationLine: "line-through", color: "#ffaa00", }, textMin: { fontSize: 11, fontWeight: "600", // textTransform: "capitalize", color: "#bdbdbd", }, textSold: { fontSize: 11, fontWeight: "600", // textTransform: "capitalize", color: "#bdbdbd", }, rateCon: { flexDirection: "row", // justifyContent:'center', alignItems: "center", paddingVertical: 3, }, textRate: { fontSize: 12, color: "#838383", }, img: { width: 400, height: 200, resizeMode: "cover", margin: "auto", borderRadius: 10, // backgroundColor: "#ffaa00", }, footer: { flexDirection: "row", justifyContent: "space-between", }, }); export default ProductCard;