Skip to content

Commit

Permalink
chore: remove unused prop from BottomSheetModal component (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
achou11 authored Apr 29, 2024
1 parent 7b6ec24 commit dd9101b
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions src/frontend/sharedComponents/BottomSheetModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,27 +73,13 @@ interface Props extends React.PropsWithChildren<{}> {
onDismiss?: () => void;
// Triggered by: Android hardware back press and gesture back swipe
onBack?: () => void;
disableBackrop?: boolean;
fullHeight?: boolean;
}

export const BottomSheetModal = React.forwardRef<RNBottomSheetModal, Props>(
({children, isOpen, onBack, disableBackrop, fullHeight}, ref) => {
({children, isOpen, onBack, fullHeight}, ref) => {
useBackHandler(isOpen, onBack);

const renderBackdrop = React.useCallback(
(props: BottomSheetBackdropProps) => {
return (
<BottomSheetBackdrop
{...props}
pressBehavior="none"
disappearsOnIndex={-1}
/>
);
},
[],
);

return (
<RNBottomSheetModal
ref={ref}
Expand All @@ -102,7 +88,7 @@ export const BottomSheetModal = React.forwardRef<RNBottomSheetModal, Props>(
? {borderRadius: 0}
: {borderColor: DARK_GREY, borderWidth: 1},
]}
backdropComponent={disableBackrop ? null : renderBackdrop}
backdropComponent={DefaultBackdrop}
enableContentPanningGesture={false}
enableHandlePanningGesture={false}
snapPoints={!fullHeight ? undefined : ['100%']}
Expand All @@ -114,4 +100,14 @@ export const BottomSheetModal = React.forwardRef<RNBottomSheetModal, Props>(
},
);

function DefaultBackdrop(props: BottomSheetBackdropProps) {
return (
<BottomSheetBackdrop
{...props}
pressBehavior="none"
disappearsOnIndex={-1}
/>
);
}

export {BottomSheetContent} from '../BottomSheet';

1 comment on commit dd9101b

@expo
Copy link

@expo expo bot commented on dd9101b Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Build Trigger Failure

The build trigger failed with the following error:

INVALID_EAS_JSON_ERROR: eas.json not found in the repository.

Please check your GitHub app installation settings and your Expo project's GitHub settings to make sure you've configured everything correctly.

Please sign in to comment.