@@ -10,7 +10,7 @@ import {
10
10
import BottomSheetComponent , {
11
11
BottomSheetScrollView ,
12
12
} from "@gorhom/bottom-sheet" ;
13
- import type { ReadTheme } from "@draftbit/theme" ;
13
+ import { useTheme } from "@draftbit/theme" ;
14
14
import { useDeepCompareMemo } from "../../utilities" ;
15
15
16
16
type SnapPosition = "top" | "middle" | "bottom" ;
@@ -37,7 +37,6 @@ export interface BottomSheetProps extends ScrollViewProps {
37
37
borderColor ?: string ;
38
38
onSettle ?: ( index : number ) => void ;
39
39
style ?: StyleProp < ViewStyle > ;
40
- theme : ReadTheme ;
41
40
}
42
41
43
42
// Clarification:
@@ -46,25 +45,25 @@ export interface BottomSheetProps extends ScrollViewProps {
46
45
const BottomSheet = React . forwardRef < BottomSheetComponent , BottomSheetProps > (
47
46
(
48
47
{
49
- theme,
50
48
snapPoints : snapPointsProp ,
51
49
topSnapPosition = "10%" ,
52
50
middleSnapPosition = "50%" ,
53
51
bottomSnapPosition = "80%" ,
54
52
initialSnapIndex,
55
53
initialSnapPosition = "bottom" ,
56
54
showHandle = true ,
57
- handleColor = theme . colors . border . brand ,
55
+ handleColor,
58
56
topBorderRadius = 20 ,
59
57
borderWidth = 1 ,
60
- borderColor = theme . colors . border . brand ,
58
+ borderColor,
61
59
onSettle,
62
60
style,
63
61
children,
64
62
...rest
65
63
} ,
66
64
ref
67
65
) => {
66
+ const theme = useTheme ( ) ;
68
67
const backgroundColor =
69
68
( style as ViewStyle ) ?. backgroundColor || theme . colors . background . brand ;
70
69
@@ -100,15 +99,15 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
100
99
: getSnapIndexFromPosition ( initialSnapPosition )
101
100
}
102
101
handleIndicatorStyle = { [
103
- { backgroundColor : handleColor } ,
102
+ { backgroundColor : handleColor ?? theme . colors . border . brand } ,
104
103
! showHandle ? { display : "none" } : { } ,
105
104
] }
106
105
backgroundStyle = { {
107
106
backgroundColor,
108
107
borderTopLeftRadius : topBorderRadius ,
109
108
borderTopRightRadius : topBorderRadius ,
110
109
borderWidth,
111
- borderColor,
110
+ borderColor : borderColor ?? theme . colors . border . brand ,
112
111
} }
113
112
onChange = { ( index ) => onSettle ?.( mappedSnapPoints . length - index - 1 ) }
114
113
>
0 commit comments