Skip to content

Commit

Permalink
refactor(slider): ♻️ change default orientation to vertical
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnaveen committed Jun 29, 2022
1 parent 2a8fcf2 commit 151a076
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/slider/stories/SliderSingleVertical.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ export type SliderSingleVerticalProps = SliderBaseStateProps & {
showTip?: boolean;
};

export const SliderSingleVertical: React.FC<
SliderSingleVerticalProps
> = props => {
export const SliderSingleVertical: React.FC<SliderSingleVerticalProps> = ({
orientation = "vertical",
...props
}) => {
const { label, showTip, ...rest } = props;
const sliderLabel = `${label ? label : "Styled"} Slider`;
const state = useSliderBaseState(props);
const state = useSliderBaseState({ ...props, orientation });
const slider = useSliderState({ ...rest, label: sliderLabel, state });
const { getThumbValueLabel, getValuePercent, values } = state;

Expand All @@ -52,7 +53,7 @@ export const SliderSingleVertical: React.FC<
<Thumb
index={0}
state={state}
orientation={props.orientation}
orientation={orientation}
isDisabled={props.isDisabled}
trackRef={slider.trackRef}
aria-label="Thumb"
Expand Down

0 comments on commit 151a076

Please sign in to comment.