feat(BS|PL): sticky columns in RTL mode.

This commit is contained in:
a.bouhuolia
2022-02-09 21:26:33 +02:00
parent 8b4d841023
commit 200a59d6da
4 changed files with 25 additions and 22 deletions

View File

@@ -1,19 +1,23 @@
import React from 'react';
import { dynamicColumns } from './dynamicColumns';
import { useProfitLossSheetContext } from './ProfitLossProvider';
import { useAppIntlContext } from '../../../components/AppIntlProvider';
/**
* Retrieves the profit/loss table columns.
* @returns
* @returns
*/
export const useProfitLossSheetColumns = () => {
const {
profitLossSheet: { table },
} = useProfitLossSheetContext();
const { direction } = useAppIntlContext();
return React.useMemo(
() => dynamicColumns(table.columns || [], table.rows || []),
[table],
() => dynamicColumns(direction, table.columns, table.rows),
[direction, table],
);
};