diff --git a/apps/backtest-report/components/TimeRangeSlider/components/Handle.js b/apps/backtest-report/components/TimeRangeSlider/components/Handle.js new file mode 100644 index 000000000..338fb0133 --- /dev/null +++ b/apps/backtest-report/components/TimeRangeSlider/components/Handle.js @@ -0,0 +1,44 @@ +import PropTypes from 'prop-types' +import React from 'react' + +const Handle = ({ + error, + domain: [min, max], + handle: { id, value, percent = 0 }, + disabled, + getHandleProps, + }) => { + const leftPosition = `${percent}%` + + return ( + <> +
+
+
+
+ + ) +} + +Handle.propTypes = { + domain: PropTypes.array.isRequired, + handle: PropTypes.shape({ + id: PropTypes.string.isRequired, + value: PropTypes.number.isRequired, + percent: PropTypes.number.isRequired + }).isRequired, + getHandleProps: PropTypes.func.isRequired, + disabled: PropTypes.bool, + style: PropTypes.object, +} + +Handle.defaultProps = { disabled: false } + +export default Handle diff --git a/apps/backtest-report/components/TimeRangeSlider/components/KeyboardHandle.js b/apps/backtest-report/components/TimeRangeSlider/components/KeyboardHandle.js new file mode 100644 index 000000000..077312bda --- /dev/null +++ b/apps/backtest-report/components/TimeRangeSlider/components/KeyboardHandle.js @@ -0,0 +1,32 @@ +import PropTypes from 'prop-types' +import React from 'react' + +const KeyboardHandle = ({ domain: [min, max], handle: { id, value, percent = 0 }, disabled, getHandleProps }) => ( +