Skip to content

Commit

Permalink
Small refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
stratoula committed May 8, 2024
1 parent e38832d commit 0d8988e
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ export const getRenderCellValueFn = ({
const field = dataView.fields.getByName(columnId);
const ctx = useContext(UnifiedDataTableContext);

const onTreeExpand = useCallback(() => {
// expand row {rowIndex}
toggleRowHeight?.(rowIndex);
}, [rowIndex]);

useEffect(() => {
if (row?.isAnchor) {
setCellProps({
Expand Down Expand Up @@ -128,12 +133,7 @@ export const getRenderCellValueFn = ({
}

if (field?.type === '_source' || useTopLevelObjectColumns) {
const onTreeExpand = useCallback(() => {
// expand row {rowIndex}
toggleRowHeight(rowIndex);
}, [rowIndex]);

const isSingleRow = autoHeightRows.includes(rowIndex) ? false : rowHeightLines === 0;
const isSingleRow = autoHeightRows?.includes(rowIndex) ? false : rowHeightLines === 0;
return (
<SourceDocument
useTopLevelObjectColumns={useTopLevelObjectColumns}
Expand Down

0 comments on commit 0d8988e

Please sign in to comment.