Skip to content

Commit

Permalink
fix: [PE-845] CGN Replace legacy error screen (#6469)
Browse files Browse the repository at this point in the history
## Short description
This pull request focuses on improving the error handling user interface
in the `CgnDetailScreen` component. The main changes involve replacing
the `GenericErrorComponent` with the `OperationResultScreenContent`
component to provide a more detailed and visually appealing error
screen.

## List of changes proposed in this pull request
- Updated the error handling logic to use
`OperationResultScreenContent`, providing a pictogram, title, subtitle,
and actions for retry and close operations

## How to test
- Tap on CGN card with no connection
- Check the outcome result
  • Loading branch information
LeleDallas authored Dec 2, 2024
1 parent d3660d3 commit 1b268af
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions ts/features/bonus/cgn/screens/CgnDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import cgnLogo from "../../../../../img/bonus/cgn/cgn_logo.png";
import eycaLogo from "../../../../../img/bonus/cgn/eyca_logo.png";
import { isLoading } from "../../../../common/model/RemoteValue";
import { BonusCardScreenComponent } from "../../../../components/BonusCard";
import GenericErrorComponent from "../../../../components/screens/GenericErrorComponent";
import { OperationResultScreenContent } from "../../../../components/screens/OperationResultScreenContent";
import SectionStatusComponent from "../../../../components/SectionStatus";
import { IOScrollViewActions } from "../../../../components/ui/IOScrollView";
import { useHardwareBackButton } from "../../../../hooks/useHardwareBackButton";
Expand Down Expand Up @@ -116,10 +116,19 @@ const CgnDetailScreen = (props: Props): React.ReactElement => {
if (pot.isError(props.potCgnDetails)) {
// subText is a blank space to avoid default value when it is undefined
return (
<GenericErrorComponent
subText={" "}
onRetry={loadCGN}
onCancel={navigation.goBack}
<OperationResultScreenContent
pictogram="umbrellaNew"
title={I18n.t("wallet.methodDetails.error.title")}
isHeaderVisible
subtitle={I18n.t("wallet.methodDetails.error.subtitle")}
action={{
label: I18n.t("global.buttons.close"),
onPress: navigation.goBack
}}
secondaryAction={{
label: I18n.t("global.buttons.retry"),
onPress: loadCGN
}}
/>
);
}
Expand Down

0 comments on commit 1b268af

Please sign in to comment.