Page MenuHomePhabricator

D13868.id45640.diff
No OneTemporary

D13868.id45640.diff

diff --git a/native/profile/keyserver-selection-bottom-sheet.react.js b/native/profile/keyserver-selection-bottom-sheet.react.js
--- a/native/profile/keyserver-selection-bottom-sheet.react.js
+++ b/native/profile/keyserver-selection-bottom-sheet.react.js
@@ -29,9 +29,6 @@
+keyserverInfo: KeyserverInfo,
};
-// header + paddingTop + paddingBottom + marginBottom
-const keyserverHeaderHeight = 84 + 16 + 16 + 24;
-
type Props = {
+navigation: RootNavigationProp<'KeyserverSelectionBottomSheet'>,
+route: NavigationRoute<'KeyserverSelectionBottomSheet'>,
@@ -51,8 +48,7 @@
invariant(bottomSheetContext, 'bottomSheetContext should be set');
const { setContentHeight } = bottomSheetContext;
- const removeKeyserverContainerRef =
- React.useRef<?React.ElementRef<typeof View>>();
+ const containerRef = React.useRef<?React.ElementRef<typeof View>>();
const bottomSheetRef = React.useRef<?BottomSheetRef>();
const colors = useColors();
@@ -61,20 +57,18 @@
const insets = useSafeAreaInsets();
const onLayout = React.useCallback(() => {
- removeKeyserverContainerRef.current?.measure(
- (x, y, width, height, pageX, pageY) => {
- if (
- height === null ||
- height === undefined ||
- pageY === null ||
- pageY === undefined
- ) {
- return;
- }
+ containerRef.current?.measure((x, y, width, height, pageX, pageY) => {
+ if (
+ height === null ||
+ height === undefined ||
+ pageY === null ||
+ pageY === undefined
+ ) {
+ return;
+ }
- setContentHeight(height + keyserverHeaderHeight + insets.bottom);
- },
- );
+ setContentHeight(height + insets.bottom);
+ });
}, [insets.bottom, setContentHeight]);
const cloudIcon = React.useMemo(
@@ -196,7 +190,7 @@
return (
<BottomSheet ref={bottomSheetRef} onClosed={goBack}>
- <View style={styles.container}>
+ <View style={styles.container} ref={containerRef} onLayout={onLayout}>
<View style={styles.keyserverDetailsContainer}>
<View style={styles.keyserverHeaderContainer}>
<View style={styles.keyserverPillContainer}>
@@ -212,9 +206,7 @@
</View>
<Text style={styles.keyserverURLText}>{keyserverInfo.urlPrefix}</Text>
</View>
- <View ref={removeKeyserverContainerRef} onLayout={onLayout}>
- {removeKeyserver}
- </View>
+ {removeKeyserver}
</View>
</BottomSheet>
);

File Metadata

Mime Type
text/plain
Expires
Thu, Nov 7, 9:34 PM (22 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2435682
Default Alt Text
D13868.id45640.diff (2 KB)

Event Timeline