Skip to content

Commit 151a076

Browse files
committed
refactor(slider): ♻️ change default orientation to vertical
1 parent 2a8fcf2 commit 151a076

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/slider/stories/SliderSingleVertical.component.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ export type SliderSingleVerticalProps = SliderBaseStateProps & {
2020
showTip?: boolean;
2121
};
2222

23-
export const SliderSingleVertical: React.FC<
24-
SliderSingleVerticalProps
25-
> = props => {
23+
export const SliderSingleVertical: React.FC<SliderSingleVerticalProps> = ({
24+
orientation = "vertical",
25+
...props
26+
}) => {
2627
const { label, showTip, ...rest } = props;
2728
const sliderLabel = `${label ? label : "Styled"} Slider`;
28-
const state = useSliderBaseState(props);
29+
const state = useSliderBaseState({ ...props, orientation });
2930
const slider = useSliderState({ ...rest, label: sliderLabel, state });
3031
const { getThumbValueLabel, getValuePercent, values } = state;
3132

@@ -52,7 +53,7 @@ export const SliderSingleVertical: React.FC<
5253
<Thumb
5354
index={0}
5455
state={state}
55-
orientation={props.orientation}
56+
orientation={orientation}
5657
isDisabled={props.isDisabled}
5758
trackRef={slider.trackRef}
5859
aria-label="Thumb"

0 commit comments

Comments
 (0)