-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: [IOBP-479] Add temporary missing methods error in method selec…
…tion screen (#5394) ## Short description This PR adds the (temporary) missing methods error in methods selection screen ## List of changes proposed in this pull request - Refactored `WalletPaymentPickMethodScreen` to allow the error to be displayed - Added `WalletPaymentMissingMethodsError` component - Added required locale keys ## How to test With the `io-dev-api-server`, simulate an empty user wallet. Start a new payment from **Profile > New Wallet > Payment** and check if the error is displayed correctly and with working buttons. ## Preview https://github.com/pagopa/io-app/assets/6160324/65f4d64f-6980-4d36-a82d-873ccf505b5e
- Loading branch information
Showing
5 changed files
with
132 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
ts/features/walletV3/payment/components/WalletPaymentMissingMethodsError.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { useNavigation } from "@react-navigation/native"; | ||
import React from "react"; | ||
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent"; | ||
import { | ||
AppParamsList, | ||
IOStackNavigationProp | ||
} from "../../../../navigation/params/AppParamsList"; | ||
import { WalletOnboardingRoutes } from "../../onboarding/navigation/navigator"; | ||
import I18n from "../../../../i18n"; | ||
|
||
const WalletPaymentMissingMethodsError = () => { | ||
const navigation = useNavigation<IOStackNavigationProp<AppParamsList>>(); | ||
|
||
React.useEffect(() => { | ||
navigation.setOptions({ | ||
header: () => undefined, | ||
headerTransparent: true | ||
}); | ||
}, [navigation]); | ||
|
||
const handleAddMethod = () => { | ||
navigation.push(WalletOnboardingRoutes.WALLET_ONBOARDING_MAIN, { | ||
screen: WalletOnboardingRoutes.WALLET_ONBOARDING_SELECT_PAYMENT_METHOD | ||
}); | ||
}; | ||
|
||
const handleNotNow = () => { | ||
navigation.pop(); | ||
}; | ||
|
||
return ( | ||
<OperationResultScreenContent | ||
pictogram="cardAdd" | ||
title={I18n.t("wallet.payment.methodSelection.missingMethodsError.title")} | ||
subtitle={I18n.t( | ||
"wallet.payment.methodSelection.missingMethodsError.subtitle" | ||
)} | ||
action={{ | ||
label: I18n.t( | ||
"wallet.payment.methodSelection.missingMethodsError.addMethod" | ||
), | ||
accessibilityLabel: I18n.t( | ||
"wallet.payment.methodSelection.missingMethodsError.addMethod" | ||
), | ||
onPress: handleAddMethod | ||
}} | ||
secondaryAction={{ | ||
label: I18n.t( | ||
"wallet.payment.methodSelection.missingMethodsError.notNow" | ||
), | ||
accessibilityLabel: I18n.t( | ||
"wallet.payment.methodSelection.missingMethodsError.notNow" | ||
), | ||
onPress: handleNotNow | ||
}} | ||
/> | ||
); | ||
}; | ||
|
||
export { WalletPaymentMissingMethodsError }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters