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
11 changes: 5 additions & 6 deletions src/components/AddPaymentCard/PaymentCardCurrencyModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import RadioListItem from '@components/SelectionList/RadioListItem';
import useLocalize from '@hooks/useLocalize';
import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useThemeStyles from '@hooks/useThemeStyles';
import Navigation from '@libs/Navigation/Navigation';
import CONST from '@src/CONST';
Expand All @@ -29,7 +28,6 @@ type PaymentCardCurrencyModalProps = {
};

function PaymentCardCurrencyModal({isVisible, currencies, currentCurrency = CONST.PAYMENT_CARD_CURRENCY.USD, onCurrencyChange, onClose}: PaymentCardCurrencyModalProps) {
const {shouldUseNarrowLayout} = useResponsiveLayout();
const styles = useThemeStyles();
const {translate} = useLocalize();
const {sections} = useMemo(
Expand All @@ -54,10 +52,11 @@ function PaymentCardCurrencyModal({isVisible, currencies, currentCurrency = CONS
isVisible={isVisible}
onClose={() => onClose?.()}
onModalHide={onClose}
hideModalContentWhileAnimating
innerContainerStyle={styles.RHPNavigatorContainer(shouldUseNarrowLayout)}
onBackdropPress={Navigation.dismissModal}
useNativeDriver
onBackdropPress={() => {
onClose?.();

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.

Does this param need to be optional? We could make it required to avoid the optional chaining here

@ZhenjaHorbach ZhenjaHorbach Jul 22, 2025

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.

As I remember it is a prop from a parent component
So I think it's appropriate here

Navigation.dismissModal();
}}
shouldUseReanimatedModal
>
<ScreenWrapper
style={styles.pb0}
Expand Down
Loading