Skip to content

Instantly share code, notes, and snippets.

@xcoderzach
Last active January 11, 2017 19:53
Show Gist options
  • Save xcoderzach/c0a1d86e3cd9cd09c8fda8b4666311b0 to your computer and use it in GitHub Desktop.
Save xcoderzach/c0a1d86e3cd9cd09c8fda8b4666311b0 to your computer and use it in GitHub Desktop.
import React from 'react'
/*
This is the semantic component, notice there is nothing about
the display of the component defined here. 👍Yay SoC👍.
There's nothing preventing this component from being used with
react native, or as part of an svg, because it only describes
the semantics of the slider.
Obviously a full featured slider would probably need to do a lot
more.
*/
export default ({ startValue, stopValue, domain, onStartChange, onStopChange,
theme: {
SliderHandle,
SliderBar,
SliderContainer
}
}) =>
return (
<SliderContainer>
<SliderBar
onStartChange={props.onStartChange}
onStopChange={props.onStopChange}
domain={domain}
startValue={startValue}
stopValue={stopValue}
>
<SliderHandle
position="start"
domain={domain}
value={startValue}
onChange={props.onStartChange}
/>
<SliderHandle
position="stop"
domain={domain}
value={stopValue}
onChange={props.onStopChange}
/>
</SliderBar>
</SliderContainer>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment