From dd3cb400106662c440344819fc7c3bb57752289a Mon Sep 17 00:00:00 2001 From: Hilal Alsibai Date: Mon, 20 Aug 2018 02:15:44 -0700 Subject: [PATCH] Fix shared preference plugin display Summary: There seems to be an issue showing a ManagedTable within a Panel. The component was properly receiving new changes etc, it just wasn't displaying due to a 0 height (I guess). This diff fixes that + updates the layout so its not cramped. Reviewed By: passy Differential Revision: D9393882 fbshipit-source-id: a35f2a298106c4b2a48883822ef997e8499f1eec --- src/plugins/shared_preferences/index.js | 37 +++++++++++++++++++------ 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/src/plugins/shared_preferences/index.js b/src/plugins/shared_preferences/index.js index e1d347ed9..f3d733fb3 100644 --- a/src/plugins/shared_preferences/index.js +++ b/src/plugins/shared_preferences/index.js @@ -5,7 +5,15 @@ * @format */ -import {ManagedTable, Text, Panel, colors, FlexRow, DataInspector} from 'sonar'; +import { + ManagedTable, + Text, + Heading, + FlexColumn, + colors, + FlexRow, + DataInspector, +} from 'sonar'; import {SonarPlugin} from 'sonar'; const {clone} = require('lodash'); @@ -39,14 +47,24 @@ const CHANGELOG_COLUMNS = { }; const CHANGELOG_COLUMN_SIZES = { - event: '20%', - name: '40%', - value: '40%', + event: '30%', + name: '30%', + value: '30%', }; const UPDATED_LABEL = Updated; const DELETED_LABEL = Deleted; +const InspectorColumn = FlexColumn.extends({ + flexGrow: 0.2, + padding: '16px', +}); + +const ChangelogColumn = FlexColumn.extends({ + flexGrow: 0.8, + padding: '16px', +}); + export default class extends SonarPlugin { static title = 'Shared Preferences Viewer'; static id = 'Preferences'; @@ -124,16 +142,19 @@ export default class extends SonarPlugin { return ( - + + Inspector - - + + + Changelog { return { columns: { @@ -152,7 +173,7 @@ export default class extends SonarPlugin { }; })} /> - + ); }