From f6dbe5552fdc3bdf477bde0e13e8e1a06d435470 Mon Sep 17 00:00:00 2001 From: Ashoat Tevosyan Date: Mon, 4 Nov 2024 16:50:47 -0500 Subject: [PATCH] [native] Get rid of bottomSheetPaddingTop in ConnectFarcasterBottomSheet Summary: This padding was hardcoded by Ginsu to add additional space at the bottom of the `BottomSheet`. It is obviated by my work to consider `BottomSheetHandle` when setting `snapPoints`. The padding was extra large because Ginsu measured the height of the button incorrectly. Once I adjusted the height of button, the padding is approximately the same as what it was before. Depends on D13870 Test Plan: In combination with the rest of the stack, I tested each individual use of our `BottomSheet` component to make sure that the bottom padding was reasonable. In most cases it was unchanged; in other cases, it was changed to be more consistent with the other `BottomSheet`s in our codebase. In all cases, there was enough padding for the "home pill" at the bottom of the screen Reviewers: bartek Reviewed By: bartek Subscribers: tomek Differential Revision: https://phab.comm.dev/D13871 --- .../connect-farcaster-bottom-sheet.react.js | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/native/components/connect-farcaster-bottom-sheet.react.js b/native/components/connect-farcaster-bottom-sheet.react.js index 3546bf1da8..44b1ca8b82 100644 --- a/native/components/connect-farcaster-bottom-sheet.react.js +++ b/native/components/connect-farcaster-bottom-sheet.react.js @@ -19,10 +19,9 @@ import type { RootNavigationProp } from '../navigation/root-navigator.react.js'; import type { NavigationRoute } from '../navigation/route-names.js'; import { useTryLinkFID } from '../utils/farcaster-utils.js'; -const bottomSheetPaddingTop = 32; const farcasterPromptHeight = 350; const marginBottom = 40; -const buttonHeight = 48; +const buttonHeight = 61; type Props = { +navigation: RootNavigationProp<'ConnectFarcasterBottomSheet'>, @@ -66,11 +65,7 @@ function ConnectFarcasterBottomSheet(props: Props): React.Node { React.useLayoutEffect(() => { setContentHeight( - bottomSheetPaddingTop + - farcasterPromptHeight + - marginBottom + - buttonHeight + - insets.bottom, + farcasterPromptHeight + marginBottom + buttonHeight + insets.bottom, ); }, [insets.bottom, setContentHeight]); @@ -117,7 +112,7 @@ const styles = StyleSheet.create({ paddingHorizontal: 16, }, promptContainer: { - marginBottom: 40, + marginBottom, }, });