Skip to content

Commit 90c73cf

Browse files
chore(web): adjust styling, remove thumbSize prop
1 parent d7eb359 commit 90c73cf

File tree

4 files changed

+4
-14
lines changed

4 files changed

+4
-14
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ To use this library you need to ensure you are using the correct version of Reac
9696
| `maximumTrackImage` | Assigns a maximum track image. Only static images are supported. The leftmost pixel of the image will be stretched to fill the track. | Image<br/>.propTypes<br/>.source | iOS |
9797
| `minimumTrackImage` | Assigns a minimum track image. Only static images are supported. The rightmost pixel of the image will be stretched to fill the track. | Image<br/>.propTypes<br/>.source | iOS |
9898
| `thumbImage` | Sets an image for the thumb. Only static images are supported. Needs to be a URI of a local or network image; base64-encoded SVG is not supported. | Image<br/>.propTypes<br/>.source | |
99-
| `thumbSize` | Define the size of the thumb. Only for web<br/>Default value is 20px. | number | web |
10099
| `trackImage` | Assigns a single image for the track. Only static images are supported. The center pixel of the image will be stretched to fill the track. | Image<br/>.propTypes<br/>.source | iOS |
101100
| [`StepMarker`](#stepmarker) | Component to be rendered for each step on the track,<br/>with the possibility to change the styling, when thumb is at that given step | `FC<MarkerProps>` | |
102101
| [`renderStepNumber`](#renderstepnumber) | Turns on the displaying of numbers of steps.<br/>Numbers of steps are displayed under the track | bool | iOS, Android, Windows |

package/src/RNCSliderNativeComponent.web.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ export interface Props {
4141
inverted: boolean;
4242
disabled: boolean;
4343
trackHeight: number;
44-
thumbSize: number;
4544
thumbImage?: ImageSource;
4645
onRNCSliderSlidingStart: (event: Event) => void;
4746
onRNCSliderSlidingComplete: (event: Event) => void;
@@ -67,7 +66,6 @@ const RCTSliderWebComponent = React.forwardRef(
6766
inverted = false,
6867
disabled = false,
6968
trackHeight = 4,
70-
thumbSize = constants.THUMB_SIZE,
7169
thumbImage,
7270
onRNCSliderSlidingStart = (_: Event) => {},
7371
onRNCSliderSlidingComplete = (_: Event) => {},
@@ -235,6 +233,7 @@ const RCTSliderWebComponent = React.forwardRef(
235233
flexGrow: maxPercent,
236234
};
237235

236+
const thumbSize = constants.THUMB_SIZE;
238237
const thumbViewStyle = [
239238
{
240239
width: thumbSize,

package/src/Slider.tsx

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,17 +64,8 @@ type IOSProps = Readonly<{
6464
tapToSeek?: boolean;
6565
}>;
6666

67-
type WebProps = Readonly<{
68-
/**
69-
* The size of the thumb on the web platform.
70-
* Default value is 20px.
71-
*/
72-
thumbSize?: number;
73-
}>;
74-
7567
type Props = ViewProps &
7668
IOSProps &
77-
WebProps &
7869
WindowsProps &
7970
Readonly<{
8071
/**
@@ -310,7 +301,6 @@ const SliderComponent = (
310301
thumbImage={props.thumbImage}
311302
StepMarker={props.StepMarker}
312303
isLTR={inverted}
313-
thumbSize={props.thumbSize}
314304
/>
315305
) : null}
316306
<RCTSliderNativeComponent

package/src/components/StepsIndicator.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React, {FC, Fragment, useCallback, useMemo} from 'react';
2-
import {Platform, View, ViewStyle} from 'react-native';
2+
import {Platform, View} from 'react-native';
33
import {StepNumber} from './StepNumber';
44
import {MarkerProps, SliderTrackMark} from './TrackMark';
55
//@ts-ignore
@@ -34,6 +34,7 @@ export const StepsIndicator = ({
3434
: constants.STEP_NUMBER_TEXT_FONT_BIG,
3535
};
3636
}, [options.length]);
37+
3738
const platformDependentStyles = useMemo(() => {
3839
const isWeb = Platform.OS === 'web';
3940
return {
@@ -52,6 +53,7 @@ export const StepsIndicator = ({
5253
: styles.stepIndicatorElement,
5354
};
5455
}, [sliderWidth, thumbSize]);
56+
5557
const values = isLTR ? options.reverse() : options;
5658

5759
const renderStepIndicator = useCallback(

0 commit comments

Comments
 (0)