Skip to content

Commit a4d0b00

Browse files
fix: preserve money deposit amount emphasis while loading
1 parent 04c4b55 commit a4d0b00

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

app/components/Views/confirmations/components/info/custom-amount-info/custom-amount-info.test.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import { usePayWithMoneyAccountSection } from '../../../hooks/pay/sections/usePa
5050
import Logger from '../../../../../../util/Logger';
5151
import useClearConfirmationOnBackSwipe from '../../../hooks/ui/useClearConfirmationOnBackSwipe';
5252
import { useAccountNoFundsAlert } from '../../../hooks/alerts/useAccountNoFundsAlert';
53+
import { mockTheme } from '../../../../../../util/theme';
5354

5455
jest.mock('../../../hooks/ui/useClearConfirmationOnBackSwipe');
5556
jest.mock('../../../hooks/ui/useMMPayNavigation');
@@ -688,6 +689,22 @@ describe('CustomAmountInfo', () => {
688689
expect(getByTestId('custom-amount-input').props.onPress).toBeUndefined();
689690
});
690691

692+
it('keeps the amount visually enabled during preparation', () => {
693+
arrangePendingPreparation();
694+
const { getByTestId } = render({
695+
transactionType: TransactionType.moneyAccountDeposit,
696+
});
697+
698+
fireEvent.press(getByTestId('deposit-keyboard-done-button'));
699+
700+
expect(getByTestId('custom-amount-input')).toHaveStyle({
701+
color: mockTheme.colors.text.default,
702+
});
703+
expect(getByTestId('custom-amount-symbol')).toHaveStyle({
704+
color: mockTheme.colors.text.default,
705+
});
706+
});
707+
691708
it('keeps the loading review throughout quote loading', async () => {
692709
const { deferred } = arrangePendingPreparation();
693710
const view = render({

app/components/Views/confirmations/components/info/custom-amount-info/custom-amount-info.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,10 @@ export const CustomAmountInfo: React.FC<CustomAmountInfoProps> = memo(
360360
!hasAccountNoFunds &&
361361
(isPrefillPending || isDepositPrefillLoading)
362362
}
363-
onPress={handleAmountPress}
364-
disabled={!hasPaymentOption || showMoneyAccountLoadingReview}
363+
onPress={
364+
showMoneyAccountLoadingReview ? undefined : handleAmountPress
365+
}
366+
disabled={!hasPaymentOption}
365367
showCursor={isKeyboardVisible && !showMoneyAccountLoadingReview}
366368
/>
367369
{!hidePayTokenAmount &&

0 commit comments

Comments
 (0)