Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/components/cart/Cart.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { useState } from 'react'
import Formulario from '../formulario/Formulario'
import CartContext from '../../context/CartContext'
import * as firebase from 'firebase/app'
import firebase from 'firebase/app'
import NoProductMessage from './NoProductMessage'
import MessageOrden from './MessageOrden'
import 'firebase/firestore'
import 'firebase'
import { getFirestore } from '../../firebase'
import TableCart from './TableCart'
import Carousel from '../carousel/Carousel'
Expand Down
15 changes: 13 additions & 2 deletions src/components/cart/TableCart.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const TableCart = ({ setShowForm }) => {
const { cartItem, deleteProduct, costoTotal } =
React.useContext(CartContext)

const deleteItem = (id) => {
deleteProduct(id)
const deleteItem = (item) => {
deleteProduct(item)
}
const classes = useStyles()
return (
Expand Down Expand Up @@ -53,6 +53,11 @@ const TableCart = ({ setShowForm }) => {
>
Price
</TableCell>
<TableCell
align="right"
style={{ minWidth: 30 }}
>
</TableCell>
</TableRow>
</TableHead>
<TableBody>
Expand All @@ -73,6 +78,12 @@ const TableCart = ({ setShowForm }) => {
<TableCell align="right">
{convertToMoney(item.price)}
</TableCell>
<TableCell
align="right">
<Button onClick={() => deleteItem(item)}>
Delete
</Button>
</TableCell>
</TableRow>
)
})}
Expand Down
8 changes: 3 additions & 5 deletions src/components/itemCount/ItemCount.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import Icon from '@material-ui/core/Icon'
import RemoveCircleIcon from '@material-ui/icons/RemoveCircle'
import AddCircleIcon from '@material-ui/icons/AddCircle'
import Box from '@material-ui/core/Box'

const ItemCount = ({ min, stock, count, setCount }) => {
Expand All @@ -27,13 +27,11 @@ const ItemCount = ({ min, stock, count, setCount }) => {
onClick={subtract}
></RemoveCircleIcon>
<span style={{ paddingTop: '7px' }}>{count}</span>
<Icon
<AddCircleIcon
style={{ fontSize: 30 }}
disabled={count === stock}
onClick={add}
>
add_circle
</Icon>
></AddCircleIcon>
</>
)}
</Box>
Expand Down
4 changes: 2 additions & 2 deletions src/firebase/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as firebase from 'firebase/app'
import 'firebase/firestore'
import firebase from 'firebase/app'
import 'firebase'

const app = firebase.initializeApp({
apiKey: process.env.REACT_APP_API_KEY_FIREBASE,
Expand Down