Add custom scrollbar to sidepanel and torrent list

This commit is contained in:
John Furrow
2016-02-07 21:47:53 -08:00
parent 20ad6cf017
commit 1238d5a201
13 changed files with 485 additions and 280 deletions

View File

@@ -0,0 +1,43 @@
import classnames from 'classnames';
import React from 'react';
import {Scrollbars} from 'react-custom-scrollbars';
export default class CustomScrollbar extends React.Component {
getHorizontalThumb(props) {
return (
<div {...props}
className="scrollbars__thumb scrollbars__thumb--horizontal"/>
);
}
getVerticalThumb(props) {
return (
<div {...props}
className="scrollbars__thumb scrollbars__thumb--vertical"/>
);
}
render() {
let classes = classnames('scrollbars', {
[this.props.className]: this.props.className,
'is-inverted': this.props.inverted
});
return (
<Scrollbars
className={classes}
ref="scrollbar"
renderThumbHorizontal={this.getHorizontalThumb}
renderThumbVertical={this.getVerticalThumb}
onScroll={this.props.scrollHandler}>
{this.props.children}
</Scrollbars>
);
}
}
CustomScrollbar.defaultProps = {
className: '',
inverted: false,
scrollHandler: null
};