toolbar
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:
committed by
Facebook Github Bot
parent
2e8394cb36
commit
b8cb95ab0c
@@ -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,
|
||||||
|
|||||||
@@ -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" />
|
<Glyph name="beta" color="#8157C7" />
|
||||||
<strong>Version 2.0:</strong> Provide feedback about this plugin
|
<strong>Version 2.0:</strong> Provide feedback about this plugin
|
||||||
in our
|
in our
|
||||||
<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>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user