Skip to content
This repository has been archived by the owner on Jun 26, 2024. It is now read-only.

Commit

Permalink
feat: add disabled props
Browse files Browse the repository at this point in the history
  • Loading branch information
wwayne committed Jun 10, 2021
1 parent 7ee2f77 commit 090b0da
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import cssStyle from './style'

export default class HorizontalScroll extends Component {
static propTypes = {
className: PropTypes.string
className: PropTypes.string,
disabled: PropTypes.bool
}

constructor (props) {
Expand Down Expand Up @@ -175,9 +176,10 @@ export default class HorizontalScroll extends Component {
}

render () {
const { className, children } = this.props
const { className, children, disabled } = this.props
const { trackWidth } = this.state
const isArrayChild = Array.isArray(children)
if (disabled) return children
return (
<div className={`HorizontalScroll ${className || ''}`} ref={this.wrapperRef}>
<div className='HorizontalScrollOuter' id={this.outerId} onWheel={::this.onWheel}>
Expand Down

0 comments on commit 090b0da

Please sign in to comment.