import React from "react"; import { Text, View, Image, Dimensions, TouchableOpacity } from "react-native"; import Icon from "./Icon"; import { CardItemT } from "../types"; import styles, { DISLIKE_ACTIONS, FLASH_ACTIONS, LIKE_ACTIONS, STAR_ACTIONS, WHITE, } from "../assets/styles"; const CardItem = ({ description, hasActions, hasVariant, image, isOnline, matches, name, }: CardItemT) => { // Custom styling const fullWidth = Dimensions.get("window").width; const imageStyle = [ { borderRadius: 8, width: hasVariant ? fullWidth / 2 - 30 : fullWidth - 80, height: hasVariant ? 170 : 350, margin: hasVariant ? 0 : 20, }, ]; const nameStyle = [ { paddingTop: hasVariant ? 10 : 15, paddingBottom: hasVariant ? 5 : 7, color: "#363636", fontSize: hasVariant ? 15 : 30, }, ]; return ( {/* IMAGE */} {/* MATCHES */} {matches && ( {matches}% Match! )} {/* NAME */} {name} {/* DESCRIPTION */} {description && ( {description} )} {/* STATUS */} {!description && ( {isOnline ? "Online" : "Offline"} )} {/* ACTIONS */} {hasActions && ( )} ); }; export default CardItem;