diff options
author | Samy Pessé <samypesse@gmail.com> | 2016-09-19 11:33:19 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2016-09-19 11:33:23 +0200 |
commit | 2796065886d824ae7fe7060dafa6fdcbd26d5f93 (patch) | |
tree | 4df39fe6e88d88c187623e505fb4e8a8103fa13b /packages/gitbook-plugin-sharing/src | |
parent | 82c2c214eb5179538c925460f1d3e823dbba47e2 (diff) | |
download | gitbook-2796065886d824ae7fe7060dafa6fdcbd26d5f93.zip gitbook-2796065886d824ae7fe7060dafa6fdcbd26d5f93.tar.gz gitbook-2796065886d824ae7fe7060dafa6fdcbd26d5f93.tar.bz2 |
Add base for gitbook-plugin builder
Diffstat (limited to 'packages/gitbook-plugin-sharing/src')
-rw-r--r-- | packages/gitbook-plugin-sharing/src/Button.js | 17 | ||||
-rw-r--r-- | packages/gitbook-plugin-sharing/src/index.js | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/packages/gitbook-plugin-sharing/src/Button.js b/packages/gitbook-plugin-sharing/src/Button.js new file mode 100644 index 0000000..0cfce7c --- /dev/null +++ b/packages/gitbook-plugin-sharing/src/Button.js @@ -0,0 +1,17 @@ +const React = require('react'); +const GitBook = require('gitbook-core'); + +const ShareButton = React.createClass({ + render() { + return ( + <button>Share</button> + ); + } +}); + +function mapStateToProps(state) { + +} + + +module.exports = GitBook.connect(ShareButton, mapStateToProps); diff --git a/packages/gitbook-plugin-sharing/src/index.js b/packages/gitbook-plugin-sharing/src/index.js new file mode 100644 index 0000000..e33a470 --- /dev/null +++ b/packages/gitbook-plugin-sharing/src/index.js @@ -0,0 +1,6 @@ +const GitBook = require('gitbook-core'); +const ShareButton = require('./Button'); + +module.exports = GitBook.createPlugin((dispatch, state) => { + dispatch(GitBook.registerComponent(ShareButton, { role: 'Toolbar:ActionButton' })); +}); |