Skip to content

Commit

Permalink
chore(IT Wallet): [SIW-624] Add navigation to missing feature screen (#…
Browse files Browse the repository at this point in the history
…5228)

## Short description
This PR adds a navigation to the missing feature screen where a feature
is not implemented yet.

## List of changes proposed in this pull request
- Adds the navigation in
[ItwCredentialDetailsScreen.tsx](https://github.com/pagopa/io-app/pull/5228/files#diff-94e935f2d7d760954fd0c0647b59f32cd163d70dac988b5588a985aadef0689b)
when pressing the `Show QR Code` button and the banner;
- Adds the navigation in
[ItwPidDetails.tsx](https://github.com/pagopa/io-app/pull/5228/files#diff-94e935f2d7d760954fd0c0647b59f32cd163d70dac988b5588a985aadef0689b)
on the `Show QR Code` button and when tapping on the security level;
- Adds the navigation in
[ts/features/it-wallet/screens/issuing/ItwPidPreviewScreen.tsx](https://github.com/pagopa/io-app/pull/5228/files#diff-1efa65eedbb4bea4a8d61f1d909912fa8a94af60a4df438f01730c624c2c9fca)
when tapping on the security level.

## How to test
Check if the navigation happens properly in the aformentioned screens.
Also check if there's any other unresponsive pressable element in any
ITW related flow.
  • Loading branch information
LazyAfternoons committed Nov 16, 2023
1 parent c0d0ab9 commit 2a57491
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { RouteProp, useRoute } from "@react-navigation/native";
import { RouteProp, useNavigation, useRoute } from "@react-navigation/native";
import {
Banner,
BlockButtonProps,
Expand All @@ -8,7 +8,6 @@ import {
} from "@pagopa/io-app-design-system";
import { ScrollView } from "react-native-gesture-handler";
import { SafeAreaView, View } from "react-native";
import { constNull } from "fp-ts/lib/function";
import ItwCredentialCard from "../../components/ItwCredentialCard";
import { IOStyles } from "../../../../components/core/variables/IOStyles";
import BaseScreenComponent from "../../../../components/screens/BaseScreenComponent";
Expand All @@ -17,6 +16,8 @@ import { emptyContextualHelp } from "../../../../utils/emptyContextualHelp";
import { ItwParamsList } from "../../navigation/ItwParamsList";
import ItwCredentialClaimsList from "../../components/ItwCredentialClaimsList";
import { StoredCredential } from "../../store/reducers/itwCredentialsReducer";
import { IOStackNavigationProp } from "../../../../navigation/params/AppParamsList";
import { ITW_ROUTES } from "../../navigation/ItwRoutes";

export type ItwCredentialDetailsScreenNavigationParams = {
credential: StoredCredential;
Expand All @@ -32,6 +33,7 @@ type ItwCredentialDetailscreenRouteProps = RouteProp<
*/
const ItwCredentialDetailsScreen = () => {
const route = useRoute<ItwCredentialDetailscreenRouteProps>();
const navigation = useNavigation<IOStackNavigationProp<ItwParamsList>>();
const { credential } = route.params;
const bannerViewRef = React.createRef<View>();

Expand All @@ -49,7 +51,7 @@ const ItwCredentialDetailsScreen = () => {
accessibilityLabel: I18n.t(
"features.itWallet.presentation.credentialDetails.buttons.qrCode"
),
onPress: () => null
onPress: () => navigation.navigate(ITW_ROUTES.GENERIC.NOT_AVAILABLE)
}
};

Expand Down Expand Up @@ -79,7 +81,9 @@ const ItwCredentialDetailsScreen = () => {
action={I18n.t(
"features.itWallet.issuing.credentialPreviewScreen.banner.actionTitle"
)}
onPress={constNull}
onPress={() =>
navigation.navigate(ITW_ROUTES.GENERIC.NOT_AVAILABLE)
}
/>
<VSpacer size={32} />
</ScrollView>
Expand Down
7 changes: 5 additions & 2 deletions ts/features/it-wallet/screens/credential/ItwPidDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import ItwPidClaimsList from "../../components/ItwPidClaimsList";
import { BlockButtonProps } from "../../../../components/ui/BlockButtons";
import ItwCredentialCard from "../../components/ItwCredentialCard";
import { getPidDisplayData } from "../../utils/mocks";
import { ITW_ROUTES } from "../../navigation/ItwRoutes";

export type ContentViewParams = {
decodedPid: PidWithToken;
Expand All @@ -42,7 +43,7 @@ const ItwPidDetails = () => {
),
iconName: "qrCode",
iconColor: "white",
onPress: () => null
onPress: () => navigation.navigate(ITW_ROUTES.GENERIC.NOT_AVAILABLE)
};

const ContentView = ({ decodedPid }: ContentViewParams) => (
Expand All @@ -60,7 +61,9 @@ const ItwPidDetails = () => {
claims={["givenName", "familyName", "taxIdCode"]}
expiryDate
securityLevel
onLinkPress={() => null}
onLinkPress={() =>
navigation.navigate(ITW_ROUTES.GENERIC.NOT_AVAILABLE)
}
issuerInfo
/>
<VSpacer size={spacerSize} />
Expand Down
8 changes: 6 additions & 2 deletions ts/features/it-wallet/screens/issuing/ItwPidPreviewScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ const ItwPidPreviewScreen = () => {
claims={["givenName", "familyName", "taxIdCode"]}
expiryDate
securityLevel
onLinkPress={() => null}
onLinkPress={() =>
navigation.navigate(ITW_ROUTES.GENERIC.NOT_AVAILABLE)
}
issuerInfo
/>
<VSpacer />
Expand All @@ -124,7 +126,9 @@ const ItwPidPreviewScreen = () => {
label={I18n.t(
"features.itWallet.verifiableCredentials.unrecognizedData.cta"
)}
onPress={() => null}
onPress={() =>
navigation.navigate(ITW_ROUTES.GENERIC.NOT_AVAILABLE)
}
/>
<VSpacer />
</View>
Expand Down

0 comments on commit 2a57491

Please sign in to comment.