Dont show layout tab for android
Summary: Feedback from michel, It is always empty for android so dont show it Reviewed By: elboman Differential Revision: D46152985 fbshipit-source-id: 6c4f1d499ddb8916fdae6015cd57e158a0c1f182
This commit is contained in:
committed by
Facebook GitHub Bot
parent
6c43d39c20
commit
13c589724b
@@ -106,6 +106,7 @@ export function Component() {
|
|||||||
</ResizablePanel>
|
</ResizablePanel>
|
||||||
<DetailSidebar width={350}>
|
<DetailSidebar width={350}>
|
||||||
<Inspector
|
<Inspector
|
||||||
|
os={instance.os}
|
||||||
metadata={metadata}
|
metadata={metadata}
|
||||||
nodes={nodes}
|
nodes={nodes}
|
||||||
showExtra={openBottomPanelWithContent}
|
showExtra={openBottomPanelWithContent}
|
||||||
|
|||||||
@@ -10,7 +10,15 @@
|
|||||||
import React, {ReactNode} from 'react';
|
import React, {ReactNode} from 'react';
|
||||||
// eslint-disable-next-line rulesdir/no-restricted-imports-clone
|
// eslint-disable-next-line rulesdir/no-restricted-imports-clone
|
||||||
import {Glyph} from 'flipper';
|
import {Glyph} from 'flipper';
|
||||||
import {Layout, Tab, Tabs, theme, usePlugin, useValue} from 'flipper-plugin';
|
import {
|
||||||
|
DeviceOS,
|
||||||
|
Layout,
|
||||||
|
Tab,
|
||||||
|
Tabs,
|
||||||
|
theme,
|
||||||
|
usePlugin,
|
||||||
|
useValue,
|
||||||
|
} from 'flipper-plugin';
|
||||||
import {Id, Metadata, MetadataId, UINode} from '../../types';
|
import {Id, Metadata, MetadataId, UINode} from '../../types';
|
||||||
import {IdentityInspector} from './inspector/IdentityInspector';
|
import {IdentityInspector} from './inspector/IdentityInspector';
|
||||||
import {AttributesInspector} from './inspector/AttributesInspector';
|
import {AttributesInspector} from './inspector/AttributesInspector';
|
||||||
@@ -20,12 +28,18 @@ import {plugin} from '../../index';
|
|||||||
import {FrameworkEventsInspector} from './inspector/FrameworkEventsInspector';
|
import {FrameworkEventsInspector} from './inspector/FrameworkEventsInspector';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
|
os: DeviceOS;
|
||||||
nodes: Map<Id, UINode>;
|
nodes: Map<Id, UINode>;
|
||||||
metadata: Map<MetadataId, Metadata>;
|
metadata: Map<MetadataId, Metadata>;
|
||||||
showExtra: (element: ReactNode) => void;
|
showExtra: (element: ReactNode) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const Inspector: React.FC<Props> = ({nodes, metadata, showExtra}) => {
|
export const Inspector: React.FC<Props> = ({
|
||||||
|
os,
|
||||||
|
nodes,
|
||||||
|
metadata,
|
||||||
|
showExtra,
|
||||||
|
}) => {
|
||||||
const instance = usePlugin(plugin);
|
const instance = usePlugin(plugin);
|
||||||
const selectedNodeId = useValue(instance.uiState.selectedNode);
|
const selectedNodeId = useValue(instance.uiState.selectedNode);
|
||||||
const frameworkEvents = useValue(instance.frameworkEvents);
|
const frameworkEvents = useValue(instance.frameworkEvents);
|
||||||
@@ -69,6 +83,7 @@ export const Inspector: React.FC<Props> = ({nodes, metadata, showExtra}) => {
|
|||||||
metadata={metadata}
|
metadata={metadata}
|
||||||
/>
|
/>
|
||||||
</Tab>
|
</Tab>
|
||||||
|
{os !== 'Android' && (
|
||||||
<Tab
|
<Tab
|
||||||
key={'layout'}
|
key={'layout'}
|
||||||
tab={
|
tab={
|
||||||
@@ -88,6 +103,7 @@ export const Inspector: React.FC<Props> = ({nodes, metadata, showExtra}) => {
|
|||||||
metadata={metadata}
|
metadata={metadata}
|
||||||
/>
|
/>
|
||||||
</Tab>
|
</Tab>
|
||||||
|
)}
|
||||||
{selectedFrameworkEvents && (
|
{selectedFrameworkEvents && (
|
||||||
<Tab
|
<Tab
|
||||||
key={'events'}
|
key={'events'}
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ export function plugin(client: PluginClient<Events>) {
|
|||||||
const streamInterceptor = getStreamInterceptor();
|
const streamInterceptor = getStreamInterceptor();
|
||||||
|
|
||||||
let lastFrameTime = 0;
|
let lastFrameTime = 0;
|
||||||
const device = client.device.os;
|
const os = client.device.os;
|
||||||
|
|
||||||
client.onMessage('init', (event) => {
|
client.onMessage('init', (event) => {
|
||||||
rootId.set(event.rootId);
|
rootId.set(event.rootId);
|
||||||
@@ -354,7 +354,7 @@ export function plugin(client: PluginClient<Events>) {
|
|||||||
perfEvents,
|
perfEvents,
|
||||||
setPlayPause,
|
setPlayPause,
|
||||||
queryClient,
|
queryClient,
|
||||||
device,
|
os,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user