import { IonButton, IonCard, IonCardSubtitle, IonCardTitle, IonCol, IonRow } from '@ionic/react'; import { useRef } from 'react'; import { Bag } from 'react-iconly'; import { addToCart } from '../store/CartStore'; import '../pages/Home.scss'; const ViewCoffeeCard = (props) => { const { coffee, cartRef } = props; const coffeeCartRef = useRef(); const addCoffeeToCart = (e, coffeeID) => { e.preventDefault(); e.stopPropagation(); coffeeCartRef.current.style.display = ''; coffeeCartRef.current.classList.add('animate__fadeOutUp'); setTimeout(() => { cartRef.current.classList.add('animate__tada'); addToCart(coffeeID); setTimeout(() => { cartRef.current.classList.remove('animate__tada'); coffeeCartRef.current.style.display = 'none'; }, 500); }, 500); }; return ( coffee type {coffee.name} {coffee.summary} Description

{coffee.description}

View → addCoffeeToCart(e, coffee.id)}>
); }; export default ViewCoffeeCard;