Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 16 additions & 30 deletions src/pages/iou/IOUCurrencySelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import lodashGet from 'lodash/get';
import Str from 'expensify-common/lib/str';
import ONYXKEYS from '../../ONYXKEYS';
import CONST from '../../CONST';
import OptionsSelector from '../../components/OptionsSelector';
import Navigation from '../../libs/Navigation/Navigation';
import ScreenWrapper from '../../components/ScreenWrapper';
import HeaderWithBackButton from '../../components/HeaderWithBackButton';
Expand All @@ -15,11 +14,8 @@ import withLocalize, {withLocalizePropTypes} from '../../components/withLocalize
import {withNetwork} from '../../components/OnyxProvider';
import * as CurrencyUtils from '../../libs/CurrencyUtils';
import ROUTES from '../../ROUTES';
import themeColors from '../../styles/themes/default';
import * as Expensicons from '../../components/Icon/Expensicons';
import {iouPropTypes, iouDefaultProps} from './propTypes';

const greenCheckmark = {src: Expensicons.Checkmark, color: themeColors.success};
import SelectionList from '../../components/SelectionList';

/**
* IOU Currency selection for selecting currency
Expand Down Expand Up @@ -99,8 +95,7 @@ function IOUCurrencySelection(props) {
text: `${currencyCode} - ${CurrencyUtils.getLocalizedCurrencySymbol(currencyCode)}`,
currencyCode,
keyForList: currencyCode,
customIcon: isSelectedCurrency ? greenCheckmark : undefined,
boldStyle: isSelectedCurrency,
isSelected: isSelectedCurrency,
};
});

Expand All @@ -117,9 +112,7 @@ function IOUCurrencySelection(props) {
? []
: [
{
title: translate('iOUCurrencySelection.allCurrencies'),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It looks like this text was removed, but the strings still exist in the en.ts and es.ts files. Should it be removed from there too?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If so, I can remove it as part of my PR here #29876 but I just want to be sure it's OK to do so.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah yeah, we didn't notice, if they are not used anymore, let's remove them

data: filteredCurrencies,
shouldShow: true,
indexOffset: 0,
},
],
Expand All @@ -133,27 +126,20 @@ function IOUCurrencySelection(props) {
onEntryTransitionEnd={() => optionsSelectorRef.current && optionsSelectorRef.current.focus()}
testID={IOUCurrencySelection.displayName}
>
{({safeAreaPaddingBottomStyle}) => (
<>
<HeaderWithBackButton
title={translate('iOUCurrencySelection.selectCurrency')}
onBackButtonPress={() => Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID))}
/>
<OptionsSelector
sections={sections}
onSelectRow={confirmCurrencySelection}
value={searchValue}
onChangeText={setSearchValue}
textInputLabel={translate('common.search')}
headerMessage={headerMessage}
safeAreaPaddingBottomStyle={safeAreaPaddingBottomStyle}
initiallyFocusedOptionKey={initiallyFocusedOptionKey}
shouldHaveOptionSeparator
autoFocus={false}
ref={optionsSelectorRef}
/>
</>
)}
<HeaderWithBackButton
title={translate('iOUCurrencySelection.selectCurrency')}
onBackButtonPress={() => Navigation.goBack(ROUTES.MONEY_REQUEST.getRoute(iouType, reportID))}
/>
<SelectionList
sections={sections}
textInputLabel={translate('common.search')}
textInputValue={searchValue}
onChangeText={setSearchValue}
onSelectRow={confirmCurrencySelection}
headerMessage={headerMessage}
initiallyFocusedOptionKey={initiallyFocusedOptionKey}
showScrollIndicator
/>
</ScreenWrapper>
);
}
Expand Down