Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Big number pad button size is not justified on small screens #25656

1 change: 1 addition & 0 deletions src/components/BigNumberPad.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ function BigNumberPad(props) {
return (
<Button
key={column}
medium
Copy link
Member

@parasharrajat parasharrajat Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to do the same here and use isExtraSmallScreenWidth

shouldEnableHapticFeedback
style={[styles.flex1, marginLeft]}
text={column === '<' ? column : props.toLocaleDigit(column)}
Expand Down
4 changes: 3 additions & 1 deletion src/pages/iou/steps/MoneyRequestAmountForm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, {useEffect, useState, useCallback, useRef} from 'react';
import {View} from 'react-native';
import {Dimensions, View} from 'react-native';
import PropTypes from 'prop-types';
import lodashGet from 'lodash/get';
import _ from 'underscore';
Expand Down Expand Up @@ -59,6 +59,7 @@ const NUM_PAD_VIEW_ID = 'numPadView';

function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCurrencyButtonPress, onSubmitButtonPress}) {
const {translate, toLocaleDigit, numberFormat} = useLocalize();
const screenHeight = Dimensions.get('window').height;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use useWindowDimensions hook. Can we use isExtraSmallScreenWidth instead of height check?

If not, let move the condition to a const and name it as isExtraSmallHeight.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use isExtraSmallScreenWidth instead of height check?

Yes, we can. I've updated.


const textInput = useRef(null);

Expand Down Expand Up @@ -219,6 +220,7 @@ function MoneyRequestAmountForm({amount, currency, isEditing, forwardedRef, onCu
) : null}
<Button
success
medium={screenHeight < 550}
style={[styles.w100, styles.mt5]}
onPress={submitAndNavigateToNextPage}
pressOnEnter
Expand Down