From 776988da47fa0677a6c0f9e40530f8c097f7a659 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Thu, 5 May 2022 12:56:39 -0400 Subject: [PATCH] fix(striker-ui): include all MessageBox props passed to Slider --- striker-ui/components/Slider.tsx | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/striker-ui/components/Slider.tsx b/striker-ui/components/Slider.tsx index d3faf0d6..523b5bf3 100644 --- a/striker-ui/components/Slider.tsx +++ b/striker-ui/components/Slider.tsx @@ -150,25 +150,27 @@ const createOutlinedInput = ({ ); const Slider = ({ - messageBoxProps: { - text: messageBoxText, - type: messageBoxType, - } = SLIDER_DEFAULT_PROPS.messageBoxProps, - isAllowTextInput, + messageBoxProps = SLIDER_DEFAULT_PROPS.messageBoxProps, + isAllowTextInput = SLIDER_DEFAULT_PROPS.isAllowTextInput, label, - labelId, - labelProps, - sliderProps, + labelId = SLIDER_DEFAULT_PROPS.labelId, + labelProps = SLIDER_DEFAULT_PROPS.labelProps, + sliderProps = SLIDER_DEFAULT_PROPS.sliderProps, value, }: SliderProps): JSX.Element => { - const { sx: labelSx } = labelProps ?? SLIDER_DEFAULT_PROPS.labelProps; + const { + sx: messageBoxSx, + text: messageBoxText, + ...messageBoxRestProps + } = messageBoxProps; + const { sx: labelSx } = labelProps; const { max, min, onChange: sliderChangeCallback, sx: sliderSx, valueLabelDisplay: sliderValueLabelDisplay, - } = sliderProps ?? SLIDER_DEFAULT_PROPS.sliderProps; + } = sliderProps; const [isFocused, setIsFocused] = useState(false); @@ -254,9 +256,12 @@ const Slider = ({ {messageBoxText && ( )}