Skip to content
Snippets Groups Projects
Commit 6d02b116 authored by meskio's avatar meskio :tent:
Browse files

Add color to the transaction list depending if is ingres or egress

parent b663177c
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,17 @@ const columns = [ ...@@ -19,6 +19,17 @@ const columns = [
{dataField: 'total', text: 'Cantidad', formatter: cell => printMoney(cell)+""}, {dataField: 'total', text: 'Cantidad', formatter: cell => printMoney(cell)+""},
] ]
function rowStyle(row) {
if (["purchase"].includes(row.type)) {
return {
backgroundColor: "#fcbabf"
};
}
return {
backgroundColor: "#c4fcba"
};
}
function TransactionList() { function TransactionList() {
const [transactions, setTransactions] = useState([]); const [transactions, setTransactions] = useState([]);
const [clickID, setClicID] = useState(null); const [clickID, setClicID] = useState(null);
...@@ -36,6 +47,7 @@ function TransactionList() { ...@@ -36,6 +47,7 @@ function TransactionList() {
rowEvents={{ rowEvents={{
onClick: (_, row) => setClicID(row.ID) onClick: (_, row) => setClicID(row.ID)
}} }}
rowStyle={rowStyle}
classes="stripped" classes="stripped"
bordered={ false } bordered={ false }
/> />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment