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

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 (246) hide show
  1. package/lib/commonjs/components/credential/credential.js +2 -1
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/history/history-list-item-icon.js +3 -3
  4. package/lib/commonjs/components/history/history-list-item-icon.js.map +1 -1
  5. package/lib/commonjs/components/history/history-list-item.js +5 -12
  6. package/lib/commonjs/components/history/history-list-item.js.map +1 -1
  7. package/lib/commonjs/components/history/history-list-screen.js +1 -1
  8. package/lib/commonjs/components/history/history-list-screen.js.map +1 -1
  9. package/lib/commonjs/components/index.js +0 -11
  10. package/lib/commonjs/components/index.js.map +1 -1
  11. package/lib/commonjs/components/proof-request/v1/select-credential.js +2 -1
  12. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -1
  13. package/lib/commonjs/components/proof-request/v1/share-credential.js +2 -1
  14. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -1
  15. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +2 -1
  16. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -1
  17. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +3 -1
  18. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  19. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +7 -3
  20. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -1
  21. package/lib/commonjs/ui-components/credential/card/credential-details-card.js +3 -1
  22. package/lib/commonjs/ui-components/credential/card/credential-details-card.js.map +1 -1
  23. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  24. package/lib/commonjs/ui-components/header/header.js.map +1 -1
  25. package/lib/commonjs/ui-components/history/history-details.js +2 -2
  26. package/lib/commonjs/ui-components/history/history-details.js.map +1 -1
  27. package/lib/commonjs/ui-components/history/history-section-list-item.js +2 -2
  28. package/lib/commonjs/ui-components/history/history-section-list-item.js.map +1 -1
  29. package/lib/commonjs/ui-components/history/index.js +0 -8
  30. package/lib/commonjs/ui-components/history/index.js.map +1 -1
  31. package/lib/commonjs/ui-components/icons/contact.js.map +1 -1
  32. package/lib/commonjs/ui-components/icons/credential.js +3 -3
  33. package/lib/commonjs/ui-components/icons/credential.js.map +1 -1
  34. package/lib/commonjs/ui-components/icons/icons.js +20 -1
  35. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  36. package/lib/commonjs/ui-components/list/index.js +8 -0
  37. package/lib/commonjs/ui-components/list/index.js.map +1 -1
  38. package/lib/commonjs/ui-components/{history/history-item.js → list/list-item.js} +32 -22
  39. package/lib/commonjs/ui-components/list/list-item.js.map +1 -0
  40. package/lib/commonjs/ui-components/loader/loading-result.js +2 -0
  41. package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
  42. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js +7 -33
  43. package/lib/commonjs/ui-components/screens/nerd-mode-screen.js.map +1 -1
  44. package/lib/commonjs/utils/date.js +4 -5
  45. package/lib/commonjs/utils/date.js.map +1 -1
  46. package/lib/commonjs/utils/hooks/core/cache.js +7 -4
  47. package/lib/commonjs/utils/hooks/core/cache.js.map +1 -1
  48. package/lib/commonjs/utils/hooks/core/core-config.js +1 -6
  49. package/lib/commonjs/utils/hooks/core/core-config.js.map +1 -1
  50. package/lib/commonjs/utils/hooks/core/core-context.js +0 -15
  51. package/lib/commonjs/utils/hooks/core/core-context.js.map +1 -1
  52. package/lib/commonjs/utils/hooks/core/credentials.js +15 -1
  53. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  54. package/lib/commonjs/utils/hooks/core/index.js +0 -11
  55. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  56. package/lib/commonjs/utils/hooks/core/trust-list.js +19 -3
  57. package/lib/commonjs/utils/hooks/core/trust-list.js.map +1 -1
  58. package/lib/commonjs/utils/hooks/core/verifier-instance.js +22 -3
  59. package/lib/commonjs/utils/hooks/core/verifier-instance.js.map +1 -1
  60. package/lib/commonjs/utils/hooks/core/wallet-unit.js +2 -2
  61. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -1
  62. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +23 -18
  63. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -1
  64. package/lib/commonjs/utils/parsers/credential-sharing.js +20 -18
  65. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  66. package/lib/commonjs/utils/parsers/credential.js +36 -22
  67. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  68. package/lib/commonjs/utils/parsers/query.js +2 -2
  69. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  70. package/lib/commonjs/utils/translations.js +15 -0
  71. package/lib/commonjs/utils/translations.js.map +1 -0
  72. package/lib/module/components/credential/credential.js +2 -1
  73. package/lib/module/components/credential/credential.js.map +1 -1
  74. package/lib/module/components/history/history-list-item-icon.js +3 -3
  75. package/lib/module/components/history/history-list-item-icon.js.map +1 -1
  76. package/lib/module/components/history/history-list-item.js +7 -14
  77. package/lib/module/components/history/history-list-item.js.map +1 -1
  78. package/lib/module/components/history/history-list-screen.js +1 -1
  79. package/lib/module/components/history/history-list-screen.js.map +1 -1
  80. package/lib/module/components/index.js +0 -1
  81. package/lib/module/components/index.js.map +1 -1
  82. package/lib/module/components/proof-request/v1/select-credential.js +2 -1
  83. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -1
  84. package/lib/module/components/proof-request/v1/share-credential.js +2 -1
  85. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -1
  86. package/lib/module/components/proof-request/v2/select-credential-v2.js +2 -1
  87. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -1
  88. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +3 -1
  89. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -1
  90. package/lib/module/components/proof-request/v2/share-credential-v2.js +7 -3
  91. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -1
  92. package/lib/module/ui-components/credential/card/credential-details-card.js +3 -1
  93. package/lib/module/ui-components/credential/card/credential-details-card.js.map +1 -1
  94. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  95. package/lib/module/ui-components/header/header.js.map +1 -1
  96. package/lib/module/ui-components/history/history-details.js +3 -3
  97. package/lib/module/ui-components/history/history-details.js.map +1 -1
  98. package/lib/module/ui-components/history/history-section-list-item.js +2 -2
  99. package/lib/module/ui-components/history/history-section-list-item.js.map +1 -1
  100. package/lib/module/ui-components/history/index.js +0 -2
  101. package/lib/module/ui-components/history/index.js.map +1 -1
  102. package/lib/module/ui-components/icons/contact.js.map +1 -1
  103. package/lib/module/ui-components/icons/credential.js +1 -1
  104. package/lib/module/ui-components/icons/credential.js.map +1 -1
  105. package/lib/module/ui-components/icons/icons.js +18 -0
  106. package/lib/module/ui-components/icons/icons.js.map +1 -1
  107. package/lib/module/ui-components/list/index.js +2 -0
  108. package/lib/module/ui-components/list/index.js.map +1 -1
  109. package/lib/module/ui-components/{history/history-item.js → list/list-item.js} +32 -22
  110. package/lib/module/ui-components/list/list-item.js.map +1 -0
  111. package/lib/module/ui-components/loader/loading-result.js +2 -0
  112. package/lib/module/ui-components/loader/loading-result.js.map +1 -1
  113. package/lib/module/ui-components/screens/nerd-mode-screen.js +7 -33
  114. package/lib/module/ui-components/screens/nerd-mode-screen.js.map +1 -1
  115. package/lib/module/utils/date.js +4 -5
  116. package/lib/module/utils/date.js.map +1 -1
  117. package/lib/module/utils/hooks/core/cache.js +7 -4
  118. package/lib/module/utils/hooks/core/cache.js.map +1 -1
  119. package/lib/module/utils/hooks/core/core-config.js +0 -4
  120. package/lib/module/utils/hooks/core/core-config.js.map +1 -1
  121. package/lib/module/utils/hooks/core/core-context.js +0 -15
  122. package/lib/module/utils/hooks/core/core-context.js.map +1 -1
  123. package/lib/module/utils/hooks/core/credentials.js +13 -0
  124. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  125. package/lib/module/utils/hooks/core/index.js +0 -1
  126. package/lib/module/utils/hooks/core/index.js.map +1 -1
  127. package/lib/module/utils/hooks/core/trust-list.js +20 -4
  128. package/lib/module/utils/hooks/core/trust-list.js.map +1 -1
  129. package/lib/module/utils/hooks/core/verifier-instance.js +20 -2
  130. package/lib/module/utils/hooks/core/verifier-instance.js.map +1 -1
  131. package/lib/module/utils/hooks/core/wallet-unit.js +2 -2
  132. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -1
  133. package/lib/module/utils/parsers/credential-sharing-v2.js +24 -19
  134. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -1
  135. package/lib/module/utils/parsers/credential-sharing.js +20 -18
  136. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  137. package/lib/module/utils/parsers/credential.js +37 -23
  138. package/lib/module/utils/parsers/credential.js.map +1 -1
  139. package/lib/module/utils/parsers/query.js +2 -2
  140. package/lib/module/utils/parsers/query.js.map +1 -1
  141. package/lib/module/utils/translations.js +8 -0
  142. package/lib/module/utils/translations.js.map +1 -0
  143. package/lib/typescript/components/credential/credential.d.ts +1 -0
  144. package/lib/typescript/components/history/history-list-item.d.ts +1 -1
  145. package/lib/typescript/components/index.d.ts +0 -1
  146. package/lib/typescript/components/proof-request/v1/select-credential.d.ts +1 -0
  147. package/lib/typescript/components/proof-request/v1/share-credential.d.ts +1 -0
  148. package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +1 -0
  149. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +1 -0
  150. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +1 -0
  151. package/lib/typescript/ui-components/history/history-details.d.ts +2 -2
  152. package/lib/typescript/ui-components/history/history-section-list-item.d.ts +2 -2
  153. package/lib/typescript/ui-components/history/index.d.ts +0 -3
  154. package/lib/typescript/ui-components/icons/credential.d.ts +1 -1
  155. package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
  156. package/lib/typescript/ui-components/list/index.d.ts +3 -0
  157. package/lib/typescript/ui-components/{history/history-item.d.ts → list/list-item.d.ts} +4 -4
  158. package/lib/typescript/ui-components/screens/nerd-mode-screen.d.ts +0 -12
  159. package/lib/typescript/utils/hooks/core/core-config.d.ts +0 -1
  160. package/lib/typescript/utils/hooks/core/core-context.d.ts +0 -1
  161. package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -0
  162. package/lib/typescript/utils/hooks/core/index.d.ts +0 -1
  163. package/lib/typescript/utils/hooks/core/trust-list.d.ts +1 -4
  164. package/lib/typescript/utils/hooks/core/verifier-instance.d.ts +2 -0
  165. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +2 -2
  166. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +3 -3
  167. package/lib/typescript/utils/parsers/credential-sharing.d.ts +6 -6
  168. package/lib/typescript/utils/parsers/credential.d.ts +5 -5
  169. package/lib/typescript/utils/parsers/query.d.ts +2 -2
  170. package/lib/typescript/utils/translations.d.ts +1 -0
  171. package/package.json +3 -3
  172. package/src/components/credential/credential.tsx +3 -0
  173. package/src/components/history/history-list-item-icon.tsx +2 -2
  174. package/src/components/history/history-list-item.tsx +7 -12
  175. package/src/components/history/history-list-screen.tsx +1 -1
  176. package/src/components/index.ts +0 -1
  177. package/src/components/proof-request/v1/select-credential.tsx +3 -1
  178. package/src/components/proof-request/v1/share-credential.tsx +3 -0
  179. package/src/components/proof-request/v2/select-credential-v2.tsx +3 -1
  180. package/src/components/proof-request/v2/share-credential-v2-group.tsx +4 -0
  181. package/src/components/proof-request/v2/share-credential-v2.tsx +7 -0
  182. package/src/ui-components/credential/card/credential-details-card.tsx +3 -2
  183. package/src/ui-components/header/foldable-header.tsx +10 -9
  184. package/src/ui-components/header/header.tsx +10 -1
  185. package/src/ui-components/history/history-details.tsx +4 -4
  186. package/src/ui-components/history/history-section-list-item.tsx +3 -3
  187. package/src/ui-components/history/index.ts +0 -3
  188. package/src/ui-components/icons/contact.tsx +1 -1
  189. package/src/ui-components/icons/credential.tsx +1 -1
  190. package/src/ui-components/icons/icons.tsx +18 -0
  191. package/src/ui-components/list/index.ts +3 -0
  192. package/src/ui-components/{history/history-item.tsx → list/list-item.tsx} +36 -33
  193. package/src/ui-components/loader/loading-result.tsx +7 -1
  194. package/src/ui-components/screens/nerd-mode-screen.tsx +2 -52
  195. package/src/utils/date.ts +7 -14
  196. package/src/utils/hooks/core/cache.ts +10 -3
  197. package/src/utils/hooks/core/core-config.ts +1 -6
  198. package/src/utils/hooks/core/core-context.tsx +0 -24
  199. package/src/utils/hooks/core/credentials.ts +13 -0
  200. package/src/utils/hooks/core/index.ts +0 -1
  201. package/src/utils/hooks/core/trust-list.ts +22 -11
  202. package/src/utils/hooks/core/verifier-instance.ts +23 -2
  203. package/src/utils/hooks/core/wallet-unit.ts +3 -3
  204. package/src/utils/parsers/credential-sharing-v2.tsx +34 -14
  205. package/src/utils/parsers/credential-sharing.tsx +33 -16
  206. package/src/utils/parsers/credential.ts +45 -14
  207. package/src/utils/parsers/query.ts +5 -0
  208. package/src/utils/translations.ts +10 -0
  209. package/lib/commonjs/components/entity/EntityButtons.js +0 -64
  210. package/lib/commonjs/components/entity/EntityButtons.js.map +0 -1
  211. package/lib/commonjs/components/entity/entity-attributes.js +0 -65
  212. package/lib/commonjs/components/entity/entity-attributes.js.map +0 -1
  213. package/lib/commonjs/components/entity/entity-details-with-buttons.js +0 -67
  214. package/lib/commonjs/components/entity/entity-details-with-buttons.js.map +0 -1
  215. package/lib/commonjs/components/entity/entity-details.js +0 -101
  216. package/lib/commonjs/components/entity/entity-details.js.map +0 -1
  217. package/lib/commonjs/components/entity/index.js +0 -14
  218. package/lib/commonjs/components/entity/index.js.map +0 -1
  219. package/lib/commonjs/ui-components/history/history-item.js.map +0 -1
  220. package/lib/commonjs/utils/hooks/core/trust-entity.js +0 -147
  221. package/lib/commonjs/utils/hooks/core/trust-entity.js.map +0 -1
  222. package/lib/module/components/entity/EntityButtons.js +0 -56
  223. package/lib/module/components/entity/EntityButtons.js.map +0 -1
  224. package/lib/module/components/entity/entity-attributes.js +0 -57
  225. package/lib/module/components/entity/entity-attributes.js.map +0 -1
  226. package/lib/module/components/entity/entity-details-with-buttons.js +0 -58
  227. package/lib/module/components/entity/entity-details-with-buttons.js.map +0 -1
  228. package/lib/module/components/entity/entity-details.js +0 -92
  229. package/lib/module/components/entity/entity-details.js.map +0 -1
  230. package/lib/module/components/entity/index.js +0 -3
  231. package/lib/module/components/entity/index.js.map +0 -1
  232. package/lib/module/ui-components/history/history-item.js.map +0 -1
  233. package/lib/module/utils/hooks/core/trust-entity.js +0 -136
  234. package/lib/module/utils/hooks/core/trust-entity.js.map +0 -1
  235. package/lib/typescript/components/entity/EntityButtons.d.ts +0 -14
  236. package/lib/typescript/components/entity/entity-attributes.d.ts +0 -15
  237. package/lib/typescript/components/entity/entity-details-with-buttons.d.ts +0 -18
  238. package/lib/typescript/components/entity/entity-details.d.ts +0 -21
  239. package/lib/typescript/components/entity/index.d.ts +0 -3
  240. package/lib/typescript/utils/hooks/core/trust-entity.d.ts +0 -17
  241. package/src/components/entity/EntityButtons.tsx +0 -79
  242. package/src/components/entity/entity-attributes.tsx +0 -80
  243. package/src/components/entity/entity-details-with-buttons.tsx +0 -75
  244. package/src/components/entity/entity-details.tsx +0 -145
  245. package/src/components/entity/index.ts +0 -4
  246. package/src/utils/hooks/core/trust-entity.ts +0 -172
@@ -252,3 +252,21 @@ export const NFCIcon: FC<SvgProps> = ({ color, ...props }) => {
252
252
  </Svg>
253
253
  );
254
254
  };
255
+
256
+ // https://www.figma.com/file/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=542-90920
257
+ export const PurposeInfoIcon: FC<SvgProps> = () => {
258
+ const colorScheme = useAppColorScheme();
259
+ return (
260
+ <Svg fill="none" height={24} viewBox="0 0 24 24" width={24}>
261
+ <Path
262
+ d="M12.3609 10.7319C12.4714 10.7319 12.5609 10.8215 12.5609 10.9319V15.8C12.5609 15.9105 12.4714 16 12.3609 16H11.7C11.5895 16 11.5 15.9105 11.5 15.8V10.9319C11.5 10.8215 11.5895 10.7319 11.7 10.7319H12.3609ZM11.5 8.2C11.5 8.08954 11.5895 8 11.7 8L12.3609 8C12.4714 8 12.5609 8.08954 12.5609 8.2L12.5609 8.89863C12.5609 9.00909 12.4714 9.09863 12.3609 9.09863H11.7C11.5895 9.09863 11.5 9.00909 11.5 8.89863L11.5 8.2Z"
263
+ fill={colorScheme.text}
264
+ />
265
+ <Path
266
+ d="M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 20C16.4183 20 20 16.4183 20 12C20 7.58172 16.4183 4 12 4C7.58172 4 4 7.58172 4 12C4 16.4183 7.58172 20 12 20Z"
267
+ fill={colorScheme.text}
268
+ fillRule="evenodd"
269
+ />
270
+ </Svg>
271
+ );
272
+ };
@@ -1,8 +1,11 @@
1
+ import type { ListItemViewProps } from './list-item';
2
+ import ListItemView from './list-item';
1
3
  import type { ListSectionHeaderProps } from './list-section-header';
2
4
  import ListSectionHeader from './list-section-header';
3
5
  import type { ListTitleHeaderProps } from './list-title-header';
4
6
  import ListTitleHeader from './list-title-header';
5
7
 
8
+ export { ListItemView, ListItemViewProps };
6
9
  export { ListSectionHeader, ListSectionHeaderProps };
7
10
  export { ListTitleHeader, ListTitleHeaderProps };
8
11
  export * from './wallet';
@@ -6,7 +6,8 @@ import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers'
6
6
  import Typography from '../text/typography';
7
7
  import { useAppColorScheme } from '../theme/color-scheme-context';
8
8
 
9
- export type HistoryItemViewProps = {
9
+ export type ListItemViewProps = {
10
+ accessory?: string | ComponentType<any> | ReactElement;
10
11
  first?: boolean;
11
12
  icon: ComponentType<any> | ReactElement;
12
13
  info?: string;
@@ -15,22 +16,31 @@ export type HistoryItemViewProps = {
15
16
  onPress?: () => void;
16
17
  style?: StyleProp<ViewStyle>;
17
18
  testID?: string;
18
- time: string;
19
19
  };
20
20
 
21
- const HistoryItemView: FC<HistoryItemViewProps> = ({
22
- first,
23
- icon,
24
- label,
25
- info,
26
- last,
27
- style,
28
- time,
29
- onPress,
30
- testID,
31
- }) => {
21
+ const ListItemView: FC<ListItemViewProps> = ({ accessory, first, icon, label, info, last, style, onPress, testID }) => {
32
22
  const colorScheme = useAppColorScheme();
33
23
 
24
+ const accessoryView: ReactElement | undefined = useMemo(() => {
25
+ if (typeof accessory === 'string') {
26
+ return (
27
+ <Typography
28
+ color={colorScheme.text}
29
+ numberOfLines={1}
30
+ preset="xs/line-height-small"
31
+ style={styles.time}
32
+ testID={concatTestID(testID, 'timeLabel')}>
33
+ {accessory}
34
+ </Typography>
35
+ );
36
+ } else if (React.isValidElement(accessory)) {
37
+ return accessory;
38
+ } else if (accessory) {
39
+ const AccessoryComponent = accessory as ComponentType<any>;
40
+ return <AccessoryComponent />;
41
+ }
42
+ }, [accessory, colorScheme.text, testID]);
43
+
34
44
  const iconView: ReactElement | undefined = useMemo(() => {
35
45
  if (React.isValidElement(icon)) {
36
46
  return icon;
@@ -45,7 +55,7 @@ const HistoryItemView: FC<HistoryItemViewProps> = ({
45
55
  disabled={!onPress}
46
56
  onPress={() => onPress?.()}
47
57
  style={[
48
- styles.historyItemContainer,
58
+ styles.listItemContainer,
49
59
  {
50
60
  backgroundColor: colorScheme.white,
51
61
  },
@@ -56,7 +66,7 @@ const HistoryItemView: FC<HistoryItemViewProps> = ({
56
66
  testID={testID}>
57
67
  <View
58
68
  style={[
59
- styles.historyItemWrapper,
69
+ styles.listItemWrapper,
60
70
  {
61
71
  backgroundColor: colorScheme.white,
62
72
  borderColor: colorScheme.background,
@@ -84,14 +94,7 @@ const HistoryItemView: FC<HistoryItemViewProps> = ({
84
94
  </Typography>
85
95
  )}
86
96
  </View>
87
- <Typography
88
- color={colorScheme.text}
89
- numberOfLines={1}
90
- preset="xs/line-height-small"
91
- style={styles.time}
92
- testID={concatTestID(testID, 'timeLabel')}>
93
- {time}
94
- </Typography>
97
+ {accessoryView}
95
98
  </View>
96
99
  </TouchableOpacity>
97
100
  );
@@ -110,15 +113,6 @@ const styles = StyleSheet.create({
110
113
  marginBottom: 12,
111
114
  paddingBottom: 12,
112
115
  },
113
- historyItemContainer: {
114
- paddingHorizontal: 12,
115
- },
116
- historyItemWrapper: {
117
- alignItems: 'center',
118
- borderBottomWidth: 1,
119
- flexDirection: 'row',
120
- paddingVertical: 12,
121
- },
122
116
  label: {
123
117
  marginBottom: 2,
124
118
  },
@@ -126,6 +120,15 @@ const styles = StyleSheet.create({
126
120
  flex: 1,
127
121
  marginHorizontal: 12,
128
122
  },
123
+ listItemContainer: {
124
+ paddingHorizontal: 12,
125
+ },
126
+ listItemWrapper: {
127
+ alignItems: 'center',
128
+ borderBottomWidth: 1,
129
+ flexDirection: 'row',
130
+ paddingVertical: 12,
131
+ },
129
132
  shaded: {
130
133
  opacity: 0.7,
131
134
  },
@@ -138,4 +141,4 @@ const styles = StyleSheet.create({
138
141
  },
139
142
  });
140
143
 
141
- export default HistoryItemView;
144
+ export default ListItemView;
@@ -2,6 +2,7 @@ import React, { FC } from 'react';
2
2
  import { Platform, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';
3
3
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
4
4
 
5
+ import { concatTestID } from '../../utils';
5
6
  import { Button, ButtonProps } from '../buttons/button';
6
7
  import ShareButton, { ShareButtonProps } from '../buttons/share-button';
7
8
  import NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';
@@ -53,7 +54,12 @@ const LoadingResultScreen: FC<LoadingResultScreenProps> = ({
53
54
  </View>
54
55
  <View style={styles.loaderWrapper}>
55
56
  <LoaderView {...loaderProps} />
56
- <Typography align="center" color={colorScheme.text} preset="regular" style={styles.label}>
57
+ <Typography
58
+ testID={concatTestID(viewProps.testID, 'label')}
59
+ align="center"
60
+ color={colorScheme.text}
61
+ preset="regular"
62
+ style={styles.label}>
57
63
  {label}
58
64
  </Typography>
59
65
  </View>
@@ -5,7 +5,6 @@ import Animated, { useAnimatedScrollHandler, useSharedValue } from 'react-native
5
5
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
6
6
 
7
7
  import { TrustInfo, TrustInfoLabels } from '../../components';
8
- import EntityDetailsWithButtons, { ContextRole } from '../../components/entity/entity-details-with-buttons';
9
8
  import ContrastingStatusBar from '../../utils/contrasting-status-bar';
10
9
  import { concatTestID } from '../../utils/testID';
11
10
  import { TouchableOpacity } from '../accessibility/accessibilityHistoryWrappers';
@@ -16,15 +15,6 @@ import NerdModeItem, { NerdModeItemProps } from '../nerd-view/nerd-mode-item';
16
15
  import Typography from '../text/typography';
17
16
  import { useAppColorScheme } from '../theme/color-scheme-context';
18
17
 
19
- export interface EntityLabels {
20
- trusted: string;
21
- unknownIssuer: string;
22
- unknownVerifier: string;
23
- visitWebsite: string;
24
- termsAndServices: string;
25
- privacyPolicy: string;
26
- }
27
-
28
18
  export interface AttributesLabels {
29
19
  trustRegistry: string;
30
20
  issuerIdentifier: string;
@@ -37,9 +27,6 @@ export interface AttributesLabels {
37
27
  interface SectionEntityCluster {
38
28
  identifier?: IdentifierListItem;
39
29
  subline?: string;
40
- entityLabels: EntityLabels;
41
- legacyTrustManagementEnabled: boolean;
42
- role: ContextRole;
43
30
  testID?: string;
44
31
  trustInfoLabels: TrustInfoLabels;
45
32
  trustInformation?: TrustInformationDetail;
@@ -115,25 +102,6 @@ const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
115
102
  if (!entityCluster) {
116
103
  return null;
117
104
  }
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
105
  return (
138
106
  <TrustInfo
139
107
  labels={entityCluster.trustInfoLabels}
@@ -157,8 +125,6 @@ const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
157
125
  entityCluster,
158
126
  colorScheme.nerdView.background,
159
127
  colorScheme.white,
160
- labels,
161
- onCopyToClipboard,
162
128
  onOpenTrustInfoDetails,
163
129
  testID,
164
130
  ]);
@@ -182,25 +148,9 @@ const NerdModeScreen: FunctionComponent<NerdModeScreenProps> = ({
182
148
  <AnimatedSectionList
183
149
  ListHeaderComponent={listHeader}
184
150
  onScroll={onScroll}
185
- renderItem={({ item, section, index }) => {
151
+ renderItem={({ item, section }) => {
186
152
  if (isSectionEntityCluster(item)) {
187
- return item.legacyTrustManagementEnabled ? (
188
- <EntityDetailsWithButtons
189
- {...item}
190
- entityType={EntityType.CredentialEntity}
191
- entityLabels={item!.entityLabels}
192
- attributesLabels={labels}
193
- style={[
194
- styles.entityCluster,
195
- {
196
- backgroundColor: colorScheme.nerdView.background,
197
- },
198
- ]}
199
- onCopyToClipboard={onCopyToClipboard}
200
- testID={item.testID ?? concatTestID(testID, 'sectionEntityCluster', index.toString())}
201
- textColor={colorScheme.white}
202
- />
203
- ) : (
153
+ return (
204
154
  <TrustInfo
205
155
  labels={item.trustInfoLabels}
206
156
  onPress={
package/src/utils/date.ts CHANGED
@@ -7,10 +7,11 @@ const MINUTE = 60 * 1000;
7
7
  const DAY = 24 * 60 * MINUTE;
8
8
 
9
9
  // OS locale
10
- const systemLocale: string | undefined = I18nManager.getConstants()
11
- .localeIdentifier?.replace(/_/g, '-')
12
- .split(/[#@]/)[0]
13
- .replace(/-$/, '');
10
+ const systemLocale: string | undefined = (
11
+ Platform.OS === 'ios' ? Settings.get('AppleLocale') : I18nManager.getConstants().localeIdentifier
12
+ )
13
+ ?.match(/[a-zA-Z]+_[a-zA-Z]+/)[0]
14
+ ?.replaceAll('_', '-');
14
15
 
15
16
  /**
16
17
  * Date only format
@@ -136,18 +137,10 @@ export const formatDateOnlyFromUTCTimestamp = (utcTimestamp: number): string =>
136
137
  );
137
138
  };
138
139
 
139
- const locale = (
140
- Platform.OS === 'ios'
141
- ? Settings.get('AppleLocale')
142
- : I18nManager.getConstants().localeIdentifier
143
- )
144
- ?.split('@')[0]
145
- .replace('_', '-');
146
-
147
140
  export const formatDateTimeLocalized = (date: Date) => {
148
- return formatDateTime(date, locale);
141
+ return formatDateTime(date, systemLocale);
149
142
  };
150
143
 
151
144
  export const formatDateLocalized = (date: Date) => {
152
- return formatDate(date, locale);
145
+ return formatDate(date, systemLocale);
153
146
  };
@@ -3,10 +3,15 @@ import { useMutation, useQueryClient } from 'react-query';
3
3
 
4
4
  import { useONECore } from './core-context';
5
5
  import { CREDENTIAL_DETAIL_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_LIST_QUERY_KEY } from './credentials';
6
- import { REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY, TRUST_ENTITY_DETAIL_QUERY_KEY } from './trust-entity';
6
+ import { VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY } from './verifier-instance';
7
+ import { WALLET_UNIT_QUERY_KEY, WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY } from './wallet-unit';
7
8
 
8
9
  const CREDENTIAL_QUERY_KEYS = [CREDENTIAL_LIST_QUERY_KEY, CREDENTIAL_LIST_PAGED_QUERY_KEY, CREDENTIAL_DETAIL_QUERY_KEY];
9
- const TRUST_ENTITY_QUERY_KEYS = [TRUST_ENTITY_DETAIL_QUERY_KEY, REMOTE_TRUST_ENTITY_DETAIL_QUERY_KEY];
10
+ const WALLET_VERIFIER_INSTANCE_QUERY_KEYS = [
11
+ WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY,
12
+ WALLET_UNIT_QUERY_KEY,
13
+ VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY,
14
+ ];
10
15
 
11
16
  // Map each CacheType to the query keys that should be invalidated when that cache is cleared.
12
17
  const cacheTypeToQueryKeys: Record<CacheType, string[]> = {
@@ -15,11 +20,13 @@ const cacheTypeToQueryKeys: Record<CacheType, string[]> = {
15
20
  [CacheType.STATUS_LIST_CREDENTIAL]: CREDENTIAL_QUERY_KEYS,
16
21
  [CacheType.VCT_METADATA]: CREDENTIAL_QUERY_KEYS,
17
22
  [CacheType.JSON_SCHEMA]: CREDENTIAL_QUERY_KEYS,
18
- [CacheType.TRUST_LIST]: [...TRUST_ENTITY_QUERY_KEYS, ...CREDENTIAL_QUERY_KEYS],
23
+ [CacheType.TRUST_LIST]: CREDENTIAL_QUERY_KEYS,
19
24
  [CacheType.X509_CRL]: CREDENTIAL_QUERY_KEYS,
20
25
  [CacheType.ANDROID_ATTESTATION_CRL]: CREDENTIAL_QUERY_KEYS,
21
26
  [CacheType.OPEN_ID_METADATA_HOLDER]: CREDENTIAL_QUERY_KEYS,
22
27
  [CacheType.OPEN_ID_METADATA_ISSUER]: CREDENTIAL_QUERY_KEYS,
28
+ [CacheType.WALLET_PROVIDER_METADATA]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,
29
+ [CacheType.REMOTE_TRUST_COLLECTION]: WALLET_VERIFIER_INSTANCE_QUERY_KEYS,
23
30
  };
24
31
 
25
32
  export const useCacheClear = () => {
@@ -1,4 +1,4 @@
1
- import { ConfigEntities,CoreConfig } from '@procivis/react-native-one-core';
1
+ import { ConfigEntities, CoreConfig } from '@procivis/react-native-one-core';
2
2
  import { useQuery } from 'react-query';
3
3
 
4
4
  import { useONECore } from './core-context';
@@ -25,8 +25,3 @@ export const getEnabledExchangeProtocols = (exchangeProtocol: ConfigEntities<any
25
25
  .map((exchange) => exchange.type);
26
26
  };
27
27
 
28
- export const getEnabledTrustManagement = (config: CoreConfig): string[] => {
29
- return Object.values(config?.trustManagement ?? {})
30
- .filter((t) => t.enabled !== false)
31
- .map((trustManagement) => trustManagement.type);
32
- };
@@ -11,8 +11,6 @@ import React, {
11
11
  } from 'react';
12
12
 
13
13
  import { reportException } from '../../reporting';
14
- import { getEnabledTrustManagement } from './core-config';
15
- import { TrustManagementEnum, useCreateTrustAnchor } from './trust-entity';
16
14
 
17
15
  interface ContextValue {
18
16
  core: ONECore;
@@ -29,7 +27,6 @@ const defaultContextValue: ContextValue = {
29
27
  export type ONECoreContextProviderProps = {
30
28
  config?: Record<string, unknown>;
31
29
  organisationId?: string;
32
- publisherReference?: string;
33
30
  };
34
31
 
35
32
  const ONECoreContext = createContext<ContextValue>(defaultContextValue);
@@ -37,11 +34,9 @@ const ONECoreContext = createContext<ContextValue>(defaultContextValue);
37
34
  export const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProviderProps>> = ({
38
35
  children,
39
36
  organisationId = defaultContextValue.organisationId,
40
- publisherReference,
41
37
  config,
42
38
  }) => {
43
39
  const [core, setCore] = useState<ONECore>();
44
- const createTrustAnchor = useCreateTrustAnchor();
45
40
 
46
41
  const initialize = useCallback(
47
42
  async (force?: boolean) => {
@@ -76,25 +71,6 @@ export const ONECoreContextProvider: FC<PropsWithChildren<ONECoreContextProvider
76
71
  [],
77
72
  );
78
73
 
79
- useEffect(() => {
80
- if (!core || !publisherReference) {
81
- return;
82
- }
83
-
84
- core
85
- .getConfig()
86
- .then((coreConfig) => {
87
- const trustManagementEnabled = getEnabledTrustManagement(coreConfig).includes(
88
- TrustManagementEnum.SimpleTrustList,
89
- );
90
-
91
- if (trustManagementEnabled) {
92
- createTrustAnchor(core, publisherReference).catch(() => {});
93
- }
94
- })
95
- .catch(() => {});
96
- }, [core, createTrustAnchor, publisherReference]);
97
-
98
74
  const contextValue = useMemo(
99
75
  () => ({
100
76
  core: core ?? defaultContextValue.core,
@@ -170,6 +170,19 @@ export const useCredentialDelete = () => {
170
170
  });
171
171
  };
172
172
 
173
+ export const useCredentialRefresh = () => {
174
+ const queryClient = useQueryClient();
175
+ const { core } = useONECore();
176
+
177
+ return useMutation(async (interactionId: string) => core.holderRefreshCredential(interactionId), {
178
+ onSuccess: async () => {
179
+ await queryClient.invalidateQueries(CREDENTIAL_LIST_QUERY_KEY);
180
+ await queryClient.invalidateQueries(CREDENTIAL_DETAIL_QUERY_KEY);
181
+ await queryClient.invalidateQueries(HISTORY_LIST_QUERY_KEY);
182
+ },
183
+ });
184
+ };
185
+
173
186
  export const useInvalidateCredentialDetails = () => {
174
187
  const queryClient = useQueryClient();
175
188
 
@@ -11,7 +11,6 @@ export * from './identifiers';
11
11
  export * from './proof-schemas';
12
12
  export * from './proofs';
13
13
  export * from './query';
14
- export * from './trust-entity';
15
14
  export * from './trust-list';
16
15
  export * from './verifier-instance';
17
16
  export * from './wallet-unit';
@@ -1,29 +1,40 @@
1
- import { HolderWalletUnit } from '@procivis/react-native-one-core';
2
- import { useMutation } from 'react-query';
1
+ import { useMutation, useQueryClient } from 'react-query';
3
2
 
4
3
  import { reportException } from '../../reporting';
5
4
  import { useONECore } from './core-context';
5
+ import { VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY } from './verifier-instance';
6
+ import { WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY } from './wallet-unit';
6
7
 
7
8
  export const useTrustCollectionSync = () => {
9
+ const queryClient = useQueryClient();
8
10
  const { core } = useONECore();
9
11
 
10
- return useMutation(
11
- async (params: { holderWalletUnitId?: HolderWalletUnit['id']; verifierInstanceId?: string }) =>
12
- core.runTask('TRUST_COLLECTION_SYNC', JSON.stringify(params)),
13
- {
14
- onError: (err) => {
15
- reportException(err, 'TRUST_COLLECTION_SYNC error');
16
- },
12
+ return useMutation(async () => core.runTask('TRUST_COLLECTION_SYNC', undefined), {
13
+ onError: async (err) => {
14
+ reportException(err, 'TRUST_COLLECTION_SYNC error');
15
+ await queryClient.invalidateQueries(WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY);
16
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
17
17
  },
18
- );
18
+ onSuccess: async () => {
19
+ await queryClient.invalidateQueries(WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY);
20
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
21
+ },
22
+ });
19
23
  };
20
24
 
21
25
  export const useTrustListSubscriptionUpdate = () => {
26
+ const queryClient = useQueryClient();
22
27
  const { core } = useONECore();
23
28
 
24
29
  return useMutation(async () => core.runTask('TRUST_LIST_SUBSCRIPTION_UPDATE', undefined), {
25
- onError: (err) => {
30
+ onError: async (err) => {
26
31
  reportException(err, 'TRUST_LIST_SUBSCRIPTION_UPDATE error');
32
+ await queryClient.invalidateQueries(WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY);
33
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
34
+ },
35
+ onSuccess: async () => {
36
+ await queryClient.invalidateQueries(WALLET_UNIT_TRUST_COLLECTIONS_QUERY_KEY);
37
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
27
38
  },
28
39
  });
29
40
  };
@@ -4,8 +4,22 @@ import { useMutation, useQuery, useQueryClient } from 'react-query';
4
4
  import { reportException } from '../../reporting';
5
5
  import { useONECore } from './core-context';
6
6
 
7
+ export const VERIFIER_INSTANCE_QUERY_KEY = 'verifier-instance';
7
8
  export const VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY = 'verifier-instance-trust-collections';
8
9
 
10
+ export const useVerifierInstance = (active = true) => {
11
+ const { core, organisationId } = useONECore();
12
+
13
+ return useQuery(
14
+ [VERIFIER_INSTANCE_QUERY_KEY],
15
+ () => core.getOrganisation(organisationId).then((org) => org.verifierInstance),
16
+ {
17
+ enabled: active,
18
+ keepPreviousData: true,
19
+ },
20
+ );
21
+ };
22
+
9
23
  export const useVerifierInstanceTrustCollections = (verifierInstanceId: string | undefined, active = true) => {
10
24
  const { core } = useONECore();
11
25
 
@@ -31,7 +45,10 @@ export const useRegisterVerifierInstance = () => {
31
45
  }),
32
46
 
33
47
  {
34
- onSuccess: () => queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY),
48
+ onSuccess: async () => {
49
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_QUERY_KEY);
50
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
51
+ },
35
52
  },
36
53
  );
37
54
  };
@@ -46,9 +63,13 @@ export const useVerifierInstanceUpdate = () => {
46
63
  {
47
64
  onError: async (err) => {
48
65
  reportException(err, 'Update verifier instance failure');
66
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_QUERY_KEY);
67
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
68
+ },
69
+ onSuccess: async () => {
70
+ await queryClient.invalidateQueries(VERIFIER_INSTANCE_QUERY_KEY);
49
71
  await queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY);
50
72
  },
51
- onSuccess: () => queryClient.invalidateQueries(VERIFIER_INSTANCE_TRUST_COLLECTIONS_QUERY_KEY),
52
73
  },
53
74
  );
54
75
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
+ HolderRegisterWalletUnitRequest,
2
3
  HolderWalletUnit,
3
4
  HolderWalletUnitUpdateRequest,
4
- WalletProvider,
5
5
  WalletUnitStatus,
6
6
  } from '@procivis/react-native-one-core';
7
7
  import { useEffect } from 'react';
@@ -44,11 +44,11 @@ export const useRegisterWalletUnit = () => {
44
44
  const { core, organisationId } = useONECore();
45
45
 
46
46
  return useMutation(
47
- async (walletProvider: WalletProvider) =>
47
+ async (request: Omit<HolderRegisterWalletUnitRequest, 'organisationId' | 'keyType'>) =>
48
48
  core.holderRegisterWalletUnit({
49
49
  keyType: 'ECDSA',
50
50
  organisationId,
51
- walletProvider,
51
+ ...request,
52
52
  }),
53
53
 
54
54
  {