Skip to content

Commit

Permalink
chore(IT Wallet): [SIW-662] Remove legacy useItwDataProcessing hook (#…
Browse files Browse the repository at this point in the history
…5246)

## Short description
Depends on #5241.
This PR removes the legacy `useItwDataProcessing` hook in favour of
`useItwInfoBottomSheet` which has the same functionality but generalized
for different screens.

## List of changes proposed in this pull request
- Removes `useItwDataProcessing.ts`;
- Replaces its usage with `useItwInfoBottomSheet`.

## How to test
Static checks should be enough but try also a credential issuing flow
and check the "Find out more" label in the data presentation screen. It
should open a bottom sheet.
  • Loading branch information
LazyAfternoons committed Nov 22, 2023
1 parent 29560f7 commit 3473d6d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 56 deletions.
54 changes: 0 additions & 54 deletions ts/features/it-wallet/hooks/useItwDataProcessing.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ import { IOStackNavigationProp } from "../../../../../navigation/params/AppParam
import { ItwParamsList } from "../../../navigation/ItwParamsList";
import I18n from "../../../../../i18n";
import ItwBulletList from "../../../components/ItwBulletList";
import { useItwDataProcessing } from "../../../hooks/useItwDataProcessing";
import { CREDENTIAL_ISSUER, getRequestedClaims } from "../../../utils/mocks";
import { showCancelAlert } from "../../../utils/alert";
import ROUTES from "../../../../../navigation/routes";
import { ITW_ROUTES } from "../../../navigation/ItwRoutes";
import ItwKoView from "../../../components/ItwKoView";
import { getItwGenericMappedError } from "../../../utils/errors/itwErrorsMapping";
import ItwTextInfo from "../../../components/ItwTextInfo";
import { useItwInfoBottomSheet } from "../../../hooks/useItwInfoBottomSheet";

/**
* This screen displays the information about the credential that is going to be shared
Expand All @@ -41,8 +41,30 @@ import ItwTextInfo from "../../../components/ItwTextInfo";
const ItwCredentialAuthScreen = () => {
const decodedPid = useIOSelector(itwDecodedPidValueSelector);
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const { present, bottomSheet } = useItwDataProcessing();
const toast = useIOToast();
const { present, bottomSheet } = useItwInfoBottomSheet({
title: I18n.t(
"features.itWallet.issuing.credentialsIssuingInfoScreen.infoBottomSheet.title"
),
content: [
{
title: I18n.t(
"features.itWallet.issuing.credentialsIssuingInfoScreen.infoBottomSheet.body.firstHeaderTitle"
),
body: I18n.t(
"features.itWallet.issuing.credentialsIssuingInfoScreen.infoBottomSheet.body.firstBodyContent"
)
},
{
title: I18n.t(
"features.itWallet.issuing.credentialsIssuingInfoScreen.infoBottomSheet.body.secondHeaderTitle"
),
body: I18n.t(
"features.itWallet.issuing.credentialsIssuingInfoScreen.infoBottomSheet.body.secondBodyContent"
)
}
]
});

/**
* Callback to be used in case of cancel button press alert to navigate to the home screen and show a toast.
Expand Down

0 comments on commit 3473d6d

Please sign in to comment.