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>
|
||||
<DetailSidebar width={350}>
|
||||
<Inspector
|
||||
os={instance.os}
|
||||
metadata={metadata}
|
||||
nodes={nodes}
|
||||
showExtra={openBottomPanelWithContent}
|
||||
|
||||
@@ -10,7 +10,15 @@
|
||||
import React, {ReactNode} from 'react';
|
||||
// eslint-disable-next-line rulesdir/no-restricted-imports-clone
|
||||
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 {IdentityInspector} from './inspector/IdentityInspector';
|
||||
import {AttributesInspector} from './inspector/AttributesInspector';
|
||||
@@ -20,12 +28,18 @@ import {plugin} from '../../index';
|
||||
import {FrameworkEventsInspector} from './inspector/FrameworkEventsInspector';
|
||||
|
||||
type Props = {
|
||||
os: DeviceOS;
|
||||
nodes: Map<Id, UINode>;
|
||||
metadata: Map<MetadataId, Metadata>;
|
||||
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 selectedNodeId = useValue(instance.uiState.selectedNode);
|
||||
const frameworkEvents = useValue(instance.frameworkEvents);
|
||||
@@ -69,6 +83,7 @@ export const Inspector: React.FC<Props> = ({nodes, metadata, showExtra}) => {
|
||||
metadata={metadata}
|
||||
/>
|
||||
</Tab>
|
||||
{os !== 'Android' && (
|
||||
<Tab
|
||||
key={'layout'}
|
||||
tab={
|
||||
@@ -88,6 +103,7 @@ export const Inspector: React.FC<Props> = ({nodes, metadata, showExtra}) => {
|
||||
metadata={metadata}
|
||||
/>
|
||||
</Tab>
|
||||
)}
|
||||
{selectedFrameworkEvents && (
|
||||
<Tab
|
||||
key={'events'}
|
||||
|
||||
@@ -64,7 +64,7 @@ export function plugin(client: PluginClient<Events>) {
|
||||
const streamInterceptor = getStreamInterceptor();
|
||||
|
||||
let lastFrameTime = 0;
|
||||
const device = client.device.os;
|
||||
const os = client.device.os;
|
||||
|
||||
client.onMessage('init', (event) => {
|
||||
rootId.set(event.rootId);
|
||||
@@ -354,7 +354,7 @@ export function plugin(client: PluginClient<Events>) {
|
||||
perfEvents,
|
||||
setPlayPause,
|
||||
queryClient,
|
||||
device,
|
||||
os,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user