Skip to content

Commit 9227160

Browse files
Addressing suggestions
1 parent 4e6e195 commit 9227160

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/pages/iou/request/step/IOURequestStepAmount.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,18 @@ function IOURequestStepAmount({
346346
navigateBack();
347347
};
348348

349+
const handleHidePickerModal = useCallback(() => {
350+
setIsCurrencyPickerVisible(false);
351+
}, []);
352+
353+
const handleCurrencyChange = useCallback((value: string) => {
354+
setSelectedCurrency(value);
355+
}, []);
356+
357+
const handleCurrencyButtonPress = useCallback(() => {
358+
setIsCurrencyPickerVisible(true);
359+
}, []);
360+
349361
return (
350362
<StepScreenWrapper
351363
headerTitle={translate('iou.amount')}
@@ -357,10 +369,10 @@ function IOURequestStepAmount({
357369
>
358370
<IOURequestStepCurrencyModal
359371
isPickerVisible={isCurrencyPickerVisible}
360-
hidePickerModal={() => setIsCurrencyPickerVisible(false)}
372+
hidePickerModal={handleHidePickerModal}
361373
headerText={translate('common.selectCurrency')}
362374
value={selectedCurrency}
363-
onInputChange={(value) => setSelectedCurrency(value)}
375+
onInputChange={handleCurrencyChange}
364376
/>
365377
<MoneyRequestAmountForm
366378
isEditing={!!backTo || isEditing}
@@ -373,7 +385,7 @@ function IOURequestStepAmount({
373385
textInput.current = e;
374386
}}
375387
shouldKeepUserInput={transaction?.shouldShowOriginalAmount}
376-
onCurrencyButtonPress={() => setIsCurrencyPickerVisible(true)}
388+
onCurrencyButtonPress={handleCurrencyButtonPress}
377389
onSubmitButtonPress={saveAmountAndCurrency}
378390
allowFlippingAmount={!isSplitBill && allowNegative}
379391
selectedTab={iouRequestType as SelectedTabRequest}

0 commit comments

Comments
 (0)