diff options
| author | gabrhr <[email protected]> | 2022-05-27 12:50:13 -0500 |
|---|---|---|
| committer | gabrhr <[email protected]> | 2022-05-27 12:50:13 -0500 |
| commit | 9c396976bb42a9d41407358ce1a1d37242230f21 (patch) | |
| tree | 41b5fdf7d321f70c7e39bb788ef6ce0db6b4a6e3 /front/odiparpack/app/components/Odipar/common.js | |
| parent | 55c0f57d42d82f1f1f5809e9c7d6845b6e0b68af (diff) | |
| download | DP1_project-9c396976bb42a9d41407358ce1a1d37242230f21.tar.gz DP1_project-9c396976bb42a9d41407358ce1a1d37242230f21.tar.bz2 DP1_project-9c396976bb42a9d41407358ce1a1d37242230f21.zip | |
Add redux, dispatch and etiquetas
- estetica de etiquetas (ok)
- add message, pedido Reducer
- add dispatch en Componentes con connect
- add api reducer que obtienen el JSON todo ok
#TODO
- FIX logica de aƱadiir
- FIX axios y dispatch fuera de un componente
Diffstat (limited to 'front/odiparpack/app/components/Odipar/common.js')
| -rw-r--r-- | front/odiparpack/app/components/Odipar/common.js | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/front/odiparpack/app/components/Odipar/common.js b/front/odiparpack/app/components/Odipar/common.js index c66b792..39ba76a 100644 --- a/front/odiparpack/app/components/Odipar/common.js +++ b/front/odiparpack/app/components/Odipar/common.js @@ -1,6 +1,7 @@ import React from "react" import { Chip } from "@material-ui/core"; -import {pedido, camion, bloqueo, almacen} from './EtiquetaData' +import { pedido, camion, bloqueo, almacen } from './EtiquetaData' +import Brightness1Icon from '@material-ui/icons/Brightness1'; const etiquetaStyle = color => ({ fontWeight: 'bold', @@ -11,7 +12,7 @@ const etiquetaStyle = color => ({ //Etiquetas export function etiqueta(tipo , estado) { // eslint-disable-line - let {color, text} = "" + let {color, text, icon} = "" switch(tipo){ case 'etiq_pedido': text = pedido[Object.keys(pedido)[estado]].text @@ -29,10 +30,13 @@ export function etiqueta(tipo , estado) { // eslint-disable-line console.log("entre?") text = almacen[Object.keys(almacen)[estado]].text color = almacen[Object.keys(almacen)[estado]].color + icon = almacen[Object.keys(almacen)[estado]].icon break; } return ( - <Chip label={text} style={etiquetaStyle(color)}/> + tipo == "etiq_alma" ? + <Chip label={text} icon = {<Brightness1Icon style={{ fontSize: icon, color: "#B1ABAB" }}/>} style={{fontWeight: 'bold', backgroundColor: color}}/> : + <Chip label={text} style={etiquetaStyle(color)}/> ) }
\ No newline at end of file |
