diff options
author | Samy Pesse <samypesse@gmail.com> | 2016-09-27 16:39:58 +0200 |
---|---|---|
committer | Samy Pesse <samypesse@gmail.com> | 2016-09-27 16:39:58 +0200 |
commit | f1ef1902f360e111587858f73972369b734a0237 (patch) | |
tree | 651e0f47fa7ad989c3f670ef958bf81511b00f4b /packages/gitbook-core/src/components/Icon.js | |
parent | 748c46172bb9f5cd33e0ced3869930626c38105d (diff) | |
download | gitbook-f1ef1902f360e111587858f73972369b734a0237.zip gitbook-f1ef1902f360e111587858f73972369b734a0237.tar.gz gitbook-f1ef1902f360e111587858f73972369b734a0237.tar.bz2 |
Style page with gitbook-markdown-css
Diffstat (limited to 'packages/gitbook-core/src/components/Icon.js')
-rw-r--r-- | packages/gitbook-core/src/components/Icon.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/packages/gitbook-core/src/components/Icon.js b/packages/gitbook-core/src/components/Icon.js new file mode 100644 index 0000000..fac446a --- /dev/null +++ b/packages/gitbook-core/src/components/Icon.js @@ -0,0 +1,28 @@ +const React = require('react'); + +const Icon = React.createClass({ + propTypes: { + id: React.PropTypes.string, + type: React.PropTypes.string, + className: React.PropTypes.string + }, + + getDefaultProps() { + return { + type: 'fa' + }; + }, + + render() { + const { id, type } = this.props; + let { className } = this.props; + + if (id) { + className = type + ' ' + type + '-' + id; + } + + return <i className={className}/>; + } +}); + +module.exports = Icon; |