feat: optimize sidebar and datatable expandable rows.

This commit is contained in:
Ahmed Bouhuolia
2020-04-14 15:04:58 +02:00
parent fb6b31d922
commit f8c268434a
9 changed files with 128 additions and 105 deletions

View File

@@ -136,10 +136,12 @@ export const defaultExpanderReducer = (tableRows, level) => {
return expended;
}
export function formattedAmount(cents, currency) {
const { symbol, decimal_digits: precision } = Currency[currency];
const amount = cents / Math.pow(10, precision);
return accounting.formatMoney(amount, { symbol, precision });
}
}
export const ConditionalWrapper = ({ condition, wrapper, children }) =>
condition ? wrapper(children) : children;