Skip to content

Commit

Permalink
define and use canUseTouchScreen to get apply correct margin value fo…
Browse files Browse the repository at this point in the history
…r button
  • Loading branch information
aman-atg committed Oct 2, 2023
1 parent c390d5e commit 34e6066
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/pages/iou/steps/MoneyRequestAmountForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu

const formattedAmount = MoneyRequestUtils.replaceAllDigits(currentAmount, toLocaleDigit);
const buttonText = isEditing ? translate('common.save') : translate('common.next');
const canUseTouchScreen = DeviceCapabilities.canUseTouchScreen();

return (
<ScrollView contentContainerStyle={styles.flexGrow1}>
Expand Down Expand Up @@ -257,7 +258,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
style={[styles.w100, styles.justifyContentEnd, styles.pageWrapper, styles.pt0]}
nativeID={NUM_PAD_CONTAINER_VIEW_ID}
>
{DeviceCapabilities.canUseTouchScreen() ? (
{canUseTouchScreen ? (
<BigNumberPad
nativeID={NUM_PAD_VIEW_ID}
numberPressed={updateAmountNumberPad}
Expand All @@ -267,7 +268,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
<Button
success
medium={isExtraSmallScreenHeight}
style={[styles.w100, styles.mt5]}
style={[styles.w100, canUseTouchScreen ? styles.mt5 : styles.mt2]}
onPress={submitAndNavigateToNextPage}
pressOnEnter
text={buttonText}
Expand Down

0 comments on commit 34e6066

Please sign in to comment.