-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(IT Wallet): [SIW-214] Add PID to wallet (#4790)
## Short description This PR adds the PID credential to the wallet section, along with a detail screen. Most of the changes are tied to the PID and will be generalised in the future. ## List of changes proposed in this pull request - `locales/en/index.yml` & `locales/it/index.yml`: Adds locales; - `ts/features/it-wallet/components/ClaimsList.tsx`: Adds the issuer name to the claim list unrecognized data section; - `ts/features/it-wallet/navigation/ItwStackNavigator.tsx`: Adds the new details screen to the navigator; - `ts/features/it-wallet/navigation/params.ts`: Adds the new details screen params; - `ts/features/it-wallet/navigation/routes.ts`: Adds the new presentation routes; - `ts/features/it-wallet/screens/ItwCredentialDetails.tsx`: Adds the VC details screen (currently only for PID); - `ts/features/it-wallet/screens/ItwHomeScreen.tsx`: Adds the PID card to the wallet section; - `ts/features/it-wallet/store/reducers/itwCredentials.ts`: Adds a selector for VCs; ## How to test Complete a PID issuing flow and check if the card gets renders in the `Wallet` section. Then try to press it to navigate to the details screen. --------- Co-authored-by: Mario Perrotta <mario.perrotta@pagopa.it>
- Loading branch information
1 parent
ccb3f33
commit a418542
Showing
10 changed files
with
159 additions
and
20 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
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
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
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,63 @@ | ||
import React from "react"; | ||
import { View } from "native-base"; | ||
import { SafeAreaView, ScrollView } from "react-native"; | ||
import FooterWithButtons from "../../../components/ui/FooterWithButtons"; | ||
import I18n from "../../../i18n"; | ||
import BaseScreenComponent from "../../../components/screens/BaseScreenComponent"; | ||
import { emptyContextualHelp } from "../../../utils/emptyContextualHelp"; | ||
import { IOStyles } from "../../../components/core/variables/IOStyles"; | ||
import { VSpacer } from "../../../components/core/spacer/Spacer"; | ||
import PidCredential from "../components/PidCredential"; | ||
import ClaimsList from "../components/ClaimsList"; | ||
import { useIOSelector } from "../../../store/hooks"; | ||
import { ItwWalletVcsSelector } from "../store/reducers/itwCredentials"; | ||
|
||
/** | ||
* Renders a preview screen which displays a visual representation and the claims contained in the PID. | ||
* This screen should be generalized for any verifiable crediential but for now it's only used for the PID. | ||
*/ | ||
const ItwCredentialDetails = () => { | ||
const pid = useIOSelector(ItwWalletVcsSelector)[0]; | ||
const clamis = pid.verified_claims.claims; | ||
const spacerSize = 32; | ||
|
||
const presentationButton = { | ||
title: I18n.t( | ||
"features.itWallet.presentation.credentialDetails.buttons.qrCode" | ||
), | ||
iconName: "io-qr", | ||
iconColor: "white", | ||
onPress: () => null | ||
}; | ||
|
||
return ( | ||
<BaseScreenComponent | ||
goBack={true} | ||
headerTitle={I18n.t( | ||
"features.itWallet.verifiableCredentials.type.digitalCredential" | ||
)} | ||
contextualHelp={emptyContextualHelp} | ||
> | ||
<SafeAreaView style={{ ...IOStyles.flex }}> | ||
<ScrollView> | ||
<VSpacer /> | ||
<View style={IOStyles.horizontalContentPadding}> | ||
<PidCredential | ||
name={`${clamis.given_name} ${clamis.family_name}`} | ||
fiscalCode={clamis.tax_id_number} | ||
/> | ||
<VSpacer /> | ||
<ClaimsList claims={pid} /> | ||
<VSpacer size={spacerSize} /> | ||
</View> | ||
</ScrollView> | ||
<FooterWithButtons | ||
type={"SingleButton"} | ||
leftButton={presentationButton} | ||
/> | ||
</SafeAreaView> | ||
</BaseScreenComponent> | ||
); | ||
}; | ||
|
||
export default ItwCredentialDetails; |
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
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