Skip to content

Commit ad8113a

Browse files
authored
fix missing theme colors (#917)
1 parent 57f189c commit ad8113a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/core/src/components/BottomSheet/BottomSheet.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import BottomSheetComponent, {
1111
BottomSheetScrollView,
1212
} from "@gorhom/bottom-sheet";
13-
import type { ReadTheme } from "@draftbit/theme";
13+
import { useTheme } from "@draftbit/theme";
1414
import { useDeepCompareMemo } from "../../utilities";
1515

1616
type SnapPosition = "top" | "middle" | "bottom";
@@ -37,7 +37,6 @@ export interface BottomSheetProps extends ScrollViewProps {
3737
borderColor?: string;
3838
onSettle?: (index: number) => void;
3939
style?: StyleProp<ViewStyle>;
40-
theme: ReadTheme;
4140
}
4241

4342
// Clarification:
@@ -46,25 +45,25 @@ export interface BottomSheetProps extends ScrollViewProps {
4645
const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
4746
(
4847
{
49-
theme,
5048
snapPoints: snapPointsProp,
5149
topSnapPosition = "10%",
5250
middleSnapPosition = "50%",
5351
bottomSnapPosition = "80%",
5452
initialSnapIndex,
5553
initialSnapPosition = "bottom",
5654
showHandle = true,
57-
handleColor = theme.colors.border.brand,
55+
handleColor,
5856
topBorderRadius = 20,
5957
borderWidth = 1,
60-
borderColor = theme.colors.border.brand,
58+
borderColor,
6159
onSettle,
6260
style,
6361
children,
6462
...rest
6563
},
6664
ref
6765
) => {
66+
const theme = useTheme();
6867
const backgroundColor =
6968
(style as ViewStyle)?.backgroundColor || theme.colors.background.brand;
7069

@@ -100,15 +99,15 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
10099
: getSnapIndexFromPosition(initialSnapPosition)
101100
}
102101
handleIndicatorStyle={[
103-
{ backgroundColor: handleColor },
102+
{ backgroundColor: handleColor ?? theme.colors.border.brand },
104103
!showHandle ? { display: "none" } : {},
105104
]}
106105
backgroundStyle={{
107106
backgroundColor,
108107
borderTopLeftRadius: topBorderRadius,
109108
borderTopRightRadius: topBorderRadius,
110109
borderWidth,
111-
borderColor,
110+
borderColor: borderColor ?? theme.colors.border.brand,
112111
}}
113112
onChange={(index) => onSettle?.(mappedSnapPoints.length - index - 1)}
114113
>

0 commit comments

Comments
 (0)