diff --git a/src/TransactionList.js b/src/TransactionList.js index a5e16defcec88e5ad78e018e88cee50656ea55e1..9684dcc4db582251b4b0ecd4b4527b3d5f9416b1 100644 --- a/src/TransactionList.js +++ b/src/TransactionList.js @@ -19,6 +19,17 @@ const columns = [ {dataField: 'total', text: 'Cantidad', formatter: cell => printMoney(cell)+" €"}, ] +function rowStyle(row) { + if (["purchase"].includes(row.type)) { + return { + backgroundColor: "#fcbabf" + }; + } + return { + backgroundColor: "#c4fcba" + }; +} + function TransactionList() { const [transactions, setTransactions] = useState([]); const [clickID, setClicID] = useState(null); @@ -36,6 +47,7 @@ function TransactionList() { rowEvents={{ onClick: (_, row) => setClicID(row.ID) }} + rowStyle={rowStyle} classes="stripped" bordered={ false } />