Skip to content
This repository was archived by the owner on Jul 11, 2026. It is now read-only.

Para revisión #21

Open
Oralia wants to merge 154 commits into
Laboratoria:masterfrom
JimenaMV:master
Open

Para revisión #21
Oralia wants to merge 154 commits into
Laboratoria:masterfrom
JimenaMV:master

Conversation

@Oralia

@Oralia Oralia commented Aug 19, 2020

Copy link
Copy Markdown

Faltan algunas implementaciones como:
. Área del mesero
-guardar el nombre del mesero en la orden
-guardar el nombre de cliente y numero de mesa en la orden

  • Que el menú Burguer mande las ordenes a Firebase
    . Área de la cocina
    -visualizar correctamente las ordenes y dar estilo
  • agregar notificación para el mesero cuando esta lista una orden
    -Eliminar de la vista una orden completada

Comment thread src/App.js
import ChefName from "./components/utils/ChefName/index.js";
import ShowWaiterName from "./components/utils/ShowWaiterName/index.js";
import ShowChefName from "./components/utils/ShowChefName/index.js";
import { db } from "./firebase";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

La división de los import está magnífica, los comentarios no son necesarios puedes eliminarlos.

Comment thread src/App.js
//firebase data
//import { firebase } from "./firebase";

//JSON

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Estos comentarios tampoco son necesarios, puedes eliminarlos.

Comment thread src/App.js
function App() {
const [order, setOrder] = useState(initialOrderState);
const [waiterName, setWaiterName] = useState();
const [chefName, setChefName] = useState();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Te recomiendo que inicialices tus states con algún valor.

Comment thread src/App.js
let items = [...order.items];
// if existe producto en orden
if (order.items.find((item) => item.productName === product.productName)) {
// entonces incrementar uno a la cantidad

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Los comentarios son buenos para nosotras cuando estamos comenzando y saber cual es le proceso que llevamos, pero en un ambiente laboral es recomendable no subirlos.

Comment thread src/App.js
if (order.items.find((item) => item.productName === product.productName)) {
// entonces incrementar uno a la cantidad
items = order.items.map((i) => {
if (i.productName === product.productName) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Te recomiendo poner un nombre más descriptivo a tus variables, i a qué se refiere?

Comment thread src/App.js

setOrder({ ...order, items });
/* setOrder({ ...order, items, total: calculateTotal(items) });
console.log(items); */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que eliminar el código innecesario.

Comment thread src/App.js

const foundItem = order.items.find(
(item) => item.productName === product.productName
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Podrías simplificar esta función a algo como:
const foundItem = order.item.find(item => item.productName === product.productName)

Comment thread src/App.js
if (foundItem.quantity === 1) {
items = order.items.filter(
(item) => item.productName !== foundItem.productName
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lo mismo acá con la simplificación de las funciones.

Comment thread src/App.js
}

setOrder({ ...order, items });
/* setOrder({ ...order, items, total: calculateTotal(items) }); */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que eliminar código innecesario.

Modal.setAppElement("#root");

const calcTotal = (order) =>
order.items.reduce((sum, item) => sum + item.subtotal, 0);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puede ir toda la función en una misma línea:

const calcTotal = order => order...

placedAt: new Date(),
total,
/* waiterName,
userName, */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que eliminar código innecesario.

/* waiterName,
userName, */
});
console.log("ya se envío data a firebase D:");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evita subir tus console.

}; */

/* Cómo le paso el total? */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que eliminar estos comentarios.

</div>

<InfoClients setUserName={setUserName} setWaiterName />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina espacios innecesarios.

Cancelar
</button>

{/* Este botón tendría que enviar a firebase */}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eliminar comentario y espacios innecesarios

@@ -0,0 +1,121 @@
.container {
/* height: 90vh;
width: 100vw; */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina código innecesario.

flex-wrap: wrap;
background-color: rgba(255, 255, 255, 0.3);
border-radius: 20px;
padding: 20px;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Es preferible que los valores de margin y padding tengan cierta secuencia, por ejemplo en múltiplos de 8.

background-color: #f5c6c6;
}

.Modal {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que tener cuidado con el nombre de nuestras clases, estás utilizando camel case para todo y acá comenzaste con mayúscula.

background-color: #ffc107;
color: white;
} */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que eliminar todo el código que no se necesita.

import Order from '../Order/Order.js';
import ShowWaiterName from '../utils/ShowWaiterName';
import ShowName from '../utils/ShowName';
import { db } from '../../firebase';

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trata de acomodar tus import como lo hiciste en otro archivo:
Primero tus librerias, luego componentes, assets y estilos, separado cada grupo con un espacio.

);
};

export default Burger;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que tener mucho cuidado con el formato de los archivos, así como luce es ilegible

}
.list {
padding-left: 20px;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que borrar todo el código innecesario.

import mburger from "../assets/img/02-menu-burger.svg";
import Navbar from "../Navbar";
/* import Row from "react-bootstrap/Row";
import Container from "react-bootstrap/Container"; */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hay que eliminar lo que no estamos utilizando

<div>
<Boton image={mbreakfast} adress="/menu-breakfast" />
</div>
<br />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eviten utilizar
esto se debe solucionar en CSS.

console.log(arrayData);
setOrders(arrayData);
} catch (error) {
console.log(error);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina los console.

);
};

export default ButtonNext;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tienes dos componentes exactamente iguales, recuerda que uno de los objetivos de react es tratar de optimizar y reutilizar código. Por qué hicimos dos componentes iguales?

water: require('../assets/img/05-agua-del-dia.svg'),
'milk-coconut': require('../assets/img/05-leche-coco.svg'),
'te-chai-burger': require('../assets/img/05-te-chai.svg'),
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Te recomiendo sacar esta informacion a otro archivo como una util y solo importarlo.

};

export default ItemCatalogo;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elimina todo el código innecesario.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants