Skip to content

Conversation

@dfilatov
Copy link

@dfilatov dfilatov commented Feb 24, 2018

It would be convenient to have rheostat-disabled in case of slider is disabled. It gives ability to specify css rules to distinguish active and disabled states.

src/Slider.jsx Outdated
classNames.push(props.orientation === 'vertical'
? 'rheostat-vertical'
: 'rheostat-horizontal';
: 'rheostat-horizontal');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ); needs to be on a line by itself; perhaps a cleaner option is classNames.push(orientation), or const classNames = ['rheostat', orientation] after the ternary?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

src/Slider.jsx Outdated

return ['rheostat', orientation].concat(props.className.split(' ')).join(' ');
if (props.className) {
classNames = [...classNames, ...props.className.split(' ')];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

classNames.push(...props.className.split(' ')), but this should probably be using the cx package instead of manually splitting :-/

}

if (props.className) {
classNames.push(...props.className.split(' '));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still think this should use the cx package instead of split.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't introduced manual splitting, it had been there before. Probably it's worth doing that but looks like it's out of scope of this pr.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants