Skip to content

Commit

Permalink
de-complicate .DataTable margin-bottom override
Browse files Browse the repository at this point in the history
  • Loading branch information
bobular committed Mar 20, 2024
1 parent 8831695 commit 5c896a0
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions packages/libs/components/src/components/tidytree/TreeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
} from '../../components/tidytree/HorizontalDendrogram';
import Mesa from '@veupathdb/coreui/lib/components/Mesa';
import { MesaStateProps } from '../../../../coreui/lib/components/Mesa/types';
import { css as classNameStyle, cx } from '@emotion/css';
import { css as globalStyle, Global } from '@emotion/react';
import { css, cx } from '@emotion/css';

export interface TreeTableProps<RowType> {
/**
Expand Down Expand Up @@ -54,18 +53,16 @@ export default function TreeTable<RowType>(props: TreeTableProps<RowType>) {
() =>
cx(
// minimum height for table rows
classNameStyle`
css`
height: ${rowHeight}px;
& td {
&:hover {
cursor: pointer;
position: relative;
}
}
`
`
),
[rowHeight]
);
Expand Down Expand Up @@ -94,19 +91,15 @@ export default function TreeTable<RowType>(props: TreeTableProps<RowType>) {
options={{ margin: [0, 10, 0, 10], interactive: false }}
/>
<div
style={{
css={{
flexGrow: 1,
width: 1 /* arbitrary non-zero width seems necessary for flex */,
'.DataTable': {
marginBottom: '0px !important',
width: '80%',
},
}}
>
<Global
styles={globalStyle`
.DataTable {
margin-bottom: 0px !important;
width: 80%;
}
`}
/>
<Mesa state={tableState} />
</div>
</div>
Expand Down

0 comments on commit 5c896a0

Please sign in to comment.