Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33052331
D11561.1768425253.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D11561.1768425253.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 14, 9:14 PM (13 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5931313
Default Alt Text
D11561.1768425253.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