@procivis/one-react-native-components 0.3.115 → 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 (77) hide show
  1. package/lib/commonjs/components/history/history-list-item-icon.js +2 -1
  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/header/header.js +2 -0
  10. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  11. package/lib/commonjs/ui-components/icons/contact.js +45 -0
  12. package/lib/commonjs/ui-components/icons/contact.js.map +1 -0
  13. package/lib/commonjs/ui-components/icons/index.js +11 -0
  14. package/lib/commonjs/ui-components/icons/index.js.map +1 -1
  15. package/lib/commonjs/ui-components/screens/index.js +7 -0
  16. package/lib/commonjs/ui-components/screens/index.js.map +1 -1
  17. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +45 -15
  18. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  19. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js +384 -0
  20. package/lib/commonjs/ui-components/screens/trust-info-details-screen.js.map +1 -0
  21. package/lib/commonjs/utils/hooks/core/cache.js +2 -1
  22. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  23. package/lib/commonjs/utils/hooks/core/credentials.js +26 -1
  24. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  25. package/lib/commonjs/utils/hooks/core/proofs.js +12 -1
  26. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  27. package/lib/module/components/history/history-list-item-icon.js +2 -1
  28. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  29. package/lib/module/components/index.js +1 -0
  30. package/lib/module/components/index.js.map +1 -1
  31. package/lib/module/components/trust-info/index.js +4 -0
  32. package/lib/module/components/trust-info/index.js.map +1 -0
  33. package/lib/module/components/trust-info/trust-info.js +70 -0
  34. package/lib/module/components/trust-info/trust-info.js.map +1 -0
  35. package/lib/module/ui-components/header/header.js +2 -0
  36. package/lib/module/ui-components/header/header.js.map +1 -1
  37. package/lib/module/ui-components/icons/contact.js +34 -0
  38. package/lib/module/ui-components/icons/contact.js.map +1 -0
  39. package/lib/module/ui-components/icons/index.js +1 -0
  40. package/lib/module/ui-components/icons/index.js.map +1 -1
  41. package/lib/module/ui-components/screens/index.js +2 -0
  42. package/lib/module/ui-components/screens/index.js.map +1 -1
  43. package/lib/module/ui-components/screens/nerd-mode-screen.js +46 -16
  44. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  45. package/lib/module/ui-components/screens/trust-info-details-screen.js +375 -0
  46. package/lib/module/ui-components/screens/trust-info-details-screen.js.map +1 -0
  47. package/lib/module/utils/hooks/core/cache.js +2 -1
  48. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  49. package/lib/module/utils/hooks/core/credentials.js +24 -1
  50. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  51. package/lib/module/utils/hooks/core/proofs.js +10 -0
  52. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  53. package/lib/typescript/components/index.d.ts +1 -0
  54. package/lib/typescript/components/trust-info/index.d.ts +3 -0
  55. package/lib/typescript/components/trust-info/trust-info.d.ts +19 -0
  56. package/lib/typescript/ui-components/header/header.d.ts +2 -0
  57. package/lib/typescript/ui-components/icons/contact.d.ts +4 -0
  58. package/lib/typescript/ui-components/icons/index.d.ts +1 -0
  59. package/lib/typescript/ui-components/screens/index.d.ts +3 -0
  60. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +6 -1
  61. package/lib/typescript/ui-components/screens/trust-info-details-screen.d.ts +32 -0
  62. package/lib/typescript/utils/hooks/core/credentials.d.ts +3 -0
  63. package/lib/typescript/utils/hooks/core/proofs.d.ts +2 -0
  64. package/package.json +8 -8
  65. package/src/components/history/history-list-item-icon.tsx +1 -0
  66. package/src/components/index.ts +1 -0
  67. package/src/components/trust-info/index.ts +4 -0
  68. package/src/components/trust-info/trust-info.tsx +90 -0
  69. package/src/ui-components/header/header.tsx +9 -3
  70. package/src/ui-components/icons/contact.tsx +26 -0
  71. package/src/ui-components/icons/index.ts +1 -0
  72. package/src/ui-components/screens/index.ts +3 -0
  73. package/src/ui-components/screens/nerd-mode-screen.tsx +80 -22
  74. package/src/ui-components/screens/trust-info-details-screen.tsx +472 -0
  75. package/src/utils/hooks/core/cache.ts +2 -1
  76. package/src/utils/hooks/core/credentials.ts +30 -1
  77. package/src/utils/hooks/core/proofs.ts +14 -0
@@ -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 (