Skip to content

Commit fe37cdf

Browse files
committed
fix: remove BottomSheetOverlay from QuickBuyRoot
Reverts the dismiss-on-outside-press regression introduced in 585d816. The QuickBuy sheet is intentionally overlay-free: no scrim, no background dimming, and the surface below stays interactive. BottomSheetOverlay was blocking all touches on the underlying content and closing the sheet when tapping outside, which is the opposite of the intended behaviour. Also removes the now-unnecessary BottomSheetOverlay stub from QuickBuySheet.test.tsx.
1 parent d993515 commit fe37cdf

2 files changed

Lines changed: 38 additions & 54 deletions

File tree

app/components/Views/SocialLeaderboard/TraderPositionView/components/QuickBuy/QuickBuyRoot.tsx

Lines changed: 38 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
BottomSheetDialog,
3-
BottomSheetOverlay,
43
type BottomSheetDialogRef,
54
Box,
65
} from '@metamask/design-system-react-native';
@@ -148,57 +147,46 @@ const QuickBuyRootInner: React.FC<QuickBuyRootInnerProps> = ({
148147
);
149148

150149
return (
151-
<>
152-
<BottomSheetOverlay
153-
onPress={
154-
!isSubmittingTx
155-
? () => bottomSheetRef.current?.onCloseDialog()
156-
: undefined
157-
}
158-
/>
159-
<BottomSheetDialog
160-
ref={bottomSheetRef}
161-
isInteractable={!isSubmittingTx}
162-
onClose={onClose}
163-
twClassName={surfaceClass}
164-
>
165-
{isContentReady ? (
166-
<QuickBuyProvider
167-
target={target}
168-
onClose={requestClose}
169-
features={features}
170-
analyticsContext={analyticsContext}
171-
activeScreen={activeScreen}
172-
setActiveScreen={navigateToScreen}
150+
<BottomSheetDialog
151+
ref={bottomSheetRef}
152+
isInteractable={!isSubmittingTx}
153+
onClose={onClose}
154+
twClassName={surfaceClass}
155+
>
156+
{isContentReady ? (
157+
<QuickBuyProvider
158+
target={target}
159+
onClose={requestClose}
160+
features={features}
161+
analyticsContext={analyticsContext}
162+
activeScreen={activeScreen}
163+
setActiveScreen={navigateToScreen}
164+
>
165+
<Box
166+
testID="quick-buy-content-container"
167+
onLayout={handleContentLayout}
168+
style={lockedHeight !== null ? { height: lockedHeight } : undefined}
173169
>
174-
<Box
175-
testID="quick-buy-content-container"
176-
onLayout={handleContentLayout}
177-
style={
178-
lockedHeight !== null ? { height: lockedHeight } : undefined
179-
}
170+
<Animated.View
171+
key={activeScreen}
172+
entering={hasNavigated ? entering : undefined}
173+
exiting={isClosing ? undefined : exiting}
174+
style={lockedHeight !== null ? tw.style('flex-1') : undefined}
180175
>
181-
<Animated.View
182-
key={activeScreen}
183-
entering={hasNavigated ? entering : undefined}
184-
exiting={isClosing ? undefined : exiting}
185-
style={lockedHeight !== null ? tw.style('flex-1') : undefined}
186-
>
187-
{renderActiveScreen(activeScreen, children)}
188-
</Animated.View>
189-
</Box>
190-
</QuickBuyProvider>
191-
) : (
192-
<AnimatedScrollView
193-
style={tw.style('shrink')}
194-
keyboardShouldPersistTaps="handled"
195-
showsVerticalScrollIndicator={false}
196-
>
197-
<QuickBuyBottomSheetSkeleton />
198-
</AnimatedScrollView>
199-
)}
200-
</BottomSheetDialog>
201-
</>
176+
{renderActiveScreen(activeScreen, children)}
177+
</Animated.View>
178+
</Box>
179+
</QuickBuyProvider>
180+
) : (
181+
<AnimatedScrollView
182+
style={tw.style('shrink')}
183+
keyboardShouldPersistTaps="handled"
184+
showsVerticalScrollIndicator={false}
185+
>
186+
<QuickBuyBottomSheetSkeleton />
187+
</AnimatedScrollView>
188+
)}
189+
</BottomSheetDialog>
202190
);
203191
};
204192

app/components/Views/SocialLeaderboard/TraderPositionView/components/QuickBuy/QuickBuySheet.test.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,6 @@ jest.mock('@metamask/design-system-react-native', () => {
4141

4242
return {
4343
...actual,
44-
// Stub the overlay — its Animated fade uses useNativeDriver which isn't
45-
// available in the test environment.
46-
BottomSheetOverlay: () =>
47-
ReactMock.createElement(View, { testID: 'mock-bottom-sheet-overlay' }),
4844
BottomSheetDialog: ReactMock.forwardRef(
4945
(
5046
{

0 commit comments

Comments
 (0)