Skip to content

Commit

Permalink
[native] Get rid of bottomSheetPaddingTop in ConnectFarcasterBottomSheet
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Ashoat committed Nov 6, 2024
1 parent d84f08d commit f6dbe55
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions native/components/connect-farcaster-bottom-sheet.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'>,
Expand Down Expand Up @@ -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]);

Expand Down Expand Up @@ -117,7 +112,7 @@ const styles = StyleSheet.create({
paddingHorizontal: 16,
},
promptContainer: {
marginBottom: 40,
marginBottom,
},
});

Expand Down

0 comments on commit f6dbe55

Please sign in to comment.