summaryrefslogtreecommitdiffstats
path: root/packages/gitbook-plugin-theme-default/src/components/Toolbar.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-10-06 23:04:20 +0200
committerSamy Pesse <samypesse@gmail.com>2016-10-06 23:04:20 +0200
commit1d291ff2f057b3d4360d38b27c36e75eddeebb09 (patch)
tree3b6418bfe897a889e1fa7eb4d0e1a361b5caf14e /packages/gitbook-plugin-theme-default/src/components/Toolbar.js
parent58ae96b7f6a5cd3b7c1fd1d650fcaae4686f578d (diff)
downloadgitbook-1d291ff2f057b3d4360d38b27c36e75eddeebb09.zip
gitbook-1d291ff2f057b3d4360d38b27c36e75eddeebb09.tar.gz
gitbook-1d291ff2f057b3d4360d38b27c36e75eddeebb09.tar.bz2
Fix style of toolbar and add title to it
Diffstat (limited to 'packages/gitbook-plugin-theme-default/src/components/Toolbar.js')
-rw-r--r--packages/gitbook-plugin-theme-default/src/components/Toolbar.js33
1 files changed, 21 insertions, 12 deletions
diff --git a/packages/gitbook-plugin-theme-default/src/components/Toolbar.js b/packages/gitbook-plugin-theme-default/src/components/Toolbar.js
index ca6b7f3..cb90549 100644
--- a/packages/gitbook-plugin-theme-default/src/components/Toolbar.js
+++ b/packages/gitbook-plugin-theme-default/src/components/Toolbar.js
@@ -5,7 +5,9 @@ const sidebar = require('../actions/sidebar');
const Toolbar = React.createClass({
propTypes: {
- dispatch: React.PropTypes.func
+ title: React.PropTypes.string.isRequired,
+ dispatch: React.PropTypes.func,
+ readme: GitBook.Shapes.Readme
},
onToggle() {
@@ -14,18 +16,25 @@ const Toolbar = React.createClass({
},
render() {
+ const { title, readme } = this.props;
+
return (
- <div className="Toolbar book-toolbar">
- <GitBook.Button onClick={this.onToggle}>
- <GitBook.Icon id="align-justify" />
- </GitBook.Button>
- <div className="Toolbar-left">
- <GitBook.InjectedComponentSet matching={{ role: 'toolbar:buttons:left' }} />
- </div>
- <div className="Toolbar-right">
- <GitBook.InjectedComponentSet matching={{ role: 'toolbar:buttons:right' }} />
- </div>
- </div>
+ <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.FlexBox>
+ <GitBook.FlexBox auto>
+ <h1 className="Toolbar-Title">
+ <GitBook.Link to={readme.file}>{title}</GitBook.Link>
+ </h1>
+ </GitBook.FlexBox>
+ <GitBook.FlexBox className="Toolbar-right">
+ <GitBook.InjectedComponentSet align="flex-end" matching={{ role: 'toolbar:buttons:right' }} />
+ </GitBook.FlexBox>
+ </GitBook.FlexLayout>
);
}
});