Pass real client to sidebar extension factory functions

Summary: This allows sidebar extensions to have more information as to whether they should be enabled or not

Reviewed By: danielbuechele

Differential Revision: D12930405

fbshipit-source-id: 649d3f01da1c535f7d60b7b525b012a888ea78e0
This commit is contained in:
Hilal Alsibai
2018-11-06 11:27:05 -08:00
committed by Facebook Github Bot
parent 3c3ef35bce
commit 21a18d3e53
2 changed files with 10 additions and 1 deletions

View File

@@ -7,6 +7,7 @@
import type {Element} from './ElementsInspector.js';
import type {PluginClient} from '../../../plugin';
import type Client from '../../../Client.js';
import type Logger from '../../../fb-stubs/Logger.js';
import Panel from '../Panel.js';
import ManagedDataInspector from '../data-inspector/ManagedDataInspector.js';
@@ -78,6 +79,7 @@ type Props = {|
tooltips?: Object,
onValueChanged: ?OnValueChanged,
client: PluginClient,
realClient: Client,
logger: Logger,
extensions?: Array<any>,
|};
@@ -119,7 +121,12 @@ export class InspectorSidebar extends Component<Props, State> {
const sections =
(extensions &&
extensions.map(ext =>
ext(this.props.client, element.id, this.props.logger),
ext(
this.props.client,
this.props.realClient,
element.id,
this.props.logger,
),
)) ||
[];