Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3343800
D9358.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D9358.diff
View Options
diff --git a/native/user-profile/user-profile-constants.js b/native/user-profile/user-profile-constants.js
new file mode 100644
--- /dev/null
+++ b/native/user-profile/user-profile-constants.js
@@ -0,0 +1,9 @@
+// @flow
+
+export const userProfileUserInfoContainerHeight = 90;
+
+export const userProfileBottomPadding = 40;
+
+export const userProfileMenuButtonHeight = 24;
+
+export const userProfileActionButtonHeight = 54;
diff --git a/native/user-profile/user-profile-relationship-button.react.js b/native/user-profile/user-profile-relationship-button.react.js
--- a/native/user-profile/user-profile-relationship-button.react.js
+++ b/native/user-profile/user-profile-relationship-button.react.js
@@ -9,6 +9,7 @@
import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types';
+import { userProfileActionButtonHeight } from './user-profile-constants.js';
import RelationshipButton from '../components/relationship-button.react.js';
import { useStyles } from '../themes/colors.js';
import Alert from '../utils/alert.js';
@@ -52,9 +53,7 @@
incomingFriendRequestButtonsContainerHeight,
);
} else {
- const relationshipButtonHeight = 54;
-
- setUserProfileRelationshipButtonHeight(relationshipButtonHeight);
+ setUserProfileRelationshipButtonHeight(userProfileActionButtonHeight);
}
}, [
otherUserInfo?.relationshipStatus,
diff --git a/native/user-profile/user-profile.react.js b/native/user-profile/user-profile.react.js
--- a/native/user-profile/user-profile.react.js
+++ b/native/user-profile/user-profile.react.js
@@ -12,6 +12,12 @@
import type { UserInfo } from 'lib/types/user-types';
import sleep from 'lib/utils/sleep.js';
+import {
+ userProfileUserInfoContainerHeight,
+ userProfileBottomPadding,
+ userProfileMenuButtonHeight,
+ userProfileActionButtonHeight,
+} from './user-profile-constants.js';
import UserProfileMessageButton from './user-profile-message-button.react.js';
import UserProfileRelationshipButton from './user-profile-relationship-button.react.js';
import UserAvatar from '../avatars/user-avatar.react.js';
@@ -46,22 +52,22 @@
const insets = useSafeAreaInsets();
React.useLayoutEffect(() => {
- const userInfoContainerHeight = 90;
- const bottomPadding = 40;
-
- let height = insets.bottom + userInfoContainerHeight + bottomPadding;
+ let height =
+ insets.bottom +
+ userProfileUserInfoContainerHeight +
+ userProfileBottomPadding;
if (userProfileThreadInfo) {
- const menuButtonHeight = 24;
- height += menuButtonHeight;
+ height += userProfileMenuButtonHeight;
}
if (
userProfileThreadInfo &&
!relationshipBlockedInEitherDirection(userInfo?.relationshipStatus)
) {
- const messageButtonHeight = 54;
- height += messageButtonHeight + userProfileRelationshipButtonHeight;
+ // message button height + relationship button height
+ height +=
+ userProfileActionButtonHeight + userProfileRelationshipButtonHeight;
}
setContentHeight(height);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 23, 4:06 AM (17 h, 49 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2568070
Default Alt Text
D9358.diff (3 KB)
Attached To
Mode
D9358: [native] introduce user profile constants
Attached
Detach File
Event Timeline
Log In to Comment