Change layout for power search enabled data table

Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7

Reviewed By: antonk52

Differential Revision: D49411939

fbshipit-source-id: 0ca8b69ac7eaad1ece88caa5a220203fe54ad946
This commit is contained in:
Andrey Goncharov
2023-09-19 08:19:25 -07:00
committed by Facebook GitHub Bot
parent f6ffbfe3e2
commit 1163769b83
2 changed files with 16 additions and 3 deletions

View File

@@ -640,7 +640,6 @@ export function DataTable<T extends object>(
tableManager.setSearchExpression(newSearchExpression);
}}
/>
{props.extraActions}
{contexMenu && (
<Dropdown overlay={contexMenu} placement="bottomRight">
<Button type="text" size="small" style={{height: '100%'}}>
@@ -652,6 +651,11 @@ export function DataTable<T extends object>(
)}
</Layout.Container>
);
const footer = props.extraActions ? (
<Layout.Container>
<Searchbar gap>{props.extraActions}</Searchbar>
</Layout.Container>
) : null;
const columnHeaders = (
<Layout.Container>
{props.enableColumnHeaders && (
@@ -730,7 +734,7 @@ export function DataTable<T extends object>(
</Layout.Container>
);
}
const mainPanel = (
let mainPanel = (
<Layout.Container grow={props.scrollable} style={{position: 'relative'}}>
{mainSection}
{props.enableAutoScroll && (
@@ -748,6 +752,14 @@ export function DataTable<T extends object>(
{range && !isUnitTest && <RangeFinder>{range}</RangeFinder>}
</Layout.Container>
);
if (footer) {
mainPanel = (
<Layout.Bottom>
{mainPanel}
{footer}
</Layout.Bottom>
);
}
return props.enableMultiPanels && tableState.sideBySide ? (
//TODO: Make the panels resizable by having a dynamic maxWidth for Layout.Right/Left possibly?
<Layout.Horizontal style={{height: '100%'}}>