@procivis/one-react-native-components 0.3.62 → 0.3.86

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 (303) hide show
  1. package/lib/commonjs/components/credential/credential.js +8 -2
  2. package/lib/commonjs/components/credential/credential.js.map +1 -1
  3. package/lib/commonjs/components/proof-request/index.js +23 -12
  4. package/lib/commonjs/components/proof-request/index.js.map +1 -1
  5. package/lib/commonjs/components/proof-request/select-share-credential-card-notice.js +37 -0
  6. package/lib/commonjs/components/proof-request/select-share-credential-card-notice.js.map +1 -0
  7. package/lib/commonjs/components/proof-request/share-credential-card-notice.js +36 -0
  8. package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -0
  9. package/lib/commonjs/components/proof-request/{group.js → v1/group.js} +1 -1
  10. package/lib/commonjs/components/proof-request/v1/group.js.map +1 -0
  11. package/lib/commonjs/components/proof-request/v1/index.js +39 -0
  12. package/lib/commonjs/components/proof-request/v1/index.js.map +1 -0
  13. package/lib/commonjs/components/proof-request/{select-credential.js → v1/select-credential.js} +12 -6
  14. package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -0
  15. package/lib/commonjs/components/proof-request/{share-credential.js → v1/share-credential.js} +33 -62
  16. package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -0
  17. package/lib/commonjs/components/proof-request/v2/index.js +39 -0
  18. package/lib/commonjs/components/proof-request/v2/index.js.map +1 -0
  19. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +55 -0
  20. package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -0
  21. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +164 -0
  22. package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -0
  23. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +135 -0
  24. package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -0
  25. package/lib/commonjs/ui-components/buttons/index.js +7 -0
  26. package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
  27. package/lib/commonjs/ui-components/buttons/share-button.js +54 -0
  28. package/lib/commonjs/ui-components/buttons/share-button.js.map +1 -0
  29. package/lib/commonjs/ui-components/camera/qr-code-scanner.js +5 -1
  30. package/lib/commonjs/ui-components/camera/qr-code-scanner.js.map +1 -1
  31. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +16 -42
  32. package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  33. package/lib/commonjs/ui-components/credential/credential-attribute-item.js +3 -1
  34. package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
  35. package/lib/commonjs/ui-components/credential/group/credential-group-header.js +72 -0
  36. package/lib/commonjs/ui-components/credential/group/credential-group-header.js.map +1 -0
  37. package/lib/commonjs/ui-components/credential/group/index.js +14 -0
  38. package/lib/commonjs/ui-components/credential/group/index.js.map +1 -0
  39. package/lib/commonjs/ui-components/credential/index.js +12 -0
  40. package/lib/commonjs/ui-components/credential/index.js.map +1 -1
  41. package/lib/commonjs/ui-components/header/foldable-header.js +29 -17
  42. package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
  43. package/lib/commonjs/ui-components/icons/icons.js +24 -1
  44. package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
  45. package/lib/commonjs/ui-components/index.js +22 -0
  46. package/lib/commonjs/ui-components/index.js.map +1 -1
  47. package/lib/commonjs/ui-components/loader/loading-result.js +8 -1
  48. package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
  49. package/lib/commonjs/ui-components/nfc/index.js +14 -0
  50. package/lib/commonjs/ui-components/nfc/index.js.map +1 -0
  51. package/lib/commonjs/ui-components/nfc/nfc-process.js +77 -0
  52. package/lib/commonjs/ui-components/nfc/nfc-process.js.map +1 -0
  53. package/lib/commonjs/ui-components/pin/pin-lock-animation.js +477 -475
  54. package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -1
  55. package/lib/commonjs/ui-components/proof-request/index.js +13 -0
  56. package/lib/commonjs/ui-components/proof-request/index.js.map +1 -0
  57. package/lib/commonjs/ui-components/proof-request/proof-request-set.js +47 -0
  58. package/lib/commonjs/ui-components/proof-request/proof-request-set.js.map +1 -0
  59. package/lib/commonjs/ui-components/screens/section-list-screen.js +37 -8
  60. package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
  61. package/lib/commonjs/utils/array.js.map +1 -1
  62. package/lib/commonjs/utils/hooks/app-state.js +33 -0
  63. package/lib/commonjs/utils/hooks/app-state.js.map +1 -0
  64. package/lib/commonjs/utils/hooks/core/backup.js +4 -5
  65. package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
  66. package/lib/commonjs/utils/hooks/core/core-init.js +4 -22
  67. package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
  68. package/lib/commonjs/utils/hooks/core/credentials.js +10 -3
  69. package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
  70. package/lib/commonjs/utils/hooks/core/identifiers.js +1 -1
  71. package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
  72. package/lib/commonjs/utils/hooks/core/index.js +11 -0
  73. package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
  74. package/lib/commonjs/utils/hooks/core/proofs.js +45 -8
  75. package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
  76. package/lib/commonjs/utils/hooks/core/wallet-unit.js +85 -0
  77. package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -0
  78. package/lib/commonjs/utils/hooks/index.js +22 -0
  79. package/lib/commonjs/utils/hooks/index.js.map +1 -1
  80. package/lib/commonjs/utils/hooks/nfc/nfc-status.js +40 -0
  81. package/lib/commonjs/utils/hooks/nfc/nfc-status.js.map +1 -0
  82. package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
  83. package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
  84. package/lib/commonjs/utils/index.js +24 -0
  85. package/lib/commonjs/utils/index.js.map +1 -1
  86. package/lib/commonjs/utils/parsers/credential-sharing-v2.js +190 -0
  87. package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -0
  88. package/lib/commonjs/utils/parsers/credential-sharing.js +31 -18
  89. package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
  90. package/lib/commonjs/utils/parsers/credential.js +111 -63
  91. package/lib/commonjs/utils/parsers/credential.js.map +1 -1
  92. package/lib/commonjs/utils/parsers/index.js +11 -0
  93. package/lib/commonjs/utils/parsers/index.js.map +1 -1
  94. package/lib/commonjs/utils/parsers/query.js +4 -4
  95. package/lib/commonjs/utils/parsers/query.js.map +1 -1
  96. package/lib/commonjs/utils/url.js +80 -0
  97. package/lib/commonjs/utils/url.js.map +1 -0
  98. package/lib/commonjs/utils/wallet-unit.js +30 -0
  99. package/lib/commonjs/utils/wallet-unit.js.map +1 -0
  100. package/lib/module/components/credential/credential.js +8 -2
  101. package/lib/module/components/credential/credential.js.map +1 -1
  102. package/lib/module/components/proof-request/index.js +4 -3
  103. package/lib/module/components/proof-request/index.js.map +1 -1
  104. package/lib/module/components/proof-request/select-share-credential-card-notice.js +29 -0
  105. package/lib/module/components/proof-request/select-share-credential-card-notice.js.map +1 -0
  106. package/lib/module/components/proof-request/share-credential-card-notice.js +28 -0
  107. package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -0
  108. package/lib/module/components/proof-request/{group.js → v1/group.js} +1 -1
  109. package/lib/module/components/proof-request/v1/group.js.map +1 -0
  110. package/lib/module/components/proof-request/v1/index.js +4 -0
  111. package/lib/module/components/proof-request/v1/index.js.map +1 -0
  112. package/lib/module/components/proof-request/{select-credential.js → v1/select-credential.js} +12 -6
  113. package/lib/module/components/proof-request/v1/select-credential.js.map +1 -0
  114. package/lib/module/components/proof-request/v1/share-credential.js +118 -0
  115. package/lib/module/components/proof-request/v1/share-credential.js.map +1 -0
  116. package/lib/module/components/proof-request/v2/index.js +4 -0
  117. package/lib/module/components/proof-request/v2/index.js.map +1 -0
  118. package/lib/module/components/proof-request/v2/select-credential-v2.js +46 -0
  119. package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -0
  120. package/lib/module/components/proof-request/v2/share-credential-v2-group.js +154 -0
  121. package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -0
  122. package/lib/module/components/proof-request/v2/share-credential-v2.js +126 -0
  123. package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -0
  124. package/lib/module/ui-components/buttons/index.js +2 -1
  125. package/lib/module/ui-components/buttons/index.js.map +1 -1
  126. package/lib/module/ui-components/buttons/share-button.js +47 -0
  127. package/lib/module/ui-components/buttons/share-button.js.map +1 -0
  128. package/lib/module/ui-components/camera/qr-code-scanner.js +5 -1
  129. package/lib/module/ui-components/camera/qr-code-scanner.js.map +1 -1
  130. package/lib/module/ui-components/credential/card/credential-details-list-item.js +19 -45
  131. package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
  132. package/lib/module/ui-components/credential/credential-attribute-item.js +3 -1
  133. package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
  134. package/lib/module/ui-components/credential/group/credential-group-header.js +64 -0
  135. package/lib/module/ui-components/credential/group/credential-group-header.js.map +1 -0
  136. package/lib/module/ui-components/credential/group/index.js +3 -0
  137. package/lib/module/ui-components/credential/group/index.js.map +1 -0
  138. package/lib/module/ui-components/credential/index.js +1 -0
  139. package/lib/module/ui-components/credential/index.js.map +1 -1
  140. package/lib/module/ui-components/header/foldable-header.js +29 -17
  141. package/lib/module/ui-components/header/foldable-header.js.map +1 -1
  142. package/lib/module/ui-components/icons/icons.js +22 -0
  143. package/lib/module/ui-components/icons/icons.js.map +1 -1
  144. package/lib/module/ui-components/index.js +2 -0
  145. package/lib/module/ui-components/index.js.map +1 -1
  146. package/lib/module/ui-components/loader/loading-result.js +8 -1
  147. package/lib/module/ui-components/loader/loading-result.js.map +1 -1
  148. package/lib/module/ui-components/nfc/index.js +3 -0
  149. package/lib/module/ui-components/nfc/index.js.map +1 -0
  150. package/lib/module/ui-components/nfc/nfc-process.js +69 -0
  151. package/lib/module/ui-components/nfc/nfc-process.js.map +1 -0
  152. package/lib/module/ui-components/pin/pin-lock-animation.js +477 -475
  153. package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -1
  154. package/lib/module/ui-components/proof-request/index.js +3 -0
  155. package/lib/module/ui-components/proof-request/index.js.map +1 -0
  156. package/lib/module/ui-components/proof-request/proof-request-set.js +39 -0
  157. package/lib/module/ui-components/proof-request/proof-request-set.js.map +1 -0
  158. package/lib/module/ui-components/screens/section-list-screen.js +36 -9
  159. package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
  160. package/lib/module/utils/array.js.map +1 -1
  161. package/lib/module/utils/hooks/app-state.js +27 -0
  162. package/lib/module/utils/hooks/app-state.js.map +1 -0
  163. package/lib/module/utils/hooks/core/backup.js +5 -6
  164. package/lib/module/utils/hooks/core/backup.js.map +1 -1
  165. package/lib/module/utils/hooks/core/core-init.js +3 -20
  166. package/lib/module/utils/hooks/core/core-init.js.map +1 -1
  167. package/lib/module/utils/hooks/core/credentials.js +11 -4
  168. package/lib/module/utils/hooks/core/credentials.js.map +1 -1
  169. package/lib/module/utils/hooks/core/identifiers.js +5 -5
  170. package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
  171. package/lib/module/utils/hooks/core/index.js +1 -0
  172. package/lib/module/utils/hooks/core/index.js.map +1 -1
  173. package/lib/module/utils/hooks/core/proofs.js +45 -8
  174. package/lib/module/utils/hooks/core/proofs.js.map +1 -1
  175. package/lib/module/utils/hooks/core/wallet-unit.js +75 -0
  176. package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -0
  177. package/lib/module/utils/hooks/index.js +2 -0
  178. package/lib/module/utils/hooks/index.js.map +1 -1
  179. package/lib/module/utils/hooks/nfc/nfc-status.js +32 -0
  180. package/lib/module/utils/hooks/nfc/nfc-status.js.map +1 -0
  181. package/lib/module/utils/hooks/revocation/credential-status.js +1 -1
  182. package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
  183. package/lib/module/utils/index.js +2 -0
  184. package/lib/module/utils/index.js.map +1 -1
  185. package/lib/module/utils/parsers/credential-sharing-v2.js +177 -0
  186. package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -0
  187. package/lib/module/utils/parsers/credential-sharing.js +31 -18
  188. package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
  189. package/lib/module/utils/parsers/credential.js +112 -64
  190. package/lib/module/utils/parsers/credential.js.map +1 -1
  191. package/lib/module/utils/parsers/index.js +1 -0
  192. package/lib/module/utils/parsers/index.js.map +1 -1
  193. package/lib/module/utils/parsers/query.js +4 -4
  194. package/lib/module/utils/parsers/query.js.map +1 -1
  195. package/lib/module/utils/url.js +71 -0
  196. package/lib/module/utils/url.js.map +1 -0
  197. package/lib/module/utils/wallet-unit.js +22 -0
  198. package/lib/module/utils/wallet-unit.js.map +1 -0
  199. package/lib/typescript/components/proof-request/index.d.ts +4 -3
  200. package/lib/typescript/components/proof-request/select-share-credential-card-notice.d.ts +7 -0
  201. package/lib/typescript/components/proof-request/share-credential-card-notice.d.ts +6 -0
  202. package/lib/typescript/components/proof-request/v1/index.d.ts +3 -0
  203. package/lib/typescript/components/proof-request/{select-credential.d.ts → v1/select-credential.d.ts} +1 -1
  204. package/lib/typescript/components/proof-request/{share-credential.d.ts → v1/share-credential.d.ts} +1 -1
  205. package/lib/typescript/components/proof-request/v2/index.d.ts +3 -0
  206. package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +14 -0
  207. package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +24 -0
  208. package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +23 -0
  209. package/lib/typescript/ui-components/buttons/index.d.ts +3 -1
  210. package/lib/typescript/ui-components/buttons/share-button.d.ts +10 -0
  211. package/lib/typescript/ui-components/credential/group/credential-group-header.d.ts +10 -0
  212. package/lib/typescript/ui-components/credential/group/index.d.ts +3 -0
  213. package/lib/typescript/ui-components/credential/index.d.ts +1 -0
  214. package/lib/typescript/ui-components/header/foldable-header.d.ts +1 -0
  215. package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
  216. package/lib/typescript/ui-components/index.d.ts +2 -0
  217. package/lib/typescript/ui-components/loader/loading-result.d.ts +2 -0
  218. package/lib/typescript/ui-components/nfc/index.d.ts +2 -0
  219. package/lib/typescript/ui-components/nfc/nfc-process.d.ts +17 -0
  220. package/lib/typescript/ui-components/pin/pin-lock-animation.d.ts +311 -311
  221. package/lib/typescript/ui-components/proof-request/index.d.ts +3 -0
  222. package/lib/typescript/ui-components/proof-request/proof-request-set.d.ts +7 -0
  223. package/lib/typescript/ui-components/screens/section-list-screen.d.ts +5 -2
  224. package/lib/typescript/utils/array.d.ts +1 -0
  225. package/lib/typescript/utils/hooks/app-state.d.ts +5 -0
  226. package/lib/typescript/utils/hooks/core/backup.d.ts +1 -1
  227. package/lib/typescript/utils/hooks/core/core-init.d.ts +1 -3
  228. package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -1
  229. package/lib/typescript/utils/hooks/core/identifiers.d.ts +1 -1
  230. package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
  231. package/lib/typescript/utils/hooks/core/proofs.d.ts +10 -3
  232. package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +9 -0
  233. package/lib/typescript/utils/hooks/index.d.ts +2 -0
  234. package/lib/typescript/utils/hooks/nfc/nfc-status.d.ts +6 -0
  235. package/lib/typescript/utils/index.d.ts +2 -0
  236. package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +11 -0
  237. package/lib/typescript/utils/parsers/credential-sharing.d.ts +11 -5
  238. package/lib/typescript/utils/parsers/credential.d.ts +9 -6
  239. package/lib/typescript/utils/parsers/index.d.ts +1 -0
  240. package/lib/typescript/utils/parsers/query.d.ts +2 -2
  241. package/lib/typescript/utils/url.d.ts +19 -0
  242. package/lib/typescript/utils/wallet-unit.d.ts +8 -0
  243. package/package.json +16 -6
  244. package/src/components/credential/credential.tsx +5 -1
  245. package/src/components/proof-request/index.ts +4 -3
  246. package/src/components/proof-request/select-share-credential-card-notice.tsx +37 -0
  247. package/src/components/proof-request/share-credential-card-notice.tsx +33 -0
  248. package/src/components/proof-request/{group.tsx → v1/group.tsx} +1 -1
  249. package/src/components/proof-request/v1/index.ts +3 -0
  250. package/src/components/proof-request/{select-credential.tsx → v1/select-credential.tsx} +12 -5
  251. package/src/components/proof-request/{share-credential.tsx → v1/share-credential.tsx} +35 -52
  252. package/src/components/proof-request/v2/index.ts +3 -0
  253. package/src/components/proof-request/v2/select-credential-v2.tsx +59 -0
  254. package/src/components/proof-request/v2/share-credential-v2-group.tsx +258 -0
  255. package/src/components/proof-request/v2/share-credential-v2.tsx +211 -0
  256. package/src/ui-components/buttons/index.ts +4 -0
  257. package/src/ui-components/buttons/share-button.stories.tsx +25 -0
  258. package/src/ui-components/buttons/share-button.tsx +55 -0
  259. package/src/ui-components/camera/qr-code-scanner.tsx +11 -2
  260. package/src/ui-components/credential/card/credential-details-list-item.tsx +27 -49
  261. package/src/ui-components/credential/credential-attribute-item.tsx +2 -0
  262. package/src/ui-components/credential/group/credential-group-header.tsx +70 -0
  263. package/src/ui-components/credential/group/index.ts +4 -0
  264. package/src/ui-components/credential/index.ts +1 -0
  265. package/src/ui-components/header/foldable-header.tsx +31 -16
  266. package/src/ui-components/icons/icons.tsx +22 -0
  267. package/src/ui-components/index.ts +2 -0
  268. package/src/ui-components/loader/loading-result.stories.tsx +4 -1
  269. package/src/ui-components/loader/loading-result.tsx +7 -0
  270. package/src/ui-components/nfc/index.ts +3 -0
  271. package/src/ui-components/nfc/nfc-process.tsx +80 -0
  272. package/src/ui-components/pin/pin-lock-animation.tsx +240 -278
  273. package/src/ui-components/proof-request/index.ts +4 -0
  274. package/src/ui-components/proof-request/proof-request-set.tsx +46 -0
  275. package/src/ui-components/screens/section-list-screen.tsx +39 -8
  276. package/src/utils/array.ts +4 -0
  277. package/src/utils/hooks/app-state.ts +29 -0
  278. package/src/utils/hooks/core/backup.ts +3 -9
  279. package/src/utils/hooks/core/core-init.ts +1 -23
  280. package/src/utils/hooks/core/credentials.ts +11 -4
  281. package/src/utils/hooks/core/identifiers.ts +15 -14
  282. package/src/utils/hooks/core/index.ts +2 -1
  283. package/src/utils/hooks/core/proofs.ts +47 -10
  284. package/src/utils/hooks/core/wallet-unit.ts +77 -0
  285. package/src/utils/hooks/index.ts +2 -0
  286. package/src/utils/hooks/nfc/nfc-status.ts +31 -0
  287. package/src/utils/hooks/revocation/credential-status.ts +1 -1
  288. package/src/utils/index.ts +2 -0
  289. package/src/utils/parsers/credential-sharing-v2.tsx +283 -0
  290. package/src/utils/parsers/credential-sharing.tsx +40 -16
  291. package/src/utils/parsers/credential.ts +129 -59
  292. package/src/utils/parsers/index.ts +1 -0
  293. package/src/utils/parsers/query.ts +7 -5
  294. package/src/utils/url.ts +61 -0
  295. package/src/utils/wallet-unit.ts +30 -0
  296. package/lib/commonjs/components/proof-request/group.js.map +0 -1
  297. package/lib/commonjs/components/proof-request/select-credential.js.map +0 -1
  298. package/lib/commonjs/components/proof-request/share-credential.js.map +0 -1
  299. package/lib/module/components/proof-request/group.js.map +0 -1
  300. package/lib/module/components/proof-request/select-credential.js.map +0 -1
  301. package/lib/module/components/proof-request/share-credential.js +0 -147
  302. package/lib/module/components/proof-request/share-credential.js.map +0 -1
  303. /package/lib/typescript/components/proof-request/{group.d.ts → v1/group.d.ts} +0 -0
@@ -6,13 +6,20 @@ import {
6
6
  PresentationDefinitionRequestedCredential,
7
7
  } from '@procivis/react-native-one-core';
8
8
  import React, { FunctionComponent, useMemo } from 'react';
9
- import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
9
+ import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
10
10
 
11
- import { Button, ButtonType, CredentialDetailsCardListItem, Typography, useAppColorScheme } from '../../ui-components';
12
- import { concatTestID } from '../../utils';
13
- import { useCoreConfig } from '../../utils/hooks/core/core-config';
14
- import { getValidityState, ValidityState } from '../../utils/parsers/credential';
15
- import { shareCredentialCardFromCredential, ShareCredentialCardLabels } from '../../utils/parsers/credential-sharing';
11
+ import { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';
12
+ import { concatTestID } from '../../../utils';
13
+ import { useCoreConfig } from '../../../utils/hooks/core/core-config';
14
+ import { useWalletUnitAttestation } from '../../../utils/hooks/core/wallet-unit';
15
+ import { getValidityState, ValidityState } from '../../../utils/parsers/credential';
16
+ import {
17
+ shareCredentialCardFromCredential,
18
+ ShareCredentialCardLabels,
19
+ } from '../../../utils/parsers/credential-sharing';
20
+ import { walletUnitAttestationState } from '../../../utils/wallet-unit';
21
+ import { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';
22
+ import { ShareCredentialCardNotice } from '../share-credential-card-notice';
16
23
 
17
24
  export type ShareCredentialLabels = ShareCredentialCardLabels & {
18
25
  invalidCredentialNotice: string;
@@ -54,6 +61,7 @@ export const ShareCredential: FunctionComponent<{
54
61
  const colorScheme = useAppColorScheme();
55
62
  const credential = allCredentials.find((c) => c.id === selectedCredentialId);
56
63
  const { data: config } = useCoreConfig();
64
+ const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
57
65
  const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
58
66
 
59
67
  const selectionOptions = useMemo(
@@ -87,60 +95,43 @@ export const ShareCredential: FunctionComponent<{
87
95
  }
88
96
  if (validityState === ValidityState.Revoked) {
89
97
  return (
90
- <View
91
- style={[styles.notice, { backgroundColor: colorScheme.background }]}
92
- testID={concatTestID(testID, 'notice.revoked')}>
93
- <Typography align="center" color={colorScheme.text} preset="s/line-height-capped">
94
- {labels.revokedCredentialNotice}
95
- </Typography>
96
- </View>
98
+ <ShareCredentialCardNotice
99
+ testID={concatTestID(testID, 'notice.revoked')}
100
+ text={labels.revokedCredentialNotice}
101
+ />
97
102
  );
98
103
  }
99
104
  if (validityState === ValidityState.Suspended) {
100
105
  return (
101
- <View
102
- style={[styles.notice, { backgroundColor: colorScheme.background }]}
103
- testID={concatTestID(testID, 'notice.suspended')}>
104
- <Typography align="center" color={colorScheme.text} preset="s/line-height-capped">
105
- {labels.suspendedCredentialNotice}
106
- </Typography>
107
- </View>
106
+ <ShareCredentialCardNotice
107
+ testID={concatTestID(testID, 'notice.suspended')}
108
+ text={labels.suspendedCredentialNotice}
109
+ />
108
110
  );
109
111
  }
110
112
 
111
113
  if (invalid) {
112
114
  return (
113
- <View
114
- style={[styles.notice, { backgroundColor: colorScheme.background }]}
115
- testID={concatTestID(testID, 'notice.invalid')}>
116
- <Typography align="center" color={colorScheme.text} preset="s/line-height-capped">
117
- {labels.invalidCredentialNotice}
118
- </Typography>
119
- </View>
115
+ <ShareCredentialCardNotice
116
+ testID={concatTestID(testID, 'notice.invalid')}
117
+ text={labels.invalidCredentialNotice}
118
+ />
120
119
  );
121
120
  }
122
121
 
123
122
  if (multipleCredentialsAvailable) {
124
123
  return (
125
- <View
126
- style={[styles.notice, { backgroundColor: colorScheme.background }]}
127
- testID={concatTestID(testID, 'notice.multiple')}>
128
- <Typography align="center" color={colorScheme.text} preset="s/line-height-capped">
129
- {labels.multipleCredentialsNotice}
130
- </Typography>
131
- <Button
132
- onPress={onSelectCredential}
133
- style={styles.noticeButton}
134
- testID={concatTestID(testID, 'notice.multiple.button')}
135
- title={labels.multipleCredentialsSelect}
136
- type={ButtonType.Secondary}
137
- />
138
- </View>
124
+ <SelectShareCredentialCardNotice
125
+ buttonTitle={labels.multipleCredentialsSelect}
126
+ onPress={onSelectCredential}
127
+ testID={concatTestID(testID, 'notice.multiple')}
128
+ text={labels.multipleCredentialsNotice}
129
+ />
139
130
  );
140
131
  }
141
- }, [colorScheme, expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);
132
+ }, [expanded, invalid, labels, multipleCredentialsAvailable, onSelectCredential, testID, validityState]);
142
133
 
143
- if (!config) {
134
+ if (!config || isLoadingWUA) {
144
135
  return null;
145
136
  }
146
137
 
@@ -152,6 +143,7 @@ export const ShareCredential: FunctionComponent<{
152
143
  request,
153
144
  selectedFields,
154
145
  config,
146
+ walletUnitAttestationState(walletUnitAttestation),
155
147
  testID,
156
148
  labels,
157
149
  );
@@ -182,13 +174,4 @@ const styles = StyleSheet.create({
182
174
  borderWidth: 1,
183
175
  marginBottom: 8,
184
176
  },
185
- notice: {
186
- marginBottom: 22,
187
- marginHorizontal: 12,
188
- padding: 12,
189
- },
190
- noticeButton: {
191
- marginTop: 24,
192
- paddingVertical: 11,
193
- },
194
177
  });
@@ -0,0 +1,3 @@
1
+ export * from './select-credential-v2';
2
+ export * from './share-credential-v2';
3
+ export * from './share-credential-v2-group';
@@ -0,0 +1,59 @@
1
+ import { CredentialListItem, PresentationDefinitionV2CredentialDetail } from '@procivis/react-native-one-core';
2
+ import React, { FC, useCallback, useMemo } from 'react';
3
+ import { Dimensions, ImageSourcePropType } from 'react-native';
4
+
5
+ import { CredentialDetailsCardListItem } from '../../../ui-components';
6
+ import {
7
+ ShareCredentialCardLabels,
8
+ useCoreConfig,
9
+ useWalletUnitAttestation,
10
+ walletUnitAttestationState,
11
+ } from '../../../utils';
12
+ import { selectCredentialCardFromV2Credential } from '../../../utils/parsers/credential-sharing-v2';
13
+
14
+ export const SelectCredentialV2: FC<{
15
+ credential: PresentationDefinitionV2CredentialDetail;
16
+ labels: ShareCredentialCardLabels;
17
+ lastItem: boolean;
18
+ multiple: boolean;
19
+ onImagePreview: (title: string, image: ImageSourcePropType) => void;
20
+ onSelected?: (credentialId: CredentialListItem['id'], selected: boolean) => void;
21
+ selected: boolean;
22
+ testID: string;
23
+ }> = ({ credential, labels, lastItem, multiple, onImagePreview, onSelected, selected, testID }) => {
24
+ const { data: config } = useCoreConfig();
25
+ const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
26
+ const cardWidth = useMemo(() => Dimensions.get('window').width - 32, []);
27
+
28
+ const onHeaderPress = useCallback(() => {
29
+ onSelected?.(credential.id, !selected);
30
+ }, [credential.id, onSelected, selected]);
31
+
32
+ if (!credential || !config || isLoadingWUA) {
33
+ return null;
34
+ }
35
+
36
+ const { card, attributes } = selectCredentialCardFromV2Credential(
37
+ credential,
38
+ selected,
39
+ multiple,
40
+ config,
41
+ walletUnitAttestationState(walletUnitAttestation),
42
+ testID,
43
+ labels,
44
+ );
45
+
46
+ return (
47
+ <CredentialDetailsCardListItem
48
+ attributes={attributes}
49
+ card={{
50
+ ...card,
51
+ onHeaderPress,
52
+ width: cardWidth,
53
+ }}
54
+ expanded={selected}
55
+ lastItem={lastItem}
56
+ onImagePreview={onImagePreview}
57
+ />
58
+ );
59
+ };
@@ -0,0 +1,258 @@
1
+ import {
2
+ CredentialListItem,
3
+ PresentationDefinitionV2,
4
+ PresentationDefinitionV2CredentialClaim,
5
+ PresentationSubmitV2CredentialRequest,
6
+ } from '@procivis/react-native-one-core';
7
+ import React, { FC, useCallback, useMemo } from 'react';
8
+ import { ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
9
+ import Animated, { LinearTransition } from 'react-native-reanimated';
10
+
11
+ import {
12
+ BlurView,
13
+ CredentialCardShadow,
14
+ DownIcon,
15
+ Selector,
16
+ SelectorStatus,
17
+ TouchableOpacity,
18
+ UpIcon,
19
+ } from '../../../ui-components';
20
+ import CredentialGroupHeader from '../../../ui-components/credential/group/credential-group-header';
21
+ import { concatTestID, useCredentialListExpandedCard } from '../../../utils';
22
+ import { ShareCredentialLabels } from '../v1/share-credential';
23
+ import { GroupedShareCredentialV2Padding, ShareCredentialV2 } from './share-credential-v2';
24
+
25
+ export type CredentialQuerySelection = Record<
26
+ string,
27
+ PresentationSubmitV2CredentialRequest | PresentationSubmitV2CredentialRequest[]
28
+ >;
29
+
30
+ export type ShareCredentialGroupLabels = ShareCredentialLabels & {
31
+ groupHeader: string;
32
+ };
33
+
34
+ export type ShareCredentialV2GroupProps = {
35
+ labels: ShareCredentialGroupLabels;
36
+ lastGroup: boolean;
37
+ onGroupSelect?: (selected: boolean) => void;
38
+ onImagePreview: (title: string, image: ImageSourcePropType) => void;
39
+ onSelectCredential: (requestCredentialId: string) => () => void;
40
+ onSelectField: (
41
+ requestCredentialId: string,
42
+ ) => (
43
+ credentialId: CredentialListItem['id'],
44
+ fieldPath: PresentationDefinitionV2CredentialClaim['path'],
45
+ selected: boolean,
46
+ ) => void;
47
+ presentationDefinition: PresentationDefinitionV2;
48
+ requestGroup: string[];
49
+ selected?: boolean;
50
+ selectedCredentials?: CredentialQuerySelection;
51
+ style?: StyleProp<ViewStyle>;
52
+ testID: string;
53
+ valid: boolean;
54
+ };
55
+
56
+ const multipleCredentialsSelected = (
57
+ selectedCredentials: CredentialQuerySelection | undefined,
58
+ credentialRequestId: string,
59
+ ) => {
60
+ return (
61
+ selectedCredentials &&
62
+ selectedCredentials[credentialRequestId] &&
63
+ Array.isArray(selectedCredentials[credentialRequestId]) &&
64
+ (selectedCredentials[credentialRequestId] as PresentationSubmitV2CredentialRequest[]).length > 1
65
+ );
66
+ };
67
+
68
+ const numberOfCardsForRequest = (
69
+ selectedCredentials: CredentialQuerySelection | undefined,
70
+ credentialRequestId: string,
71
+ ) => {
72
+ if (!selectedCredentials || !selectedCredentials[credentialRequestId]) {
73
+ return 1;
74
+ }
75
+ const selection = selectedCredentials[credentialRequestId];
76
+ if (Array.isArray(selection)) {
77
+ return selection.length;
78
+ }
79
+ return 1;
80
+ };
81
+
82
+ const heightForNumberOfCards = (numberOfCards: number) => 60 * (numberOfCards + 1) + 12 * numberOfCards;
83
+
84
+ export const ShareCredentialV2Group: FC<ShareCredentialV2GroupProps> = ({
85
+ labels,
86
+ lastGroup,
87
+ onGroupSelect,
88
+ onImagePreview,
89
+ onSelectCredential,
90
+ onSelectField,
91
+ presentationDefinition,
92
+ requestGroup,
93
+ selected,
94
+ selectedCredentials = {},
95
+ style,
96
+ testID,
97
+ valid,
98
+ }) => {
99
+ const { expandedCredential, onHeaderPress } = useCredentialListExpandedCard();
100
+ const numberOfCards = requestGroup.reduce(
101
+ (acc, groupId) => acc + numberOfCardsForRequest(selectedCredentials, groupId),
102
+ 0,
103
+ );
104
+ const singleCredentialGroup =
105
+ requestGroup.length === 1 && !multipleCredentialsSelected(selectedCredentials, requestGroup[0]);
106
+
107
+ const headerPressHandler = useCallback(() => {
108
+ onGroupSelect?.(!selected);
109
+ }, [selected, onGroupSelect]);
110
+
111
+ const onNestedCardHeaderPress = useCallback(
112
+ (credentialId: string) => () => {
113
+ if (!selected) {
114
+ onGroupSelect?.(true);
115
+ }
116
+ onHeaderPress(credentialId);
117
+ },
118
+ [selected, onGroupSelect, onHeaderPress],
119
+ );
120
+
121
+ const credentialCards = useMemo(() => {
122
+ return requestGroup.flatMap((credentialRequestId, credentialRequestIndex, { length: credentialRequestsLength }) => {
123
+ const lastQuery = credentialRequestIndex === credentialRequestsLength - 1;
124
+
125
+ const credentialQuery = presentationDefinition.credentialQueries[credentialRequestId];
126
+ let defaultSelection: PresentationSubmitV2CredentialRequest;
127
+ if ('applicableCredentials' in credentialQuery) {
128
+ defaultSelection = credentialQuery.applicableCredentials?.[0]
129
+ ? {
130
+ credentialId: credentialQuery.applicableCredentials[0].id,
131
+ userSelections: [],
132
+ }
133
+ : {
134
+ credentialId: '',
135
+ userSelections: [],
136
+ };
137
+ } else {
138
+ defaultSelection = {
139
+ credentialId: '',
140
+ userSelections: [],
141
+ };
142
+ }
143
+ const request = selectedCredentials[credentialRequestId];
144
+ const credentialSelections = request ? (Array.isArray(request) ? request : [request]) : [defaultSelection];
145
+
146
+ return credentialSelections?.flatMap((credentialRequest, credentialIndex, { length: credentialsLength }) => {
147
+ const selectedFields = credentialRequest.userSelections;
148
+ const cardId = `${credentialRequestId}-${credentialRequest.credentialId}`;
149
+ const lastItem = singleCredentialGroup ? lastGroup : lastQuery && credentialIndex === credentialsLength - 1;
150
+ const cardExpanded = selected && (singleCredentialGroup || expandedCredential === cardId);
151
+ const headerAccessory =
152
+ singleCredentialGroup && valid ? (
153
+ <Selector status={selected ? SelectorStatus.SelectedRadio : SelectorStatus.Empty} />
154
+ ) : cardExpanded ? (
155
+ UpIcon
156
+ ) : (
157
+ DownIcon
158
+ );
159
+ return (
160
+ <ShareCredentialV2
161
+ credentialQuery={credentialQuery}
162
+ credentialRequestId={credentialRequestId}
163
+ expanded={cardExpanded}
164
+ grouped={!singleCredentialGroup}
165
+ headerAccessory={headerAccessory}
166
+ key={credentialRequestId}
167
+ labels={labels}
168
+ lastItem={lastItem}
169
+ onHeaderPress={singleCredentialGroup ? headerPressHandler : onNestedCardHeaderPress(cardId)}
170
+ onImagePreview={onImagePreview}
171
+ onSelectCredential={onSelectCredential?.(credentialRequestId)}
172
+ onSelectField={onSelectField(credentialRequestId)}
173
+ selectedCredentialId={credentialRequest.credentialId}
174
+ selectedFields={selectedFields}
175
+ style={[!singleCredentialGroup && styles.requestedCredential, lastItem && styles.requestedCredentialLast]}
176
+ testID={concatTestID(testID, credentialRequestId)}
177
+ />
178
+ );
179
+ });
180
+ });
181
+ }, [
182
+ expandedCredential,
183
+ labels,
184
+ lastGroup,
185
+ headerPressHandler,
186
+ onImagePreview,
187
+ onNestedCardHeaderPress,
188
+ onSelectCredential,
189
+ onSelectField,
190
+ presentationDefinition.credentialQueries,
191
+ requestGroup,
192
+ selected,
193
+ selectedCredentials,
194
+ singleCredentialGroup,
195
+ testID,
196
+ valid,
197
+ ]);
198
+
199
+ if (singleCredentialGroup) {
200
+ return credentialCards[0];
201
+ }
202
+
203
+ const groupHeaderAccessory = valid ? (
204
+ <Selector status={selected ? SelectorStatus.SelectedRadio : SelectorStatus.Empty} />
205
+ ) : selected ? (
206
+ UpIcon
207
+ ) : (
208
+ DownIcon
209
+ );
210
+
211
+ return (
212
+ <Animated.View
213
+ layout={LinearTransition}
214
+ style={[
215
+ styles.animatedWrapper,
216
+ // eslint-disable-next-line react-native/no-inline-styles
217
+ {
218
+ height: selected || lastGroup ? 'auto' : heightForNumberOfCards(numberOfCards),
219
+ },
220
+ style,
221
+ ]}>
222
+ <Animated.View
223
+ layout={LinearTransition}
224
+ style={[
225
+ singleCredentialGroup ? undefined : styles.groupedCredentialsWrapper,
226
+ !singleCredentialGroup && styles.requestedCredential,
227
+ lastGroup && styles.requestedCredentialLast,
228
+ style,
229
+ ]}>
230
+ <BlurView blurStyle="strong" darkMode={true} style={StyleSheet.absoluteFill} />
231
+ <TouchableOpacity onPress={headerPressHandler}>
232
+ <CredentialGroupHeader accessory={groupHeaderAccessory} name={labels.groupHeader} style={styles.header} />
233
+ </TouchableOpacity>
234
+ {credentialCards}
235
+ </Animated.View>
236
+ </Animated.View>
237
+ );
238
+ };
239
+
240
+ const styles = StyleSheet.create({
241
+ animatedWrapper: {
242
+ ...CredentialCardShadow,
243
+ },
244
+ groupedCredentialsWrapper: {
245
+ borderRadius: 10 + GroupedShareCredentialV2Padding,
246
+ overflow: 'hidden',
247
+ paddingBottom: GroupedShareCredentialV2Padding,
248
+ },
249
+ header: {
250
+ marginBottom: GroupedShareCredentialV2Padding,
251
+ },
252
+ requestedCredential: {
253
+ marginBottom: 12,
254
+ },
255
+ requestedCredentialLast: {
256
+ marginBottom: 0,
257
+ },
258
+ });
@@ -0,0 +1,211 @@
1
+ import {
2
+ CredentialListItem,
3
+ PresentationDefinitionV2CredentialClaim,
4
+ PresentationDefinitionV2CredentialQuery,
5
+ } from '@procivis/react-native-one-core';
6
+ import React, { FunctionComponent, useCallback, useMemo } from 'react';
7
+ import { Dimensions, ImageSourcePropType, StyleProp, StyleSheet, ViewStyle } from 'react-native';
8
+
9
+ import { CredentialDetailsCardListItem, useAppColorScheme } from '../../../ui-components';
10
+ import {
11
+ concatTestID,
12
+ getValidityState,
13
+ useCoreConfig,
14
+ useWalletUnitAttestation,
15
+ ValidityState,
16
+ walletUnitAttestationState,
17
+ } from '../../../utils';
18
+ import { shareCredentialCardFromV2PresentationCredential } from '../../../utils/parsers/credential-sharing-v2';
19
+ import { SelectShareCredentialCardNotice } from '../select-share-credential-card-notice';
20
+ import { ShareCredentialCardNotice } from '../share-credential-card-notice';
21
+ import { ShareCredentialLabels } from '../v1';
22
+
23
+ export type ShareCredentialV2Props = {
24
+ credentialQuery: PresentationDefinitionV2CredentialQuery;
25
+ credentialRequestId: string;
26
+ expanded?: boolean;
27
+ grouped?: boolean;
28
+ headerAccessory?: React.ComponentType<any> | React.ReactElement;
29
+ labels: ShareCredentialLabels;
30
+ lastItem?: boolean;
31
+ onHeaderPress?: (_credentialId?: string) => void;
32
+ onImagePreview: (title: string, image: ImageSourcePropType) => void;
33
+ onSelectCredential?: () => void;
34
+ onSelectField: (
35
+ credentialId: CredentialListItem['id'],
36
+ fieldPath: PresentationDefinitionV2CredentialClaim['path'],
37
+ selected: boolean,
38
+ ) => void;
39
+ selectedCredentialId?: CredentialListItem['id'];
40
+ selectedFields?: Array<PresentationDefinitionV2CredentialClaim['path']>;
41
+ style?: StyleProp<ViewStyle>;
42
+ testID: string;
43
+ };
44
+
45
+ export const GroupedShareCredentialV2Padding = 4;
46
+
47
+ export const ShareCredentialV2: FunctionComponent<ShareCredentialV2Props> = ({
48
+ credentialQuery,
49
+ credentialRequestId,
50
+ expanded,
51
+ grouped,
52
+ headerAccessory,
53
+ labels,
54
+ lastItem,
55
+ onHeaderPress,
56
+ onImagePreview,
57
+ onSelectCredential,
58
+ onSelectField,
59
+ selectedCredentialId,
60
+ selectedFields,
61
+ style,
62
+ testID,
63
+ }) => {
64
+ const colorScheme = useAppColorScheme();
65
+ const applicableCredentials =
66
+ 'applicableCredentials' in credentialQuery ? credentialQuery.applicableCredentials : undefined;
67
+ const failureHint = 'failureHint' in credentialQuery ? credentialQuery.failureHint : undefined;
68
+ const credential = applicableCredentials?.find((c) => c.id === selectedCredentialId) ?? applicableCredentials?.[0];
69
+ const { data: config } = useCoreConfig();
70
+ const { data: walletUnitAttestation, isLoading: isLoadingWUA } = useWalletUnitAttestation();
71
+ const cardWidth = useMemo(
72
+ () => Dimensions.get('window').width - 32 - (grouped ? GroupedShareCredentialV2Padding * 2 : 0),
73
+ [grouped],
74
+ );
75
+
76
+ const multipleCredentialsAvailable = Boolean(applicableCredentials?.length && applicableCredentials.length > 1);
77
+
78
+ const validityState = getValidityState(
79
+ credential
80
+ ? {
81
+ ...credential,
82
+ issuer: credential?.issuer?.id,
83
+ }
84
+ : undefined,
85
+ );
86
+
87
+ const footer = useMemo(() => {
88
+ if (!expanded) {
89
+ return;
90
+ }
91
+ if (validityState === ValidityState.Revoked) {
92
+ return (
93
+ <ShareCredentialCardNotice
94
+ testID={concatTestID(testID, 'notice.revoked')}
95
+ text={labels.revokedCredentialNotice}
96
+ />
97
+ );
98
+ }
99
+ if (validityState === ValidityState.Suspended) {
100
+ return (
101
+ <ShareCredentialCardNotice
102
+ testID={concatTestID(testID, 'notice.suspended')}
103
+ text={labels.suspendedCredentialNotice}
104
+ />
105
+ );
106
+ }
107
+
108
+ if (failureHint?.reason === 'VALIDITY') {
109
+ return (
110
+ <ShareCredentialCardNotice
111
+ testID={concatTestID(testID, 'notice.invalid')}
112
+ text={labels.invalidCredentialNotice}
113
+ />
114
+ );
115
+ }
116
+
117
+ if (multipleCredentialsAvailable) {
118
+ return (
119
+ <SelectShareCredentialCardNotice
120
+ buttonTitle={labels.multipleCredentialsSelect}
121
+ onPress={onSelectCredential}
122
+ testID={concatTestID(testID, 'notice.multiple')}
123
+ text={labels.multipleCredentialsNotice}
124
+ />
125
+ );
126
+ }
127
+ }, [
128
+ expanded,
129
+ failureHint?.reason,
130
+ labels.invalidCredentialNotice,
131
+ labels.multipleCredentialsNotice,
132
+ labels.multipleCredentialsSelect,
133
+ labels.revokedCredentialNotice,
134
+ labels.suspendedCredentialNotice,
135
+ multipleCredentialsAvailable,
136
+ onSelectCredential,
137
+ testID,
138
+ validityState,
139
+ ]);
140
+
141
+ const onAttributeSelected = useCallback(
142
+ (fieldPath: PresentationDefinitionV2CredentialClaim['path'], selected: boolean) => {
143
+ if (!selectedCredentialId) {
144
+ return;
145
+ }
146
+ onSelectField(selectedCredentialId, fieldPath, selected);
147
+ },
148
+ [onSelectField, selectedCredentialId],
149
+ );
150
+
151
+ if (!config || isLoadingWUA) {
152
+ return null;
153
+ }
154
+
155
+ const {
156
+ card: { header, ...card },
157
+ attributes,
158
+ } = shareCredentialCardFromV2PresentationCredential(
159
+ credential,
160
+ failureHint,
161
+ Boolean(expanded),
162
+ multipleCredentialsAvailable,
163
+ selectedFields,
164
+ config,
165
+ walletUnitAttestationState(walletUnitAttestation),
166
+ testID,
167
+ labels,
168
+ );
169
+
170
+ if (headerAccessory) {
171
+ header.accessory = headerAccessory;
172
+ }
173
+
174
+ return (
175
+ <CredentialDetailsCardListItem
176
+ attributes={attributes}
177
+ card={{
178
+ ...card,
179
+ credentialId: credentialRequestId,
180
+ header,
181
+ onHeaderPress,
182
+ width: cardWidth,
183
+ }}
184
+ expanded={expanded}
185
+ footer={footer}
186
+ lastItem={lastItem}
187
+ onAttributeSelected={onAttributeSelected}
188
+ onImagePreview={onImagePreview}
189
+ style={[
190
+ styles.credential,
191
+ grouped ? styles.groupedCredential : styles.bordered,
192
+ { borderColor: colorScheme.background },
193
+ style,
194
+ ]}
195
+ testID={testID}
196
+ />
197
+ );
198
+ };
199
+
200
+ const styles = StyleSheet.create({
201
+ bordered: {
202
+ borderWidth: 1,
203
+ },
204
+ credential: {
205
+ borderRadius: 10,
206
+ marginBottom: 8,
207
+ },
208
+ groupedCredential: {
209
+ marginHorizontal: GroupedShareCredentialV2Padding,
210
+ },
211
+ });
@@ -12,6 +12,8 @@ import type { HoldButtonProps } from './hold-button';
12
12
  import HoldButton from './hold-button';
13
13
  import type { ScanButtonProps } from './scan-button';
14
14
  import ScanButton from './scan-button';
15
+ import type { ShareButtonProps } from './share-button';
16
+ import ShareButton from './share-button';
15
17
 
16
18
  export {
17
19
  BackButton,
@@ -31,4 +33,6 @@ export {
31
33
  HoldButtonProps,
32
34
  ScanButton,
33
35
  ScanButtonProps,
36
+ ShareButton,
37
+ ShareButtonProps,
34
38
  };