@@ -6,9 +6,9 @@ import * as Expensicons from '@components/Icon/Expensicons';
6
6
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback' ;
7
7
import Tooltip from '@components/Tooltip' ;
8
8
import useLocalize from '@hooks/useLocalize' ;
9
+ import useResponsiveLayout from '@hooks/useResponsiveLayout' ;
9
10
import useTheme from '@hooks/useTheme' ;
10
11
import useThemeStyles from '@hooks/useThemeStyles' ;
11
- import useWindowDimensions from '@hooks/useWindowDimensions' ;
12
12
import CONST from '@src/CONST' ;
13
13
14
14
type SendButtonProps = {
@@ -23,7 +23,7 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
23
23
const theme = useTheme ( ) ;
24
24
const styles = useThemeStyles ( ) ;
25
25
const { translate} = useLocalize ( ) ;
26
- const { isSmallScreenWidth} = useWindowDimensions ( ) ;
26
+ const { isSmallScreenWidth} = useResponsiveLayout ( ) ;
27
27
const Tap = Gesture . Tap ( ) . onEnd ( ( ) => {
28
28
handleSendMessage ( ) ;
29
29
} ) ;
@@ -37,7 +37,7 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
37
37
< GestureDetector
38
38
// A new GestureDetector instance must be created when switching from a large screen to a small screen
39
39
// if not, the GestureDetector may not function correctly.
40
- key = { `${ isSmallScreenWidth ? 0 : 1 } ` }
40
+ key = { `send-button- ${ isSmallScreenWidth ? 'small-screen' : 'normal-screen' } ` }
41
41
gesture = { Tap }
42
42
>
43
43
< Tooltip text = { translate ( 'common.send' ) } >
0 commit comments