import React, { Fragment } from 'react'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import DeleteIcon from '@material-ui/icons/Delete'; import ShoppingCartIcon from '@material-ui/icons/ShoppingCart'; import Type from 'ba-styles/Typography.scss'; import { Menu, Typography, Button, ListSubheader, List, ListItem, ListItemText, ListItemSecondaryAction, IconButton, Divider, } from '@material-ui/core'; import styles from './cart-jss'; class Cart extends React.Component { render() { const { classes, anchorEl, close, dataCart, removeItem, totalPrice, checkout } = this.props; const getCartItem = dataArray => dataArray.map((item, index) => (
thumb
removeItem(item)}>
  • )); return ( {' '} Total: {' '} {dataCart.size} {' '} Unique items in Cart )} className={classes.cartWrap} > { dataCart.size < 1 ? (
    Empty Cart Your shopping items will be listed here
    ) : ( {getCartItem(dataCart)} Total : {' '} $ {totalPrice}
  • ) }
    ); } } Cart.propTypes = { classes: PropTypes.object.isRequired, dataCart: PropTypes.object.isRequired, anchorEl: PropTypes.object, close: PropTypes.func.isRequired, removeItem: PropTypes.func.isRequired, checkout: PropTypes.func.isRequired, totalPrice: PropTypes.number.isRequired, }; Cart.defaultProps = { anchorEl: null, }; export default withStyles(styles)(Cart);