Skip to content

Instantly share code, notes, and snippets.

@StephenDRoberts
Last active August 22, 2020 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save StephenDRoberts/26584f6655c99fe7fe9d9e0a87abe39a to your computer and use it in GitHub Desktop.
Save StephenDRoberts/26584f6655c99fe7fe9d9e0a87abe39a to your computer and use it in GitHub Desktop.
Render table body rows
renderMonthlyList = (monthlyEntryList) => {
let options = [];
if (monthlyEntryList && monthlyEntryList.length !== 0) {
monthlyEntryList.forEach((entry, index) => {
options.push(<tr key={`listRow${index}`}>
<td className="col-3" >{entry.date}</td>
<td className="col-3" >{entry.type}</td>
<td className="col-3" >{entry.retailer}</td>
<td className="col-3" >{formatCurrency(entry.currency, entry.value)}</td>
</tr>
)
})
}
return options
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment