mirror of
https://github.com/GitbookIO/gitbook.git
synced 2026-09-21 10:03:31 +00:00
Fix display of button in left toolbar
This commit is contained in:
@@ -43,21 +43,22 @@ const Injection = React.createClass({
|
||||
|
||||
const InjectedComponentSet = React.createClass({
|
||||
propTypes: {
|
||||
components: React.PropTypes.oneOfType([
|
||||
components: React.PropTypes.oneOfType([
|
||||
React.PropTypes.arrayOf(React.PropTypes.func),
|
||||
React.PropTypes.instanceOf(List)
|
||||
]).isRequired,
|
||||
props: React.PropTypes.object,
|
||||
withContainer: React.PropTypes.bool
|
||||
props: React.PropTypes.object,
|
||||
children: React.PropTypes.node
|
||||
},
|
||||
|
||||
render() {
|
||||
const { components, props, ...divProps } = this.props;
|
||||
const { components, props, children, ...divProps } = this.props;
|
||||
|
||||
const inner = components.map((Comp, i) => <Injection key={i} component={Comp} props={props} />);
|
||||
|
||||
return (
|
||||
<div {...divProps}>
|
||||
{children}
|
||||
{inner}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -28,4 +28,4 @@
|
||||
"bugs": {
|
||||
"url": "https://github.com/GitbookIO/gitbook/issues"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -21,10 +21,11 @@ const Toolbar = React.createClass({
|
||||
return (
|
||||
<GitBook.FlexLayout className="Toolbar">
|
||||
<GitBook.FlexBox className="Toolbar-left">
|
||||
<GitBook.Button onClick={this.onToggle}>
|
||||
<GitBook.Icon id="align-justify" />
|
||||
</GitBook.Button>
|
||||
<GitBook.InjectedComponentSet align="flex-start" matching={{ role: 'toolbar:buttons:left' }} />
|
||||
<GitBook.InjectedComponentSet align="flex-end" matching={{ role: 'toolbar:buttons:left' }}>
|
||||
<GitBook.Button onClick={this.onToggle}>
|
||||
<GitBook.Icon id="align-justify" />
|
||||
</GitBook.Button>
|
||||
</GitBook.InjectedComponentSet>
|
||||
</GitBook.FlexBox>
|
||||
<GitBook.FlexBox auto>
|
||||
<h1 className="Toolbar-Title">
|
||||
|
||||
Reference in New Issue
Block a user