From 593259b1c0b0aba0b3cf8de360d504ef82f06f7b Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 4 Aug 2019 22:08:39 -0400 Subject: [PATCH] New: Wider and taller scroll bar for the click to scrollers out there Co-Authored-By: Mark McDowall --- .../Components/Scroller/OverlayScroller.css | 2 +- .../Components/Scroller/OverlayScroller.js | 46 ++++++++++++++++++- frontend/src/Styles/Mixins/scroller.css | 6 +-- 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/frontend/src/Components/Scroller/OverlayScroller.css b/frontend/src/Components/Scroller/OverlayScroller.css index 707a9ac6f..139b1e779 100644 --- a/frontend/src/Components/Scroller/OverlayScroller.css +++ b/frontend/src/Components/Scroller/OverlayScroller.css @@ -3,7 +3,7 @@ } .thumb { - min-height: 50px; + min-height: 100px; border: 1px solid transparent; border-radius: 5px; background-color: $scrollbarBackgroundColor; diff --git a/frontend/src/Components/Scroller/OverlayScroller.js b/frontend/src/Components/Scroller/OverlayScroller.js index 23fe6058a..e2a269bdc 100644 --- a/frontend/src/Components/Scroller/OverlayScroller.js +++ b/frontend/src/Components/Scroller/OverlayScroller.js @@ -4,6 +4,8 @@ import { Scrollbars } from 'react-custom-scrollbars'; import { scrollDirections } from 'Helpers/Props'; import styles from './OverlayScroller.css'; +const SCROLLBAR_SIZE = 10; + class OverlayScroller extends Component { // @@ -21,7 +23,11 @@ class OverlayScroller extends Component { scrollTop } = this.props; - if (!this._isScrolling && scrollTop != null && scrollTop !== prevProps.scrollTop) { + if ( + !this._isScrolling && + scrollTop != null && + scrollTop !== prevProps.scrollTop + ) { this._scroller.scrollTop(scrollTop); } } @@ -42,6 +48,42 @@ class OverlayScroller extends Component { ); } + _renderTrackHorizontal = ({ style, props }) => { + const finalStyle = { + ...style, + right: 2, + bottom: 2, + left: 2, + borderRadius: 3, + height: SCROLLBAR_SIZE + }; + + return ( +
+ ); + } + + _renderTrackVertical = ({ style, props }) => { + const finalStyle = { + ...style, + right: 2, + bottom: 2, + top: 2, + borderRadius: 3, + width: SCROLLBAR_SIZE + }; + + return ( +
+ ); + } + _renderView = (props) => { return (