Restore messages sidebar in FlipperMessages
Summary: Restored sidebar in Flipper messages plugin, by using a Container, as DetailsSidebar is only valid in a PluginContainer context. Also made tab rendering a bit more condensed while at it. Reviewed By: timur-valiev Differential Revision: D29734639 fbshipit-source-id: d3ec6f354e14194035e93daa014985721844416d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
57d00e0bab
commit
32d61886b8
@@ -15,7 +15,7 @@ import {FlipperMessages} from './FlipperMessages';
|
|||||||
|
|
||||||
export function FlipperDevTools() {
|
export function FlipperDevTools() {
|
||||||
return (
|
return (
|
||||||
<Layout.Container pad grow>
|
<Layout.Container grow>
|
||||||
<Tabs grow>
|
<Tabs grow>
|
||||||
<Tab tab="Console">
|
<Tab tab="Console">
|
||||||
<ConsoleLogs />
|
<ConsoleLogs />
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ import {
|
|||||||
Layout,
|
Layout,
|
||||||
createState,
|
createState,
|
||||||
createDataSource,
|
createDataSource,
|
||||||
DetailSidebar,
|
|
||||||
Panel,
|
|
||||||
theme,
|
theme,
|
||||||
styled,
|
styled,
|
||||||
useValue,
|
useValue,
|
||||||
@@ -124,13 +122,11 @@ export function getFlipperDebugMessages() {
|
|||||||
|
|
||||||
function Sidebar({selection}: {selection: undefined | MessageRow}) {
|
function Sidebar({selection}: {selection: undefined | MessageRow}) {
|
||||||
const renderExtra = (extra: any) => (
|
const renderExtra = (extra: any) => (
|
||||||
<Panel title={'Payload'} collapsible={false}>
|
|
||||||
<DataInspector data={extra} expandRoot={false} />
|
<DataInspector data={extra} expandRoot={false} />
|
||||||
</Panel>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DetailSidebar>
|
<Layout.ScrollContainer pad>
|
||||||
{selection != null ? (
|
{selection != null ? (
|
||||||
renderExtra(selection.payload)
|
renderExtra(selection.payload)
|
||||||
) : (
|
) : (
|
||||||
@@ -138,7 +134,7 @@ function Sidebar({selection}: {selection: undefined | MessageRow}) {
|
|||||||
Select a message to view details
|
Select a message to view details
|
||||||
</Placeholder>
|
</Placeholder>
|
||||||
)}
|
)}
|
||||||
</DetailSidebar>
|
</Layout.ScrollContainer>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -189,7 +185,7 @@ export function FlipperMessages() {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout.Container grow>
|
<Layout.Right resizable width={400}>
|
||||||
<DataTable<MessageRow>
|
<DataTable<MessageRow>
|
||||||
dataSource={flipperDebugMessages}
|
dataSource={flipperDebugMessages}
|
||||||
columns={COLUMN_CONFIG}
|
columns={COLUMN_CONFIG}
|
||||||
@@ -204,6 +200,6 @@ export function FlipperMessages() {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
<Sidebar selection={selection} />
|
<Sidebar selection={selection} />
|
||||||
</Layout.Container>
|
</Layout.Right>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,11 @@ export function Tabs({
|
|||||||
setActiveTab(key);
|
setActiveTab(key);
|
||||||
}}
|
}}
|
||||||
{...baseProps}
|
{...baseProps}
|
||||||
className={cx(className, grow !== false ? growingTabs : undefined)}>
|
className={cx(
|
||||||
|
className,
|
||||||
|
baseTabs,
|
||||||
|
grow !== false ? growingTabs : undefined,
|
||||||
|
)}>
|
||||||
{keyedChildren}
|
{keyedChildren}
|
||||||
</AntdTabs>
|
</AntdTabs>
|
||||||
);
|
);
|
||||||
@@ -75,6 +79,14 @@ export const Tab: React.FC<
|
|||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const baseTabs = css`
|
||||||
|
& .ant-tabs-nav {
|
||||||
|
margin: 0;
|
||||||
|
padding-left: 8px;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|
||||||
const growingTabs = css`
|
const growingTabs = css`
|
||||||
flex: 1;
|
flex: 1;
|
||||||
& .tabpanel {
|
& .tabpanel {
|
||||||
|
|||||||
Reference in New Issue
Block a user