react-sidebar
Advanced tools
Comparing version 2.1.2 to 2.1.3
{ | ||
"name": "react-sidebar", | ||
"version": "2.1.2", | ||
"version": "2.1.3", | ||
"author": "Paulus Schoutsen <Paulus@PaulusSchoutsen.nl>", | ||
@@ -5,0 +5,0 @@ "description": "A sidebar component for React.", |
@@ -22,2 +22,8 @@ React Sidebar 2.0 [![npm version](https://badge.fury.io/js/react-sidebar.svg)](http://badge.fury.io/js/react-sidebar) [![Build Status](https://travis-ci.org/balloob/react-sidebar.svg)](https://travis-ci.org/balloob/react-sidebar) | ||
## 2.1.3 | ||
- Added optional classNames. | ||
## 2.1.2 | ||
- Fix server side rendering | ||
## 2.1 | ||
@@ -46,3 +52,6 @@ - Allow overriding embedded styles. | ||
| children | Anything React can render | n/a | The main content | | ||
| rootClassName | string | n/a | Add a custom class to the root component | | ||
| sidebarClassName | string | n/a | Add a custom class to the sidebar | | ||
| contentClassName | string | n/a | Add a custom class to the content | | ||
| overlayClassName | string | n/a | Add a custom class to the overlay | | ||
| sidebar | Anything React can render | n/a | The sidebar content | | ||
@@ -49,0 +58,0 @@ | onSetOpen | function | n/a | Callback called when the sidebar wants to change the open prop. Happens after sliding the sidebar and when the overlay is clicked when the sidebar is open. | |
@@ -221,2 +221,3 @@ import React from 'react'; | ||
const rootProps = { | ||
className: this.props.rootClassName, | ||
style: {...defaultStyles.root, ...this.props.styles.root}, | ||
@@ -318,5 +319,6 @@ }; | ||
</div> | ||
<div style={overlayStyle} | ||
<div className={this.props.overlayClassName} | ||
style={overlayStyle} | ||
onClick={this.overlayClicked} onTouchTap={this.overlayClicked} /> | ||
<div style={contentStyle}> | ||
<div className={this.props.contentClassName} style={contentStyle}> | ||
{dragHandle} | ||
@@ -343,5 +345,14 @@ {this.props.children} | ||
// root component optional class | ||
rootClassName: React.PropTypes.string, | ||
// sidebar optional class | ||
sidebarClassName: React.PropTypes.string, | ||
// content optional class | ||
contentClassName: React.PropTypes.string, | ||
// overlay optional class | ||
overlayClassName: React.PropTypes.string, | ||
// sidebar content to render | ||
@@ -348,0 +359,0 @@ sidebar: React.PropTypes.node.isRequired, |
46633
1014
217