Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3695516
D11561.id38827.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D11561.id38827.diff
View Options
diff --git a/native/components/connect-farcaster-bottom-sheet.react.js b/native/components/connect-farcaster-bottom-sheet.react.js
--- a/native/components/connect-farcaster-bottom-sheet.react.js
+++ b/native/components/connect-farcaster-bottom-sheet.react.js
@@ -1,17 +1,25 @@
// @flow
+import invariant from 'invariant';
import * as React from 'react';
import { View, StyleSheet } from 'react-native';
+import { useSafeAreaInsets } from 'react-native-safe-area-context';
import FarcasterPrompt from './farcaster-prompt.react.js';
import FarcasterWebView, {
type FarcasterWebViewState,
} from './farcaster-web-view.react.js';
import RegistrationButton from '../account/registration/registration-button.react.js';
+import { BottomSheetContext } from '../bottom-sheet/bottom-sheet-provider.react.js';
import BottomSheet from '../bottom-sheet/bottom-sheet.react.js';
import type { RootNavigationProp } from '../navigation/root-navigator.react.js';
import type { NavigationRoute } from '../navigation/route-names.js';
+const bottomSheetPaddingTop = 32;
+const farcasterPromptHeight = 350;
+const marginBottom = 40;
+const buttonHeight = 48;
+
type Props = {
+navigation: RootNavigationProp<'ConnectFarcasterBottomSheet'>,
+route: NavigationRoute<'ConnectFarcasterBottomSheet'>,
@@ -24,6 +32,22 @@
const bottomSheetRef = React.useRef(null);
+ const bottomSheetContext = React.useContext(BottomSheetContext);
+ invariant(bottomSheetContext, 'bottomSheetContext should be set');
+ const { setContentHeight } = bottomSheetContext;
+
+ const insets = useSafeAreaInsets();
+
+ React.useLayoutEffect(() => {
+ setContentHeight(
+ bottomSheetPaddingTop +
+ farcasterPromptHeight +
+ marginBottom +
+ buttonHeight +
+ insets.bottom,
+ );
+ }, [insets.bottom, setContentHeight]);
+
const [webViewState, setWebViewState] =
React.useState<FarcasterWebViewState>('closed');
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 8, 10:52 AM (1 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2816741
Default Alt Text
D11561.id38827.diff (1 KB)
Attached To
Mode
D11561: [native] calculate snap points for connect farcaster bottom sheet
Attached
Detach File
Event Timeline
Log In to Comment