@@ -2,6 +2,7 @@ import { AnimatedVStack, VStack } from "@/design-system/VStack";
2
2
import { useConversationMessageContextMenuStyles } from "@/features/conversation/conversation-message/conversation-message-context-menu/conversation-message-context-menu.styles" ;
3
3
import { useAppTheme } from "@theme/useAppTheme" ;
4
4
import { memo , useEffect } from "react" ;
5
+ import { Platform , StatusBar , useWindowDimensions } from "react-native" ;
5
6
import {
6
7
useAnimatedStyle ,
7
8
useSharedValue ,
@@ -12,7 +13,6 @@ import {
12
13
MESSAGE_CONTEXT_MENU_ABOVE_MESSAGE_REACTIONS_HEIGHT ,
13
14
MESSAGE_CONTEXT_REACTIONS_HEIGHT ,
14
15
} from "./conversation-message-context-menu.constants" ;
15
- import { debugBorder } from "@/utils/debug-style" ;
16
16
17
17
export const MessageContextMenuContainer = memo (
18
18
function MessageContextMenuContainer ( args : {
@@ -30,6 +30,7 @@ export const MessageContextMenuContainer = memo(
30
30
const translateYAV = useSharedValue ( 0 ) ;
31
31
const { verticalSpaceBetweenSections } =
32
32
useConversationMessageContextMenuStyles ( ) ;
33
+ const { height : windowHeight } = useWindowDimensions ( ) ;
33
34
34
35
const {
35
36
itemRectY,
@@ -43,7 +44,7 @@ export const MessageContextMenuContainer = memo(
43
44
} = args ;
44
45
45
46
useEffect ( ( ) => {
46
- const screenHeight = theme . layout . screen . height ;
47
+ const screenHeight = windowHeight ;
47
48
const minTopOffset =
48
49
MESSAGE_CONTEXT_MENU_ABOVE_MESSAGE_REACTIONS_HEIGHT +
49
50
verticalSpaceBetweenSections +
@@ -85,16 +86,22 @@ export const MessageContextMenuContainer = memo(
85
86
theme ,
86
87
verticalSpaceBetweenSections ,
87
88
translateYAV ,
89
+ windowHeight ,
88
90
] ) ;
89
91
90
92
const animatedStyle = useAnimatedStyle ( ( ) => ( {
91
93
transform : [ { translateY : translateYAV . value } ] ,
92
94
} ) ) ;
93
95
96
+ // On Android, we need to account for the status bar height by moving the menu down
97
+ const statusBarHeight =
98
+ Platform . OS === "android" ? StatusBar . currentHeight || 0 : 0 ;
99
+
94
100
const distanceFromTop =
95
101
itemRectY -
96
102
MESSAGE_CONTEXT_MENU_ABOVE_MESSAGE_REACTIONS_HEIGHT -
97
- verticalSpaceBetweenSections ;
103
+ verticalSpaceBetweenSections +
104
+ ( Platform . OS === "android" ? statusBarHeight : 0 ) ;
98
105
99
106
return (
100
107
< AnimatedVStack
0 commit comments