2019-07-16 12:27:35 +00:00
|
|
|
import React from 'react'
|
|
|
|
import { Scrollbars } from 'react-custom-scrollbars';
|
|
|
|
|
|
|
|
|
|
|
|
const Scrollbar = (props) => {
|
2019-07-26 12:35:41 +00:00
|
|
|
//console.log("Scrollbar render");
|
2019-07-16 12:27:35 +00:00
|
|
|
const scrollbarType = {
|
|
|
|
smallWhite: {
|
|
|
|
thumbV: { backgroundColor: 'rgba(256, 256, 256, 0.2)', width: '2px', marginLeft: '2px', borderRadius: 'inherit' },
|
|
|
|
thumbH: { backgroundColor: 'rgba(256, 256, 256, 0.2)', height: '2px', marginTop: '2px', borderRadius: 'inherit' }
|
|
|
|
},
|
|
|
|
smallBlack: {
|
|
|
|
thumbV: { backgroundColor: 'rgba(0, 0, 0, 0.1)', width: '2px', marginLeft: '2px', borderRadius: 'inherit' },
|
|
|
|
thumbH: { backgroundColor: 'rgba(0, 0, 0, 0.1)', height: '2px', marginTop: '2px', borderRadius: 'inherit' }
|
|
|
|
},
|
|
|
|
mediumBlack: {
|
2019-07-29 16:42:44 +00:00
|
|
|
thumbV: { backgroundColor: 'rgba(0, 0, 0, 0.1)', width: '8px', borderRadius: 'inherit' },
|
|
|
|
thumbH: { backgroundColor: 'rgba(0, 0, 0, 0.1)', height: '8px', borderRadius: 'inherit' }
|
|
|
|
},
|
|
|
|
preMediumBlack: {
|
|
|
|
thumbV: { backgroundColor: 'rgba(0, 0, 0, 0.1)', width: '5px', borderRadius: 'inherit', cursor: 'default' },
|
|
|
|
thumbH: { backgroundColor: 'rgba(0, 0, 0, 0.1)', height: '5px', borderRadius: 'inherit', cursor: 'default' }
|
2019-07-16 12:27:35 +00:00
|
|
|
},
|
|
|
|
};
|
|
|
|
|
2019-07-23 12:25:43 +00:00
|
|
|
const stype = scrollbarType[props.stype];
|
2019-07-16 12:27:35 +00:00
|
|
|
|
|
|
|
const thumbV = stype ? stype.thumbV : {};
|
|
|
|
const thumbH = stype ? stype.thumbH : {};
|
|
|
|
|
|
|
|
const renderNavThumbVertical = ({ style, ...props }) => (
|
|
|
|
<div {...props} style={{ ...style, ...thumbV }} />
|
|
|
|
);
|
|
|
|
|
|
|
|
const renderNavThumbHorizontal = ({ style, ...props }) => (
|
|
|
|
<div {...props} style={{ ...style, ...thumbH }} />
|
|
|
|
);
|
|
|
|
|
|
|
|
return (
|
2019-07-23 12:25:43 +00:00
|
|
|
<Scrollbars renderThumbVertical={renderNavThumbVertical} renderThumbHorizontal={renderNavThumbHorizontal} {...props} />
|
2019-07-16 12:27:35 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2019-07-23 12:25:43 +00:00
|
|
|
Scrollbar.defaultProps = {
|
|
|
|
stype: "smallBlack"
|
|
|
|
};
|
|
|
|
|
2019-07-16 12:27:35 +00:00
|
|
|
export default Scrollbar;
|