diff --git a/packages/library/src/modules/Table/components/TableContainer/TableContainer.tsx b/packages/library/src/modules/Table/components/TableContainer/TableContainer.tsx index 21db80c..a0c00ce 100644 --- a/packages/library/src/modules/Table/components/TableContainer/TableContainer.tsx +++ b/packages/library/src/modules/Table/components/TableContainer/TableContainer.tsx @@ -4,7 +4,7 @@ import { PropsWithChildren, useMemo } from 'react' import { useGitContext } from 'context/GitContext' import { placeholderCommits } from 'modules/Graph/strategies/Grid/hooks/usePlaceholderData/data' import { ROW_HEIGHT } from 'constants/constants' -import { HEADER_ROW_HEIGHT, TABLE_MARGIN_TOP } from 'modules/Table/constants' +import { HEADER_ROW_HEIGHT } from 'modules/Table/constants' import { TableContainerProps } from 'modules/Table/components/TableContainer/types' export const TableContainer = ({ @@ -12,7 +12,7 @@ export const TableContainer = ({ rowQuantity, children, className, - styleOverrides + styleOverrides, }: PropsWithChildren) => { const { rowSpacing, showHeaders } = useGitContext() @@ -20,9 +20,8 @@ export const TableContainer = ({ // If no commits are visible as we're showing // the placeholder data for the skeleton view, // then use that size, else just use the log data length. - const commitsVisible = rowQuantity > 0 - ? rowQuantity - : placeholderCommits.length + const commitsVisible = + rowQuantity > 0 ? rowQuantity : placeholderCommits.length // If the table headers are turned off, then we simply // repeat the same row height for all rows. @@ -35,7 +34,7 @@ export const TableContainer = ({ // spacing is increased, we must subtract half of it // from the height of the first header row to counteract // the gap between the header and the first data row. - const headerRowHeight = HEADER_ROW_HEIGHT - (rowSpacing / 2) + const headerRowHeight = HEADER_ROW_HEIGHT - rowSpacing / 2 // All other rows (with data) get a fixed height. const remainingRowsHeight = `repeat(${commitsVisible}, ${ROW_HEIGHT}px)` @@ -43,42 +42,32 @@ export const TableContainer = ({ return `${headerRowHeight}px ${remainingRowsHeight}` }, [rowQuantity, rowSpacing, showHeaders]) - const marginTop = useMemo(() => { - if (showHeaders) { - return TABLE_MARGIN_TOP - } - - return (rowSpacing / 2) + TABLE_MARGIN_TOP - }, [rowSpacing, showHeaders]) - if (row) { return (
{children}
) } - + return (
{children}
) -} \ No newline at end of file +} diff --git a/packages/library/src/modules/Table/constants.ts b/packages/library/src/modules/Table/constants.ts index a215f3f..855812e 100644 --- a/packages/library/src/modules/Table/constants.ts +++ b/packages/library/src/modules/Table/constants.ts @@ -5,11 +5,3 @@ * on the graph. Assuming 0 row spacing. */ export const HEADER_ROW_HEIGHT = 47 - -/** - * The number of pixels of margin at the - * top of the table element that offsets - * it enough to line-up correctly with - * the graph - */ -export const TABLE_MARGIN_TOP = 12 \ No newline at end of file