Skip to content

Commit e9ae1f9

Browse files
committed
fix: slider color
1 parent 18a994d commit e9ae1f9

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

src/theme/components/slider.ts

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,36 @@ export const SliderTrack = {
2626
};
2727

2828
export const SliderThumb = {
29-
baseStyle: () => {
29+
baseStyle: (props: any) => {
30+
let { colorScheme } = props;
3031
return {
3132
borderRadius: 'full',
3233
zIndex: 999,
3334
alignItems: 'center',
3435
justifyContent: 'center',
3536
scaleOnPressed: 1.2,
3637
_light: {
37-
bg: 'primary.600',
38+
bg: `${colorScheme}.600`,
3839
},
3940
_dark: {
40-
bg: 'primary.500',
41+
bg: `${colorScheme}.500`,
4142
},
4243
shadow: 6,
4344
};
4445
},
46+
defaultProps: {
47+
colorScheme: 'primary',
48+
},
4549
};
4650

4751
export const SliderFilledTrack = {
48-
baseStyle: ({ orientation, isReversed, sliderTrackPosition, size }: any) => {
52+
baseStyle: ({
53+
orientation,
54+
isReversed,
55+
sliderTrackPosition,
56+
size,
57+
colorScheme,
58+
}: any) => {
4959
return {
5060
left: orientation !== 'vertical' && !isReversed ? 0 : undefined,
5161
bottom: orientation === 'vertical' && !isReversed ? 0 : undefined,
@@ -56,13 +66,16 @@ export const SliderFilledTrack = {
5666
? { height: sliderTrackPosition, width: size }
5767
: { width: sliderTrackPosition, height: size },
5868
_light: {
59-
bg: 'primary.600',
69+
bg: `${colorScheme}.600`,
6070
},
6171
_dark: {
62-
bg: 'primary.500',
72+
bg: `${colorScheme}.500`,
6373
},
6474
};
6575
},
76+
defaultProps: {
77+
colorScheme: 'primary',
78+
},
6679
};
6780

6881
const sizes = {

0 commit comments

Comments
 (0)