Skip to content

Commit

Permalink
fix(chart & explore): Show labels for SliderControl (apache#19765)
Browse files Browse the repository at this point in the history
* fix(chart & explore): make to show label of slidercontrol

* fix(chart & explore): make to update SliderControl props

* fix(chart & explore): make to fix lint
  • Loading branch information
prosdev0107 authored and philipher29 committed Jun 9, 2022
1 parent abccc4e commit 996d3f5
Showing 1 changed file with 36 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,50 @@
*/
import React from 'react';
import Slider from 'src/components/Slider';
import ControlHeader from 'src/explore/components/ControlHeader';
import ControlHeader, {
ControlHeaderProps,
} from 'src/explore/components/ControlHeader';

type SliderControlProps = {
type SliderControlProps = ControlHeaderProps & {
onChange: (value: number) => void;
value: number;
default?: number;
};

export default function SliderControl(props: SliderControlProps) {
const { onChange = () => {}, default: defaultValue, ...rest } = props;
export default function SliderControl({
default: defaultValue,
name,
label,
description,
renderTrigger,
rightNode,
leftNode,
validationErrors,
hovered,
warning,
danger,
onClick,
tooltipOnClick,
onChange = () => {},
...rest
}: SliderControlProps) {
const headerProps = {
name,
label,
description,
renderTrigger,
rightNode,
leftNode,
validationErrors,
onClick,
hovered,
tooltipOnClick,
warning,
danger,
};
return (
<>
<ControlHeader />
<ControlHeader {...headerProps} />
<Slider {...rest} onChange={onChange} defaultValue={defaultValue} />
</>
);
Expand Down

0 comments on commit 996d3f5

Please sign in to comment.