Add ability to dynamically extend the layout inspector sidebar
Summary: This adds the ability to extend the layout inspector's sidebar via SidebarExtensions Reviewed By: sjkirby Differential Revision: D8677332 fbshipit-source-id: 1880d5d2185306290a278e8a48e965ad94b98cc0
This commit is contained in:
committed by
Facebook Github Bot
parent
f0bf61881e
commit
44f561a683
7
src/fb-stubs/LayoutInspectorSidebarExtensions.js
Normal file
7
src/fb-stubs/LayoutInspectorSidebarExtensions.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/**
|
||||||
|
* Copyright 2018-present Facebook.
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
* @format
|
||||||
|
*/
|
||||||
|
export default [];
|
||||||
@@ -12,6 +12,7 @@ import ManagedDataInspector from '../data-inspector/ManagedDataInspector.js';
|
|||||||
import {Component} from 'react';
|
import {Component} from 'react';
|
||||||
import {Console} from '../console';
|
import {Console} from '../console';
|
||||||
import {GK} from 'sonar';
|
import {GK} from 'sonar';
|
||||||
|
import SidebarExtensions from '../../../fb-stubs/LayoutInspectorSidebarExtensions.js';
|
||||||
|
|
||||||
const deepEqual = require('deep-equal');
|
const deepEqual = require('deep-equal');
|
||||||
|
|
||||||
@@ -109,7 +110,10 @@ export class InspectorSidebar extends Component<Props, State> {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const sections = [];
|
const sections = SidebarExtensions.map(ext =>
|
||||||
|
ext(this.props.client, element.id),
|
||||||
|
);
|
||||||
|
|
||||||
for (const key in element.data) {
|
for (const key in element.data) {
|
||||||
sections.push(
|
sections.push(
|
||||||
<InspectorSidebarSection
|
<InspectorSidebarSection
|
||||||
|
|||||||
Reference in New Issue
Block a user