@procivis/one-react-native-components 0.3.112 → 0.3.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/lib/commonjs/components/history/history-list-item-icon.js +6 -2
  2. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  3. package/lib/commonjs/components/index.js +11 -0
  4. package/lib/commonjs/components/index.js.map +1 -1
  5. package/lib/commonjs/components/trust-info/index.js +29 -0
  6. package/lib/commonjs/components/trust-info/index.js.map +1 -0
  7. package/lib/commonjs/components/trust-info/trust-info.js +79 -0
  8. package/lib/commonjs/components/trust-info/trust-info.js.map +1 -0
  9. package/lib/commonjs/ui-components/control/checkbox.js +1 -0
  10. package/lib/commonjs/ui-components/control/checkbox.js.map +1 -1
  11. package/lib/commonjs/ui-components/header/header.js +2 -0
  12. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  13. package/lib/commonjs/ui-components/icons/contact.js +45 -0
  14. package/lib/commonjs/ui-components/icons/contact.js.map +1 -0
  15. package/lib/commonjs/ui-components/icons/index.js +11 -0
  16. package/lib/commonjs/ui-components/icons/index.js.map +1 -1
  17. package/lib/commonjs/ui-components/screens/index.js +7 -0
  18. package/lib/commonjs/ui-components/screens/index.js.map +1 -1
  19. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +45 -15
  20. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  21. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js +384 -0
  22. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js.map +1 -0
  23. package/lib/commonjs/utils/hooks/core/cache.js +2 -1
  24. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  25. package/lib/commonjs/utils/hooks/core/core-init.js +4 -2
  26. package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
  27. package/lib/commonjs/utils/hooks/core/credentials.js +26 -1
  28. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  29. package/lib/commonjs/utils/hooks/core/index.js +11 -0
  30. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  31. package/lib/commonjs/utils/hooks/core/proofs.js +12 -1
  32. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  33. package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
  34. package/lib/commonjs/utils/hooks/core/verifier-instance.js +52 -0
  35. package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -0
  36. package/lib/commonjs/utils/hooks/core/wallet-unit.js +9 -2
  37. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  38. package/lib/commonjs/utils/parsers/query.js +2 -2
  39. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  40. package/lib/module/components/history/history-list-item-icon.js +6 -2
  41. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  42. package/lib/module/components/index.js +1 -0
  43. package/lib/module/components/index.js.map +1 -1
  44. package/lib/module/components/trust-info/index.js +4 -0
  45. package/lib/module/components/trust-info/index.js.map +1 -0
  46. package/lib/module/components/trust-info/trust-info.js +70 -0
  47. package/lib/module/components/trust-info/trust-info.js.map +1 -0
  48. package/lib/module/ui-components/control/checkbox.js +1 -0
  49. package/lib/module/ui-components/control/checkbox.js.map +1 -1
  50. package/lib/module/ui-components/header/header.js +2 -0
  51. package/lib/module/ui-components/header/header.js.map +1 -1
  52. package/lib/module/ui-components/icons/contact.js +34 -0
  53. package/lib/module/ui-components/icons/contact.js.map +1 -0
  54. package/lib/module/ui-components/icons/index.js +1 -0
  55. package/lib/module/ui-components/icons/index.js.map +1 -1
  56. package/lib/module/ui-components/screens/index.js +2 -0
  57. package/lib/module/ui-components/screens/index.js.map +1 -1
  58. package/lib/module/ui-components/screens/nerd-mode-screen.js +46 -16
  59. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  60. package/lib/module/ui-components/screens/trust-info-details-screen.js +375 -0
  61. package/lib/module/ui-components/screens/trust-info-details-screen.js.map +1 -0
  62. package/lib/module/utils/hooks/core/cache.js +2 -1
  63. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  64. package/lib/module/utils/hooks/core/core-init.js +4 -2
  65. package/lib/module/utils/hooks/core/core-init.js.map +1 -1
  66. package/lib/module/utils/hooks/core/credentials.js +24 -1
  67. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  68. package/lib/module/utils/hooks/core/index.js +1 -0
  69. package/lib/module/utils/hooks/core/index.js.map +1 -1
  70. package/lib/module/utils/hooks/core/proofs.js +10 -0
  71. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  72. package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
  73. package/lib/module/utils/hooks/core/verifier-instance.js +43 -0
  74. package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -0
  75. package/lib/module/utils/hooks/core/wallet-unit.js +9 -2
  76. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  77. package/lib/module/utils/parsers/query.js +2 -2
  78. package/lib/module/utils/parsers/query.js.map +1 -1
  79. package/lib/typescript/components/index.d.ts +1 -0
  80. package/lib/typescript/components/trust-info/index.d.ts +3 -0
  81. package/lib/typescript/components/trust-info/trust-info.d.ts +19 -0
  82. package/lib/typescript/ui-components/header/header.d.ts +2 -0
  83. package/lib/typescript/ui-components/icons/contact.d.ts +4 -0
  84. package/lib/typescript/ui-components/icons/index.d.ts +1 -0
  85. package/lib/typescript/ui-components/screens/index.d.ts +3 -0
  86. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +6 -1
  87. package/lib/typescript/ui-components/screens/trust-info-details-screen.d.ts +32 -0
  88. package/lib/typescript/utils/hooks/core/core-init.d.ts +1 -1
  89. package/lib/typescript/utils/hooks/core/credentials.d.ts +5 -9
  90. package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
  91. package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -0
  92. package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +8 -0
  93. package/lib/typescript/utils/parsers/query.d.ts +1 -1
  94. package/package.json +8 -8
  95. package/src/components/history/history-list-item-icon.tsx +4 -0
  96. package/src/components/index.ts +1 -0
  97. package/src/components/trust-info/index.ts +4 -0
  98. package/src/components/trust-info/trust-info.tsx +90 -0
  99. package/src/ui-components/control/checkbox.tsx +1 -1
  100. package/src/ui-components/header/header.tsx +9 -3
  101. package/src/ui-components/icons/contact.tsx +26 -0
  102. package/src/ui-components/icons/index.ts +1 -0
  103. package/src/ui-components/screens/index.ts +3 -0
  104. package/src/ui-components/screens/nerd-mode-screen.tsx +80 -22
  105. package/src/ui-components/screens/trust-info-details-screen.tsx +472 -0
  106. package/src/utils/hooks/core/cache.ts +2 -1
  107. package/src/utils/hooks/core/core-init.ts +3 -4
  108. package/src/utils/hooks/core/credentials.ts +32 -11
  109. package/src/utils/hooks/core/index.ts +1 -0
  110. package/src/utils/hooks/core/proofs.ts +14 -0
  111. package/src/utils/hooks/core/trust-list.ts +1 -1
  112. package/src/utils/hooks/core/verifier-instance.ts +54 -0
  113. package/src/utils/hooks/core/wallet-unit.ts +9 -2
  114. package/src/utils/parsers/query.ts +8 -0
@@ -5,4 +5,4 @@ export declare const getQueryKeyFromCredentialSchemaListQueryParams: (queryParam
5
5
  export declare const getQueryKeyFromProofSchemaListQueryParams: (queryParams?: Partial<ProofSchemaListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ProofSchemaListQueryExactColumn[] | undefined)[];
6
6
  export declare const getQueryKeyFromProofListQueryParams: (queryParams?: Partial<ProofListQuery>) => (string | number | string[] | import("@procivis/react-native-one-core").ProofListQueryExactColumn[] | import("@procivis/react-native-one-core").ProofState[] | import("@procivis/react-native-one-core").ProofRole[] | undefined)[];
7
7
  export declare const getQueryKeyFromDidListQueryParams: (queryParams?: Partial<DidListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").DidListQueryExactColumn[] | import("@procivis/react-native-one-core").KeyRole[] | undefined)[];
8
- export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<IdentifierListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").KeyRole[] | import("@procivis/react-native-one-core").IdentifierListQueryExactColumn[] | import("@procivis/react-native-one-core").IdentifierState[] | import("@procivis/react-native-one-core").IdentifierType[] | undefined)[];
8
+ export declare const getQueryKeyFromIdentifierListQueryParams: (queryParams?: Partial<IdentifierListQuery>) => (string | number | boolean | string[] | import("@procivis/react-native-one-core").KeyRole[] | import("@procivis/react-native-one-core").IdentifierListQueryExactColumn[] | import("@procivis/react-native-one-core").IdentifierState[] | import("@procivis/react-native-one-core").IdentifierType[] | import("@procivis/react-native-one-core").CertificateRole[] | undefined)[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procivis/one-react-native-components",
3
- "version": "0.3.112",
3
+ "version": "0.3.121",
4
4
  "author": "Procivis AG (https://procivis.ch)",
5
5
  "license": "Apache-2.0",
6
6
  "description": "Common Procivis ONE UI components for react-native",
@@ -53,7 +53,7 @@
53
53
  "@babel/runtime": "^7.25.0",
54
54
  "@commitlint/config-conventional": "^11.0.0",
55
55
  "@gorhom/bottom-sheet": "^5.1.2",
56
- "@procivis/react-native-one-core": "1.95657.0",
56
+ "@procivis/react-native-one-core": "1.100642.0",
57
57
  "@procivis/react-native-picker": "5.0.3",
58
58
  "@react-native-async-storage/async-storage": "^1.17.3",
59
59
  "@react-native-community/blur": "^4.4.0",
@@ -93,7 +93,7 @@
93
93
  "@types/react": "^18.2.6",
94
94
  "@typescript-eslint/eslint-plugin": "^5.17.0",
95
95
  "@typescript-eslint/parser": "^5.17.0",
96
- "apisauce": "3.2.0",
96
+ "apisauce": "3.2.2",
97
97
  "babel-jest": "^29.6.3",
98
98
  "babel-loader": "^8.2.4",
99
99
  "babel-plugin-react-native-web": "^0.19.13",
@@ -107,7 +107,7 @@
107
107
  "eslint-plugin-simple-import-sort": "^8.0.0",
108
108
  "husky": "^6.0.0",
109
109
  "jest": "^29.6.3",
110
- "lodash": "^4.17.21",
110
+ "lodash": "^4.18.0",
111
111
  "lottie-react-native": "^7.2.2",
112
112
  "metro-react-native-babel-preset": "0.73.10",
113
113
  "moment": "^2.29.4",
@@ -139,18 +139,18 @@
139
139
  "storybook": "^8.6.7",
140
140
  "timeago.js": "^4.0.2",
141
141
  "typescript": "5.0.4",
142
- "vite": "^6.2.2"
142
+ "vite": "^6.4.2"
143
143
  },
144
144
  "peerDependencies": {
145
- "@procivis/react-native-one-core": "^1.95657.0",
145
+ "@procivis/react-native-one-core": "^1.100642.0",
146
146
  "@procivis/react-native-picker": "*",
147
147
  "@react-native-community/blur": "*",
148
148
  "@react-native-community/netinfo": "^11.4.1",
149
149
  "@react-native/normalize-color": "*",
150
150
  "@react-navigation/native": "*",
151
151
  "@sentry/react-native": "^5.24.1",
152
- "apisauce": "3.2.0",
153
- "lodash": "^4.17.21",
152
+ "apisauce": "3.2.2",
153
+ "lodash": "^4.18.0",
154
154
  "lottie-react-native": "^7.2.2",
155
155
  "moment": "^2.29.4",
156
156
  "parse-url": "^9.2.0",
@@ -58,6 +58,9 @@ const defaultIcons: {
58
58
  INTERACTION_ERRORED: HistoryStatusErrorIcon,
59
59
  INTERACTION_EXPIRED: HistoryStatusErrorIcon,
60
60
  DELIVERED: HistoryStatusAcceptedIcon,
61
+ WRP_AC_RECEIVED: HistoryStatusAcceptedIcon,
62
+ WRP_RC_RECEIVED: HistoryStatusAcceptedIcon,
63
+ WRP_NR_RECEIVED: HistoryStatusAcceptedIcon,
61
64
  },
62
65
  entityTypes: {
63
66
  BACKUP: HistoryRevokeIcon,
@@ -87,6 +90,7 @@ const defaultIcons: {
87
90
  TRUST_LIST_PUBLICATION: HistoryTrustAnchorIcon,
88
91
  TRUST_COLLECTION: HistoryTrustAnchorIcon,
89
92
  TRUST_LIST_SUBSCRIPTION: HistoryTrustAnchorIcon,
93
+ VERIFIER_INSTANCE: HistoryTrustedEntityIcon,
90
94
  },
91
95
  };
92
96
 
@@ -4,3 +4,4 @@ export * from './entity';
4
4
  export * from './history';
5
5
  export * from './navigation';
6
6
  export * from './proof-request';
7
+ export * from './trust-info';
@@ -0,0 +1,4 @@
1
+ import TrustInfo from './trust-info';
2
+
3
+ export * from './trust-info';
4
+ export { TrustInfo };
@@ -0,0 +1,90 @@
1
+ import React, { FC, useMemo } from 'react';
2
+ import { StyleProp, StyleSheet, ViewStyle } from 'react-native';
3
+
4
+ import { AvatarProps, TouchableOpacity } from '../../ui-components';
5
+ import EntityCluster from '../../ui-components/entity/entity-cluster';
6
+ import { EntityNotTrustedIcon, EntityTrustedIcon, UpIcon } from '../../ui-components/icons';
7
+ import { concatTestID } from '../../utils';
8
+
9
+ export type TrustInfoLabels = {
10
+ unknown: string;
11
+ unknownSubline: string;
12
+ };
13
+
14
+ export type TrustInfoProps = {
15
+ labels: TrustInfoLabels;
16
+ onPress?: () => void;
17
+ style?: StyleProp<ViewStyle>;
18
+ sublineColor?: string;
19
+ testID?: string;
20
+ textColor?: string;
21
+ trustInformation?: {
22
+ name: string;
23
+ };
24
+ };
25
+
26
+ const TrustInfo: FC<TrustInfoProps> = ({
27
+ labels,
28
+ onPress,
29
+ style,
30
+ sublineColor,
31
+ testID,
32
+ textColor,
33
+ trustInformation,
34
+ }) => {
35
+ const avatarProps: AvatarProps | undefined = useMemo(() => {
36
+ const placeholderText = trustInformation?.name.substring(0, 1) ?? labels.unknown.substring(0, 1);
37
+
38
+ const statusIcon = trustInformation ? (
39
+ <EntityTrustedIcon testID={concatTestID(testID, 'statusIcon', 'trusted')} />
40
+ ) : (
41
+ <EntityNotTrustedIcon testID={concatTestID(testID, 'statusIcon', 'notTrusted')} />
42
+ );
43
+
44
+ return {
45
+ placeholderText,
46
+ statusIcon,
47
+ };
48
+ }, [labels, testID, trustInformation]);
49
+
50
+ const trustEntityName = useMemo(() => trustInformation?.name ?? labels.unknown, [labels.unknown, trustInformation]);
51
+
52
+ return (
53
+ <TouchableOpacity disabled={!onPress || !trustInformation} onPress={onPress} style={[styles.button, style]}>
54
+ <EntityCluster
55
+ avatar={avatarProps}
56
+ entityName={trustEntityName}
57
+ style={styles.cluster}
58
+ subline={trustInformation ? undefined : labels.unknownSubline}
59
+ sublineColor={sublineColor}
60
+ testID={testID}
61
+ textColor={textColor}
62
+ />
63
+ {onPress && trustInformation && <UpIcon color={textColor} style={styles.chevron} />}
64
+ </TouchableOpacity>
65
+ );
66
+ };
67
+
68
+ const styles = StyleSheet.create({
69
+ button: {
70
+ alignItems: 'center',
71
+ flexDirection: 'row',
72
+ flexWrap: 'nowrap',
73
+ width: '100%',
74
+ },
75
+ chevron: {
76
+ marginLeft: 10,
77
+ marginRight: 18,
78
+ transform: [
79
+ {
80
+ rotate: '90deg',
81
+ },
82
+ ],
83
+ },
84
+ cluster: {
85
+ flex: 1,
86
+ flexShrink: 1,
87
+ },
88
+ });
89
+
90
+ export default TrustInfo;
@@ -24,7 +24,7 @@ export const Checkbox: FC<CheckboxProps> = ({ style, text, value, disabled, onVa
24
24
  <TouchableOpacity
25
25
  activeOpacity={0.8}
26
26
  accessibilityRole="checkbox"
27
- accessibilityState={{ disabled }}
27
+ accessibilityState={{ checked: value, disabled }}
28
28
  accessibilityValue={
29
29
  disabled ? undefined : { text: t(value ? 'accessibility.control.checked' : 'accessibility.control.unchecked') }
30
30
  }
@@ -2,11 +2,12 @@ import React, { FC, ReactNode } from 'react';
2
2
  import { Insets, StyleProp, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';
3
3
 
4
4
  import { concatTestID } from '../../utils';
5
- import { BackButton } from '../buttons';
5
+ import { BackButton, BackButtonIcon } from '../buttons';
6
6
  import { Typography } from '../text';
7
7
  import { useAppColorScheme } from '../theme';
8
8
 
9
9
  export interface HeaderProps extends ViewProps {
10
+ backIcon?: BackButtonIcon;
10
11
  onBack?: () => void;
11
12
  rightButtons?: ReactNode[];
12
13
  style?: StyleProp<ViewStyle>;
@@ -22,14 +23,19 @@ const backButtonHitSlop: Insets = { top: 12, bottom: 12, left: 20, right: 20 };
22
23
  * Following the design: https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=425-18624
23
24
  * states (Default + Dashboard)
24
25
  */
25
- const Header: FC<HeaderProps> = ({ onBack, rightButtons, style, titleRowStyle, testID, title, ...viewProps }) => {
26
+ const Header: FC<HeaderProps> = ({ backIcon, onBack, rightButtons, style, titleRowStyle, testID, title, ...viewProps }) => {
26
27
  const colorScheme = useAppColorScheme();
27
28
 
28
29
  return (
29
30
  <View style={[styles.container, style]} testID={testID} {...viewProps}>
30
31
  {onBack && (
31
32
  <View style={styles.backButtonRow}>
32
- <BackButton hitSlop={backButtonHitSlop} onPress={onBack} testID={concatTestID(testID, 'back')} />
33
+ <BackButton
34
+ hitSlop={backButtonHitSlop}
35
+ icon={backIcon}
36
+ onPress={onBack}
37
+ testID={concatTestID(testID, 'back')}
38
+ />
33
39
  <View />
34
40
  {rightButtons}
35
41
  </View>
@@ -0,0 +1,26 @@
1
+ import React, { FC } from 'react';
2
+ import Svg, { Path,SvgProps } from 'react-native-svg';
3
+
4
+ export const MailIcon: FC<SvgProps> = ({ color, ...props }) => {
5
+ return (
6
+ <Svg fill="none" height={12} viewBox="0 0 17 12" width={17} {...props}>
7
+ <Path
8
+ d="M8.244 6.651c-.223 0-.442-.093-.656-.28L.758.355C1.124.118 1.587 0 2.147 0H14.35c.56 0 1.02.118 1.38.355L8.9 6.371c-.21.187-.428.28-.656.28zM.178 10.678a2.155 2.155 0 01-.13-.438A3.038 3.038 0 010 9.666V2.119c0-.237.016-.44.048-.608.036-.169.075-.287.116-.356l5.072 4.471-5.058 5.052zm1.763 1.107c-.25 0-.474-.027-.67-.082a1.553 1.553 0 01-.478-.219l5.202-5.202.998.889c.2.173.406.305.615.396.21.087.422.13.636.13.214 0 .426-.043.636-.13.214-.09.421-.223.622-.396l.998-.889 5.202 5.202c-.127.091-.29.164-.485.22a2.42 2.42 0 01-.663.081H1.94zm14.376-1.107L11.26 5.626l5.072-4.47c.037.068.073.186.11.355.036.168.054.371.054.608v7.547c0 .219-.018.41-.055.574-.032.164-.073.31-.123.438z"
9
+ fill={color}
10
+ opacity={0.9}
11
+ />
12
+ </Svg>
13
+ );
14
+ };
15
+
16
+ export const PhoneIcon: FC<SvgProps> = ({ color, ...props }) => {
17
+ return (
18
+ <Svg fill="none" height={13} viewBox="0 0 13 13" width={13} {...props}>
19
+ <Path
20
+ d="M3.5 9.208c-.67-.665-1.27-1.36-1.798-2.085A11.126 11.126 0 01.458 4.956C.153 4.236 0 3.552 0 2.906c0-.43.073-.83.219-1.204.15-.374.367-.697.65-.97.2-.192.425-.36.676-.506C1.8.076 2.044 0 2.276 0a.69.69 0 01.486.198c.141.132.294.312.458.54l1.148 1.6c.128.182.217.346.267.492a1.3 1.3 0 01.075.424c0 .114-.016.22-.048.321-.032.1-.091.226-.178.376l-.642 1.1a20.5 20.5 0 01-.075.137.3.3 0 00-.028.124c0 .054.007.107.02.157.019.05.037.093.055.13.274.547.746 1.155 1.415 1.825.324.323.657.62.999.888.341.265.642.456.902.575.064.027.12.05.17.068a.732.732 0 00.302.007.93.93 0 00.157-.075l1.094-.602c.177-.096.319-.157.423-.184.11-.032.217-.048.322-.048.123 0 .241.023.355.068.119.041.283.135.492.28l1.668 1.197c.224.16.383.307.479.444.1.137.15.278.15.424 0 .187-.05.387-.15.601-.096.215-.27.463-.52.745a2.76 2.76 0 01-.964.69 3.086 3.086 0 01-1.257.254c-.648 0-1.333-.155-2.058-.465a11.295 11.295 0 01-2.188-1.265A17.799 17.799 0 013.5 9.208z"
21
+ fill={color}
22
+ opacity={0.9}
23
+ />
24
+ </Svg>
25
+ );
26
+ };
@@ -1,4 +1,5 @@
1
1
  export * from './connectivity';
2
+ export * from './contact';
2
3
  export * from './credential';
3
4
  export * from './entity';
4
5
  export * from './history';
@@ -10,6 +10,8 @@ import type { ScrollViewScreenProps } from './scroll-view-screen';
10
10
  import ScrollViewScreen from './scroll-view-screen';
11
11
  import type { SectionListScreenProps } from './section-list-screen';
12
12
  import SectionListScreen from './section-list-screen';
13
+ import type { TrustInfoDetailsScreenLabels, TrustInfoDetailsScreenProps } from './trust-info-details-screen';
14
+ import TrustInfoDetailsScreen from './trust-info-details-screen';
13
15
 
14
16
  export { BackupScreen, BackupScreenMode, BackupScreenProps };
15
17
  export { ImagePreviewScreen, ImagePreviewScreenProps };
@@ -17,3 +19,4 @@ export { NerdModeScreen, NerdModeScreenProps, NerdModeSection };
17
19
  export { QRCodeScannerScreen, QRCodeScannerScreenProps };
18
20
  export { ScrollViewScreen, ScrollViewScreenProps };
19
21
  export { SectionListScreen, SectionListScreenProps };
22
+ export { TrustInfoDetailsScreen, TrustInfoDetailsScreenLabels, TrustInfoDetailsScreenProps };
@@ -1,9 +1,10 @@
1
- import { IdentifierListItem } from '@procivis/react-native-one-core';
2
- import React, { FunctionComponent, useState } from 'react';
1
+ import { IdentifierListItem, TrustInformationDetail } from '@procivis/react-native-one-core';
2
+ import React, { FunctionComponent, useMemo, useState } from 'react';
3
3
  import { SectionList, StyleSheet, View } from 'react-native';
4
4
  import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native-reanimated';
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
6
 
7
+ import { TrustInfo, TrustInfoLabels } from '../../components';
7
8
  import EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';
8
9
  import ContrastingStatusBar from '../../utils/contrasting-status-bar';
9
10
  import { concatTestID } from '../../utils/testID';
@@ -37,8 +38,11 @@ interface SectionEntityCluster {
37
38
  identifier?: IdentifierListItem;
38
39
  subline?: string;
39
40
  entityLabels: EntityLabels;
41
+ legacyTrustManagementEnabled: boolean;
40
42
  role: ContextRole;
41
43
  testID?: string;
44
+ trustInfoLabels: TrustInfoLabels;
45
+ trustInformation?: TrustInformationDetail;
42
46
  }
43
47
 
44
48
  type SectionAttribute = Omit<NerdModeItemProps, 'labels' | 'onCopyToClipboard'>;
@@ -55,6 +59,7 @@ export type NerdModeScreenProps = {
55
59
  labels: AttributesLabels;
56
60
  onClose: () => void;
57
61
  onCopyToClipboard: (value: string) => void;
62
+ onOpenTrustInfoDetails?: (trustInformation: TrustInformationDetail) => void;
58
63
  sections: NerdModeSection[];
59
64
  testID: string;
60
65
  title: string;
@@ -76,6 +81,7 @@ const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
76
81
  labels,
77
82
  onClose,
78
83
  onCopyToClipboard,
84
+ onOpenTrustInfoDetails,
79
85
  entityCluster,
80
86
  testID,
81
87
  title,
@@ -105,6 +111,58 @@ const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
105
111
  };
106
112
  }, {} as Record<string, string>);
107
113
 
114
+ const listHeader = useMemo(() => {
115
+ if (!entityCluster) {
116
+ return null;
117
+ }
118
+ if (entityCluster.legacyTrustManagementEnabled) {
119
+ return (
120
+ <EntityDetailsWithButtons
121
+ {...entityCluster}
122
+ entityType={EntityType.ProofEntity}
123
+ entityLabels={entityCluster.entityLabels}
124
+ attributesLabels={labels}
125
+ style={[
126
+ styles.entityCluster,
127
+ {
128
+ backgroundColor: colorScheme.nerdView.background,
129
+ },
130
+ ]}
131
+ onCopyToClipboard={onCopyToClipboard}
132
+ testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}
133
+ textColor={colorScheme.white}
134
+ />
135
+ );
136
+ }
137
+ return (
138
+ <TrustInfo
139
+ labels={entityCluster.trustInfoLabels}
140
+ onPress={
141
+ onOpenTrustInfoDetails && entityCluster.trustInformation
142
+ ? () => onOpenTrustInfoDetails(entityCluster.trustInformation!)
143
+ : undefined
144
+ }
145
+ style={[
146
+ styles.entityCluster,
147
+ {
148
+ backgroundColor: colorScheme.nerdView.background,
149
+ },
150
+ ]}
151
+ testID={entityCluster.testID ?? concatTestID(testID, 'trustInfo')}
152
+ textColor={colorScheme.white}
153
+ trustInformation={entityCluster.trustInformation?.eudiEcosystem}
154
+ />
155
+ );
156
+ }, [
157
+ entityCluster,
158
+ colorScheme.nerdView.background,
159
+ colorScheme.white,
160
+ labels,
161
+ onCopyToClipboard,
162
+ onOpenTrustInfoDetails,
163
+ testID,
164
+ ]);
165
+
108
166
  return (
109
167
  <>
110
168
  <ContrastingStatusBar backgroundColor={colorScheme.nerdView.background} />
@@ -122,29 +180,11 @@ const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
122
180
  titleColor={colorScheme.white}
123
181
  />
124
182
  <AnimatedSectionList
125
- ListHeaderComponent={
126
- entityCluster ? (
127
- <EntityDetailsWithButtons
128
- {...entityCluster}
129
- entityType={EntityType.ProofEntity}
130
- entityLabels={entityCluster.entityLabels}
131
- attributesLabels={labels}
132
- style={[
133
- styles.entityCluster,
134
- {
135
- backgroundColor: colorScheme.nerdView.background,
136
- },
137
- ]}
138
- onCopyToClipboard={onCopyToClipboard}
139
- testID={entityCluster.testID ?? concatTestID(testID, 'entityCluster')}
140
- textColor={colorScheme.white}
141
- />
142
- ) : null
143
- }
183
+ ListHeaderComponent={listHeader}
144
184
  onScroll={onScroll}
145
185
  renderItem={({ item, section, index }) => {
146
186
  if (isSectionEntityCluster(item)) {
147
- return (
187
+ return item.legacyTrustManagementEnabled ? (
148
188
  <EntityDetailsWithButtons
149
189
  {...item}
150
190
  entityType={EntityType.CredentialEntity}
@@ -160,6 +200,24 @@ const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
160
200
  testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}
161
201
  textColor={colorScheme.white}
162
202
  />
203
+ ) : (
204
+ <TrustInfo
205
+ labels={item.trustInfoLabels}
206
+ onPress={
207
+ onOpenTrustInfoDetails && item.trustInformation
208
+ ? () => onOpenTrustInfoDetails(item.trustInformation!)
209
+ : undefined
210
+ }
211
+ style={[
212
+ styles.entityCluster,
213
+ {
214
+ backgroundColor: colorScheme.nerdView.background,
215
+ },
216
+ ]}
217
+ testID={item.testID ?? concatTestID(testID, 'trustInfo')}
218
+ textColor={colorScheme.white}
219
+ trustInformation={item.trustInformation?.eudiEcosystem}
220
+ />
163
221
  );
164
222
  } else {
165
223
  return (