Skip to content

Commit

Permalink
fix missing theme colors (#918)
Browse files Browse the repository at this point in the history
  • Loading branch information
sieu-db authored Aug 7, 2024
1 parent 08e018d commit 965c2de
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/core/src/components/BottomSheet/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import BottomSheetComponent, {
BottomSheetScrollView,
} from "@gorhom/bottom-sheet";
import type { ReadTheme } from "@draftbit/theme";
import { useTheme } from "@draftbit/theme";
import { useDeepCompareMemo } from "../../utilities";

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

// Clarification:
Expand All @@ -46,25 +45,25 @@ export interface BottomSheetProps extends ScrollViewProps {
const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
(
{
theme,
snapPoints: snapPointsProp,
topSnapPosition = "10%",
middleSnapPosition = "50%",
bottomSnapPosition = "80%",
initialSnapIndex,
initialSnapPosition = "bottom",
showHandle = true,
handleColor = theme.colors.border.brand,
handleColor,
topBorderRadius = 20,
borderWidth = 1,
borderColor = theme.colors.border.brand,
borderColor,
onSettle,
style,
children,
...rest
},
ref
) => {
const theme = useTheme();
const backgroundColor =
(style as ViewStyle)?.backgroundColor || theme.colors.background.brand;

Expand Down Expand Up @@ -100,15 +99,15 @@ const BottomSheet = React.forwardRef<BottomSheetComponent, BottomSheetProps>(
: getSnapIndexFromPosition(initialSnapPosition)
}
handleIndicatorStyle={[
{ backgroundColor: handleColor },
{ backgroundColor: handleColor ?? theme.colors.border.brand },
!showHandle ? { display: "none" } : {},
]}
backgroundStyle={{
backgroundColor,
borderTopLeftRadius: topBorderRadius,
borderTopRightRadius: topBorderRadius,
borderWidth,
borderColor,
borderColor: borderColor ?? theme.colors.border.brand,
}}
onChange={(index) => onSettle?.(mappedSnapPoints.length - index - 1)}
>
Expand Down

0 comments on commit 965c2de

Please sign in to comment.