Skip to content

Commit 26e1327

Browse files
committed
Fix: Use useResponsiveLayout
1 parent c70846c commit 26e1327

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pages/home/report/ReportActionCompose/SendButton.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import * as Expensicons from '@components/Icon/Expensicons';
66
import PressableWithFeedback from '@components/Pressable/PressableWithFeedback';
77
import Tooltip from '@components/Tooltip';
88
import useLocalize from '@hooks/useLocalize';
9+
import useResponsiveLayout from '@hooks/useResponsiveLayout';
910
import useTheme from '@hooks/useTheme';
1011
import useThemeStyles from '@hooks/useThemeStyles';
11-
import useWindowDimensions from '@hooks/useWindowDimensions';
1212
import CONST from '@src/CONST';
1313

1414
type SendButtonProps = {
@@ -23,7 +23,7 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
2323
const theme = useTheme();
2424
const styles = useThemeStyles();
2525
const {translate} = useLocalize();
26-
const {isSmallScreenWidth} = useWindowDimensions();
26+
const {isSmallScreenWidth} = useResponsiveLayout();
2727
const Tap = Gesture.Tap().onEnd(() => {
2828
handleSendMessage();
2929
});
@@ -37,7 +37,7 @@ function SendButton({isDisabled: isDisabledProp, handleSendMessage}: SendButtonP
3737
<GestureDetector
3838
// A new GestureDetector instance must be created when switching from a large screen to a small screen
3939
// if not, the GestureDetector may not function correctly.
40-
key={`${isSmallScreenWidth ? 0 : 1}`}
40+
key={`send-button-${isSmallScreenWidth ? 'small-screen' : 'normal-screen'}`}
4141
gesture={Tap}
4242
>
4343
<Tooltip text={translate('common.send')}>

0 commit comments

Comments
 (0)