Summary: When there wasn't enough space for the text toolbar, the text was wrapped into multiple lines. Now it's truncated.

Reviewed By: jknoxville

Differential Revision: D14209813

fbshipit-source-id: 1971cd791daf345639993ed0632d718374a5f91b
This commit is contained in:
Daniel Büchele
2019-02-26 02:33:41 -08:00
committed by Facebook Github Bot
parent 2e8394cb36
commit b8cb95ab0c
2 changed files with 15 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ import {
FlexCenter, FlexCenter,
styled, styled,
colors, colors,
SidebarExtensions,
} from 'flipper'; } from 'flipper';
import {Component} from 'react'; import {Component} from 'react';
@@ -92,7 +93,6 @@ type Props = {|
client: PluginClient, client: PluginClient,
realClient: Client, realClient: Client,
logger: Logger, logger: Logger,
extensions?: Array<Function>,
|}; |};
type State = {| type State = {|
@@ -124,14 +124,14 @@ export default class Sidebar extends Component<Props, State> {
} }
render() { render() {
const {element, extensions} = this.props; const {element} = this.props;
if (!element || !element.data) { if (!element || !element.data) {
return <NoData grow>No data</NoData>; return <NoData grow>No data</NoData>;
} }
const sections: Array<any> = const sections: Array<any> =
(extensions && (SidebarExtensions &&
extensions.map(ext => SidebarExtensions.map(ext =>
ext( ext(
this.props.client, this.props.client,
this.props.realClient, this.props.realClient,

View File

@@ -16,7 +16,7 @@ import {
Link, Link,
Glyph, Glyph,
DetailSidebar, DetailSidebar,
SidebarExtensions, styled,
} from 'flipper'; } from 'flipper';
import Inspector from './Inspector'; import Inspector from './Inspector';
import ToolbarIcon from './ToolbarIcon'; import ToolbarIcon from './ToolbarIcon';
@@ -42,6 +42,14 @@ export type PersistedState = {|
AXelements: ElementMap, AXelements: ElementMap,
|}; |};
const BetaBar = styled(Toolbar)({
display: 'block',
overflow: 'hidden',
lineHeight: '15px',
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
});
export default class Layout extends FlipperPlugin<State, void, PersistedState> { export default class Layout extends FlipperPlugin<State, void, PersistedState> {
static defaultPersistedState = { static defaultPersistedState = {
rootElement: null, rootElement: null,
@@ -205,20 +213,19 @@ export default class Layout extends FlipperPlugin<State, void, PersistedState> {
element={element} element={element}
onValueChanged={this.onDataValueChanged} onValueChanged={this.onDataValueChanged}
logger={this.props.logger} logger={this.props.logger}
extensions={SidebarExtensions}
/> />
</DetailSidebar> </DetailSidebar>
</> </>
)} )}
{/* TODO: Remove this when rolling out publicly */} {/* TODO: Remove this when rolling out publicly */}
<Toolbar position="bottom" compact> <BetaBar position="bottom" compact>
<Glyph name="beta" color="#8157C7" />&nbsp; <Glyph name="beta" color="#8157C7" />&nbsp;
<strong>Version 2.0:</strong>&nbsp; Provide feedback about this plugin <strong>Version 2.0:</strong>&nbsp; Provide feedback about this plugin
in our&nbsp; in our&nbsp;
<Link href="https://fb.workplace.com/groups/246035322947653/"> <Link href="https://fb.workplace.com/groups/246035322947653/">
feedback group feedback group
</Link>. </Link>.
</Toolbar> </BetaBar>
</FlexColumn> </FlexColumn>
); );
} }