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:
committed by
Facebook Github Bot
parent
3c3ef35bce
commit
21a18d3e53
@@ -1066,6 +1066,7 @@ export default class Layout extends FlipperPlugin<InspectorState> {
|
||||
tooltips={this.getAccessibilityTooltips()}
|
||||
onValueChanged={this.onDataValueChanged}
|
||||
client={this.client}
|
||||
realClient={this.realClient}
|
||||
logger={this.props.logger}
|
||||
/>
|
||||
)
|
||||
@@ -1078,6 +1079,7 @@ export default class Layout extends FlipperPlugin<InspectorState> {
|
||||
element={this.state.elements[this.state.selected]}
|
||||
onValueChanged={this.onDataValueChanged}
|
||||
client={this.client}
|
||||
realClient={this.realClient}
|
||||
logger={this.props.logger}
|
||||
extensions={SidebarExtensions}
|
||||
/>
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
)) ||
|
||||
[];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user