@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.
- package/lib/commonjs/components/credential/credential.js +8 -2
- package/lib/commonjs/components/credential/credential.js.map +1 -1
- package/lib/commonjs/components/proof-request/index.js +23 -12
- package/lib/commonjs/components/proof-request/index.js.map +1 -1
- package/lib/commonjs/components/proof-request/select-share-credential-card-notice.js +37 -0
- package/lib/commonjs/components/proof-request/select-share-credential-card-notice.js.map +1 -0
- package/lib/commonjs/components/proof-request/share-credential-card-notice.js +36 -0
- package/lib/commonjs/components/proof-request/share-credential-card-notice.js.map +1 -0
- package/lib/commonjs/components/proof-request/{group.js → v1/group.js} +1 -1
- package/lib/commonjs/components/proof-request/v1/group.js.map +1 -0
- package/lib/commonjs/components/proof-request/v1/index.js +39 -0
- package/lib/commonjs/components/proof-request/v1/index.js.map +1 -0
- package/lib/commonjs/components/proof-request/{select-credential.js → v1/select-credential.js} +12 -6
- package/lib/commonjs/components/proof-request/v1/select-credential.js.map +1 -0
- package/lib/commonjs/components/proof-request/{share-credential.js → v1/share-credential.js} +33 -62
- package/lib/commonjs/components/proof-request/v1/share-credential.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/index.js +39 -0
- package/lib/commonjs/components/proof-request/v2/index.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js +55 -0
- package/lib/commonjs/components/proof-request/v2/select-credential-v2.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js +164 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2-group.js.map +1 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js +135 -0
- package/lib/commonjs/components/proof-request/v2/share-credential-v2.js.map +1 -0
- package/lib/commonjs/ui-components/buttons/index.js +7 -0
- package/lib/commonjs/ui-components/buttons/index.js.map +1 -1
- package/lib/commonjs/ui-components/buttons/share-button.js +54 -0
- package/lib/commonjs/ui-components/buttons/share-button.js.map +1 -0
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js +5 -1
- package/lib/commonjs/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js +16 -42
- package/lib/commonjs/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js +3 -1
- package/lib/commonjs/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/commonjs/ui-components/credential/group/credential-group-header.js +72 -0
- package/lib/commonjs/ui-components/credential/group/credential-group-header.js.map +1 -0
- package/lib/commonjs/ui-components/credential/group/index.js +14 -0
- package/lib/commonjs/ui-components/credential/group/index.js.map +1 -0
- package/lib/commonjs/ui-components/credential/index.js +12 -0
- package/lib/commonjs/ui-components/credential/index.js.map +1 -1
- package/lib/commonjs/ui-components/header/foldable-header.js +29 -17
- package/lib/commonjs/ui-components/header/foldable-header.js.map +1 -1
- package/lib/commonjs/ui-components/icons/icons.js +24 -1
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/index.js +22 -0
- package/lib/commonjs/ui-components/index.js.map +1 -1
- package/lib/commonjs/ui-components/loader/loading-result.js +8 -1
- package/lib/commonjs/ui-components/loader/loading-result.js.map +1 -1
- package/lib/commonjs/ui-components/nfc/index.js +14 -0
- package/lib/commonjs/ui-components/nfc/index.js.map +1 -0
- package/lib/commonjs/ui-components/nfc/nfc-process.js +77 -0
- package/lib/commonjs/ui-components/nfc/nfc-process.js.map +1 -0
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js +477 -475
- package/lib/commonjs/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/commonjs/ui-components/proof-request/index.js +13 -0
- package/lib/commonjs/ui-components/proof-request/index.js.map +1 -0
- package/lib/commonjs/ui-components/proof-request/proof-request-set.js +47 -0
- package/lib/commonjs/ui-components/proof-request/proof-request-set.js.map +1 -0
- package/lib/commonjs/ui-components/screens/section-list-screen.js +37 -8
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/utils/array.js.map +1 -1
- package/lib/commonjs/utils/hooks/app-state.js +33 -0
- package/lib/commonjs/utils/hooks/app-state.js.map +1 -0
- package/lib/commonjs/utils/hooks/core/backup.js +4 -5
- package/lib/commonjs/utils/hooks/core/backup.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/core-init.js +4 -22
- package/lib/commonjs/utils/hooks/core/core-init.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/credentials.js +10 -3
- package/lib/commonjs/utils/hooks/core/credentials.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js +1 -1
- package/lib/commonjs/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/index.js +11 -0
- package/lib/commonjs/utils/hooks/core/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/proofs.js +45 -8
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/wallet-unit.js +85 -0
- package/lib/commonjs/utils/hooks/core/wallet-unit.js.map +1 -0
- package/lib/commonjs/utils/hooks/index.js +22 -0
- package/lib/commonjs/utils/hooks/index.js.map +1 -1
- package/lib/commonjs/utils/hooks/nfc/nfc-status.js +40 -0
- package/lib/commonjs/utils/hooks/nfc/nfc-status.js.map +1 -0
- package/lib/commonjs/utils/hooks/revocation/credential-status.js +1 -1
- package/lib/commonjs/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/commonjs/utils/index.js +24 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js +190 -0
- package/lib/commonjs/utils/parsers/credential-sharing-v2.js.map +1 -0
- package/lib/commonjs/utils/parsers/credential-sharing.js +31 -18
- package/lib/commonjs/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/commonjs/utils/parsers/credential.js +111 -63
- package/lib/commonjs/utils/parsers/credential.js.map +1 -1
- package/lib/commonjs/utils/parsers/index.js +11 -0
- package/lib/commonjs/utils/parsers/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +4 -4
- package/lib/commonjs/utils/parsers/query.js.map +1 -1
- package/lib/commonjs/utils/url.js +80 -0
- package/lib/commonjs/utils/url.js.map +1 -0
- package/lib/commonjs/utils/wallet-unit.js +30 -0
- package/lib/commonjs/utils/wallet-unit.js.map +1 -0
- package/lib/module/components/credential/credential.js +8 -2
- package/lib/module/components/credential/credential.js.map +1 -1
- package/lib/module/components/proof-request/index.js +4 -3
- package/lib/module/components/proof-request/index.js.map +1 -1
- package/lib/module/components/proof-request/select-share-credential-card-notice.js +29 -0
- package/lib/module/components/proof-request/select-share-credential-card-notice.js.map +1 -0
- package/lib/module/components/proof-request/share-credential-card-notice.js +28 -0
- package/lib/module/components/proof-request/share-credential-card-notice.js.map +1 -0
- package/lib/module/components/proof-request/{group.js → v1/group.js} +1 -1
- package/lib/module/components/proof-request/v1/group.js.map +1 -0
- package/lib/module/components/proof-request/v1/index.js +4 -0
- package/lib/module/components/proof-request/v1/index.js.map +1 -0
- package/lib/module/components/proof-request/{select-credential.js → v1/select-credential.js} +12 -6
- package/lib/module/components/proof-request/v1/select-credential.js.map +1 -0
- package/lib/module/components/proof-request/v1/share-credential.js +118 -0
- package/lib/module/components/proof-request/v1/share-credential.js.map +1 -0
- package/lib/module/components/proof-request/v2/index.js +4 -0
- package/lib/module/components/proof-request/v2/index.js.map +1 -0
- package/lib/module/components/proof-request/v2/select-credential-v2.js +46 -0
- package/lib/module/components/proof-request/v2/select-credential-v2.js.map +1 -0
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js +154 -0
- package/lib/module/components/proof-request/v2/share-credential-v2-group.js.map +1 -0
- package/lib/module/components/proof-request/v2/share-credential-v2.js +126 -0
- package/lib/module/components/proof-request/v2/share-credential-v2.js.map +1 -0
- package/lib/module/ui-components/buttons/index.js +2 -1
- package/lib/module/ui-components/buttons/index.js.map +1 -1
- package/lib/module/ui-components/buttons/share-button.js +47 -0
- package/lib/module/ui-components/buttons/share-button.js.map +1 -0
- package/lib/module/ui-components/camera/qr-code-scanner.js +5 -1
- package/lib/module/ui-components/camera/qr-code-scanner.js.map +1 -1
- package/lib/module/ui-components/credential/card/credential-details-list-item.js +19 -45
- package/lib/module/ui-components/credential/card/credential-details-list-item.js.map +1 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js +3 -1
- package/lib/module/ui-components/credential/credential-attribute-item.js.map +1 -1
- package/lib/module/ui-components/credential/group/credential-group-header.js +64 -0
- package/lib/module/ui-components/credential/group/credential-group-header.js.map +1 -0
- package/lib/module/ui-components/credential/group/index.js +3 -0
- package/lib/module/ui-components/credential/group/index.js.map +1 -0
- package/lib/module/ui-components/credential/index.js +1 -0
- package/lib/module/ui-components/credential/index.js.map +1 -1
- package/lib/module/ui-components/header/foldable-header.js +29 -17
- package/lib/module/ui-components/header/foldable-header.js.map +1 -1
- package/lib/module/ui-components/icons/icons.js +22 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/index.js +2 -0
- package/lib/module/ui-components/index.js.map +1 -1
- package/lib/module/ui-components/loader/loading-result.js +8 -1
- package/lib/module/ui-components/loader/loading-result.js.map +1 -1
- package/lib/module/ui-components/nfc/index.js +3 -0
- package/lib/module/ui-components/nfc/index.js.map +1 -0
- package/lib/module/ui-components/nfc/nfc-process.js +69 -0
- package/lib/module/ui-components/nfc/nfc-process.js.map +1 -0
- package/lib/module/ui-components/pin/pin-lock-animation.js +477 -475
- package/lib/module/ui-components/pin/pin-lock-animation.js.map +1 -1
- package/lib/module/ui-components/proof-request/index.js +3 -0
- package/lib/module/ui-components/proof-request/index.js.map +1 -0
- package/lib/module/ui-components/proof-request/proof-request-set.js +39 -0
- package/lib/module/ui-components/proof-request/proof-request-set.js.map +1 -0
- package/lib/module/ui-components/screens/section-list-screen.js +36 -9
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/utils/array.js.map +1 -1
- package/lib/module/utils/hooks/app-state.js +27 -0
- package/lib/module/utils/hooks/app-state.js.map +1 -0
- package/lib/module/utils/hooks/core/backup.js +5 -6
- package/lib/module/utils/hooks/core/backup.js.map +1 -1
- package/lib/module/utils/hooks/core/core-init.js +3 -20
- package/lib/module/utils/hooks/core/core-init.js.map +1 -1
- package/lib/module/utils/hooks/core/credentials.js +11 -4
- package/lib/module/utils/hooks/core/credentials.js.map +1 -1
- package/lib/module/utils/hooks/core/identifiers.js +5 -5
- package/lib/module/utils/hooks/core/identifiers.js.map +1 -1
- package/lib/module/utils/hooks/core/index.js +1 -0
- package/lib/module/utils/hooks/core/index.js.map +1 -1
- package/lib/module/utils/hooks/core/proofs.js +45 -8
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/core/wallet-unit.js +75 -0
- package/lib/module/utils/hooks/core/wallet-unit.js.map +1 -0
- package/lib/module/utils/hooks/index.js +2 -0
- package/lib/module/utils/hooks/index.js.map +1 -1
- package/lib/module/utils/hooks/nfc/nfc-status.js +32 -0
- package/lib/module/utils/hooks/nfc/nfc-status.js.map +1 -0
- package/lib/module/utils/hooks/revocation/credential-status.js +1 -1
- package/lib/module/utils/hooks/revocation/credential-status.js.map +1 -1
- package/lib/module/utils/index.js +2 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parsers/credential-sharing-v2.js +177 -0
- package/lib/module/utils/parsers/credential-sharing-v2.js.map +1 -0
- package/lib/module/utils/parsers/credential-sharing.js +31 -18
- package/lib/module/utils/parsers/credential-sharing.js.map +1 -1
- package/lib/module/utils/parsers/credential.js +112 -64
- package/lib/module/utils/parsers/credential.js.map +1 -1
- package/lib/module/utils/parsers/index.js +1 -0
- package/lib/module/utils/parsers/index.js.map +1 -1
- package/lib/module/utils/parsers/query.js +4 -4
- package/lib/module/utils/parsers/query.js.map +1 -1
- package/lib/module/utils/url.js +71 -0
- package/lib/module/utils/url.js.map +1 -0
- package/lib/module/utils/wallet-unit.js +22 -0
- package/lib/module/utils/wallet-unit.js.map +1 -0
- package/lib/typescript/components/proof-request/index.d.ts +4 -3
- package/lib/typescript/components/proof-request/select-share-credential-card-notice.d.ts +7 -0
- package/lib/typescript/components/proof-request/share-credential-card-notice.d.ts +6 -0
- package/lib/typescript/components/proof-request/v1/index.d.ts +3 -0
- package/lib/typescript/components/proof-request/{select-credential.d.ts → v1/select-credential.d.ts} +1 -1
- package/lib/typescript/components/proof-request/{share-credential.d.ts → v1/share-credential.d.ts} +1 -1
- package/lib/typescript/components/proof-request/v2/index.d.ts +3 -0
- package/lib/typescript/components/proof-request/v2/select-credential-v2.d.ts +14 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2-group.d.ts +24 -0
- package/lib/typescript/components/proof-request/v2/share-credential-v2.d.ts +23 -0
- package/lib/typescript/ui-components/buttons/index.d.ts +3 -1
- package/lib/typescript/ui-components/buttons/share-button.d.ts +10 -0
- package/lib/typescript/ui-components/credential/group/credential-group-header.d.ts +10 -0
- package/lib/typescript/ui-components/credential/group/index.d.ts +3 -0
- package/lib/typescript/ui-components/credential/index.d.ts +1 -0
- package/lib/typescript/ui-components/header/foldable-header.d.ts +1 -0
- package/lib/typescript/ui-components/icons/icons.d.ts +1 -0
- package/lib/typescript/ui-components/index.d.ts +2 -0
- package/lib/typescript/ui-components/loader/loading-result.d.ts +2 -0
- package/lib/typescript/ui-components/nfc/index.d.ts +2 -0
- package/lib/typescript/ui-components/nfc/nfc-process.d.ts +17 -0
- package/lib/typescript/ui-components/pin/pin-lock-animation.d.ts +311 -311
- package/lib/typescript/ui-components/proof-request/index.d.ts +3 -0
- package/lib/typescript/ui-components/proof-request/proof-request-set.d.ts +7 -0
- package/lib/typescript/ui-components/screens/section-list-screen.d.ts +5 -2
- package/lib/typescript/utils/array.d.ts +1 -0
- package/lib/typescript/utils/hooks/app-state.d.ts +5 -0
- package/lib/typescript/utils/hooks/core/backup.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/core-init.d.ts +1 -3
- package/lib/typescript/utils/hooks/core/credentials.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/identifiers.d.ts +1 -1
- package/lib/typescript/utils/hooks/core/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/core/proofs.d.ts +10 -3
- package/lib/typescript/utils/hooks/core/wallet-unit.d.ts +9 -0
- package/lib/typescript/utils/hooks/index.d.ts +2 -0
- package/lib/typescript/utils/hooks/nfc/nfc-status.d.ts +6 -0
- package/lib/typescript/utils/index.d.ts +2 -0
- package/lib/typescript/utils/parsers/credential-sharing-v2.d.ts +11 -0
- package/lib/typescript/utils/parsers/credential-sharing.d.ts +11 -5
- package/lib/typescript/utils/parsers/credential.d.ts +9 -6
- package/lib/typescript/utils/parsers/index.d.ts +1 -0
- package/lib/typescript/utils/parsers/query.d.ts +2 -2
- package/lib/typescript/utils/url.d.ts +19 -0
- package/lib/typescript/utils/wallet-unit.d.ts +8 -0
- package/package.json +16 -6
- package/src/components/credential/credential.tsx +5 -1
- package/src/components/proof-request/index.ts +4 -3
- package/src/components/proof-request/select-share-credential-card-notice.tsx +37 -0
- package/src/components/proof-request/share-credential-card-notice.tsx +33 -0
- package/src/components/proof-request/{group.tsx → v1/group.tsx} +1 -1
- package/src/components/proof-request/v1/index.ts +3 -0
- package/src/components/proof-request/{select-credential.tsx → v1/select-credential.tsx} +12 -5
- package/src/components/proof-request/{share-credential.tsx → v1/share-credential.tsx} +35 -52
- package/src/components/proof-request/v2/index.ts +3 -0
- package/src/components/proof-request/v2/select-credential-v2.tsx +59 -0
- package/src/components/proof-request/v2/share-credential-v2-group.tsx +258 -0
- package/src/components/proof-request/v2/share-credential-v2.tsx +211 -0
- package/src/ui-components/buttons/index.ts +4 -0
- package/src/ui-components/buttons/share-button.stories.tsx +25 -0
- package/src/ui-components/buttons/share-button.tsx +55 -0
- package/src/ui-components/camera/qr-code-scanner.tsx +11 -2
- package/src/ui-components/credential/card/credential-details-list-item.tsx +27 -49
- package/src/ui-components/credential/credential-attribute-item.tsx +2 -0
- package/src/ui-components/credential/group/credential-group-header.tsx +70 -0
- package/src/ui-components/credential/group/index.ts +4 -0
- package/src/ui-components/credential/index.ts +1 -0
- package/src/ui-components/header/foldable-header.tsx +31 -16
- package/src/ui-components/icons/icons.tsx +22 -0
- package/src/ui-components/index.ts +2 -0
- package/src/ui-components/loader/loading-result.stories.tsx +4 -1
- package/src/ui-components/loader/loading-result.tsx +7 -0
- package/src/ui-components/nfc/index.ts +3 -0
- package/src/ui-components/nfc/nfc-process.tsx +80 -0
- package/src/ui-components/pin/pin-lock-animation.tsx +240 -278
- package/src/ui-components/proof-request/index.ts +4 -0
- package/src/ui-components/proof-request/proof-request-set.tsx +46 -0
- package/src/ui-components/screens/section-list-screen.tsx +39 -8
- package/src/utils/array.ts +4 -0
- package/src/utils/hooks/app-state.ts +29 -0
- package/src/utils/hooks/core/backup.ts +3 -9
- package/src/utils/hooks/core/core-init.ts +1 -23
- package/src/utils/hooks/core/credentials.ts +11 -4
- package/src/utils/hooks/core/identifiers.ts +15 -14
- package/src/utils/hooks/core/index.ts +2 -1
- package/src/utils/hooks/core/proofs.ts +47 -10
- package/src/utils/hooks/core/wallet-unit.ts +77 -0
- package/src/utils/hooks/index.ts +2 -0
- package/src/utils/hooks/nfc/nfc-status.ts +31 -0
- package/src/utils/hooks/revocation/credential-status.ts +1 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/parsers/credential-sharing-v2.tsx +283 -0
- package/src/utils/parsers/credential-sharing.tsx +40 -16
- package/src/utils/parsers/credential.ts +129 -59
- package/src/utils/parsers/index.ts +1 -0
- package/src/utils/parsers/query.ts +7 -5
- package/src/utils/url.ts +61 -0
- package/src/utils/wallet-unit.ts +30 -0
- package/lib/commonjs/components/proof-request/group.js.map +0 -1
- package/lib/commonjs/components/proof-request/select-credential.js.map +0 -1
- package/lib/commonjs/components/proof-request/share-credential.js.map +0 -1
- package/lib/module/components/proof-request/group.js.map +0 -1
- package/lib/module/components/proof-request/select-credential.js.map +0 -1
- package/lib/module/components/proof-request/share-credential.js +0 -147
- package/lib/module/components/proof-request/share-credential.js.map +0 -1
- /package/lib/typescript/components/proof-request/{group.d.ts → v1/group.d.ts} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
|
|
3
|
+
import ShareButton from './share-button';
|
|
4
|
+
|
|
5
|
+
const Basic: StoryObj<typeof ShareButton> = {
|
|
6
|
+
args: {
|
|
7
|
+
title: 'qr-code-date.com',
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { Basic as ShareButton };
|
|
12
|
+
|
|
13
|
+
export default {
|
|
14
|
+
title: 'base/button/Share Button',
|
|
15
|
+
component: ShareButton,
|
|
16
|
+
argTypes: {
|
|
17
|
+
onPress: { action: 'onPress' },
|
|
18
|
+
},
|
|
19
|
+
parameters: {
|
|
20
|
+
design: {
|
|
21
|
+
type: 'figma',
|
|
22
|
+
url: 'https://www.figma.com/design/52qDYWUMjXAGre1dcnz5bz/Procivis-One-Wallet?node-id=4237-32033&node-type=frame&t=TJ4R3WHLQ1CsXNeT-0',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
} as Meta<typeof ShareButton>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { concatTestID } from '../../utils';
|
|
5
|
+
import { TouchableHighlight } from '../accessibility';
|
|
6
|
+
import { LinkIcon } from '../icons';
|
|
7
|
+
import { Typography } from '../text';
|
|
8
|
+
import { useAppColorScheme } from '../theme';
|
|
9
|
+
|
|
10
|
+
export type ShareButtonProps = {
|
|
11
|
+
onPress?: () => void;
|
|
12
|
+
style?: StyleProp<ViewStyle>;
|
|
13
|
+
title?: string;
|
|
14
|
+
testID?: string;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const ShareButton: FC<ShareButtonProps> = ({
|
|
18
|
+
onPress,
|
|
19
|
+
style,
|
|
20
|
+
title,
|
|
21
|
+
testID,
|
|
22
|
+
}) => {
|
|
23
|
+
const colorScheme = useAppColorScheme();
|
|
24
|
+
|
|
25
|
+
return (
|
|
26
|
+
<TouchableHighlight onPress={onPress} style={[styles.button, style]} testID={testID}>
|
|
27
|
+
<View style={[styles.container, { backgroundColor: colorScheme.white }]}>
|
|
28
|
+
<LinkIcon color={colorScheme.text} />
|
|
29
|
+
{title && (
|
|
30
|
+
<Typography testID={concatTestID(testID, 'title')} color={colorScheme.text} preset="s">
|
|
31
|
+
{title}
|
|
32
|
+
</Typography>
|
|
33
|
+
)}
|
|
34
|
+
</View>
|
|
35
|
+
</TouchableHighlight>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const styles = StyleSheet.create({
|
|
40
|
+
button: {
|
|
41
|
+
borderRadius: 5,
|
|
42
|
+
overflow: 'hidden',
|
|
43
|
+
},
|
|
44
|
+
container: {
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
gap: 5,
|
|
48
|
+
height: 32,
|
|
49
|
+
paddingLeft: 4,
|
|
50
|
+
paddingRight: 6,
|
|
51
|
+
paddingVertical: 5,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export default ShareButton;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { useIsFocused } from '@react-navigation/native';
|
|
1
2
|
import React, { FunctionComponent, useMemo } from 'react';
|
|
2
3
|
import { StyleSheet, View, ViewProps } from 'react-native';
|
|
3
4
|
import { Camera, Code, CodeType, useCameraDevice, useCodeScanner } from 'react-native-vision-camera';
|
|
4
5
|
|
|
6
|
+
import { useIsAppActive } from '../../utils';
|
|
5
7
|
import CameraOverlay from './camera-overlay';
|
|
6
8
|
|
|
7
9
|
export type QRCodeScannerProps = ViewProps & {
|
|
@@ -18,6 +20,8 @@ const QRCodeScanner: FunctionComponent<QRCodeScannerProps> = ({
|
|
|
18
20
|
noCameraView = null,
|
|
19
21
|
...viewProps
|
|
20
22
|
}) => {
|
|
23
|
+
const isFocused = useIsFocused();
|
|
24
|
+
const isAppActive = useIsAppActive();
|
|
21
25
|
const qrCodeScanner = useCodeScanner({
|
|
22
26
|
codeTypes,
|
|
23
27
|
onCodeScanned: onQRCodeRead,
|
|
@@ -25,7 +29,7 @@ const QRCodeScanner: FunctionComponent<QRCodeScannerProps> = ({
|
|
|
25
29
|
|
|
26
30
|
const device = useCameraDevice('back');
|
|
27
31
|
|
|
28
|
-
const cameraOverlayView
|
|
32
|
+
const cameraOverlayView = useMemo(() => {
|
|
29
33
|
if (!cameraOverlay) {
|
|
30
34
|
return <CameraOverlay />;
|
|
31
35
|
}
|
|
@@ -43,7 +47,12 @@ const QRCodeScanner: FunctionComponent<QRCodeScannerProps> = ({
|
|
|
43
47
|
|
|
44
48
|
return (
|
|
45
49
|
<View {...viewProps}>
|
|
46
|
-
<Camera
|
|
50
|
+
<Camera
|
|
51
|
+
codeScanner={qrCodeScanner}
|
|
52
|
+
device={device}
|
|
53
|
+
isActive={isFocused && isAppActive !== false}
|
|
54
|
+
style={StyleSheet.absoluteFill}
|
|
55
|
+
/>
|
|
47
56
|
{cameraOverlayView}
|
|
48
57
|
</View>
|
|
49
58
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { FC, useCallback,
|
|
2
|
-
import { LayoutChangeEvent, StyleProp, StyleSheet,
|
|
3
|
-
import Animated, {
|
|
1
|
+
import React, { FC, useCallback, useState } from 'react';
|
|
2
|
+
import { LayoutChangeEvent, StyleProp, StyleSheet, ViewStyle } from 'react-native';
|
|
3
|
+
import Animated, { LinearTransition } from 'react-native-reanimated';
|
|
4
4
|
|
|
5
5
|
import { CredentialCardRatio, CredentialCardShadow } from './credential-card';
|
|
6
6
|
import CredentialDetailsCard, { CredentialDetailsCardProps } from './credential-details-card';
|
|
@@ -17,64 +17,43 @@ const CredentialDetailsCardListItem: FC<CredentialDetailsCardListItemProps> = ({
|
|
|
17
17
|
style,
|
|
18
18
|
...props
|
|
19
19
|
}) => {
|
|
20
|
-
const [cardWidth, setCardWidth] = useState<number>();
|
|
21
|
-
const [minHeight, setMinHeight] = useState<number>();
|
|
22
20
|
const [detailsCardHeight, setDetailsCardHeight] = useState<number>();
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
if (!detailsCardHeight || !minHeight) {
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
const newValue = expanded ? detailsCardHeight : minHeight;
|
|
31
|
-
if (cardListItemHeight.value === undefined) {
|
|
32
|
-
cardListItemHeight.value = newValue;
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
cardListItemHeight.value = withTiming(newValue, {
|
|
36
|
-
duration: 250,
|
|
37
|
-
});
|
|
38
|
-
}, [cardListItemHeight, detailsCardHeight, minHeight, expanded]);
|
|
39
|
-
|
|
40
|
-
const animatedCardWrapperStyle = useAnimatedStyle(() => {
|
|
41
|
-
if (cardListItemHeight.value !== undefined) {
|
|
42
|
-
return {
|
|
43
|
-
height: cardListItemHeight.value,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
if (lastItem || expanded) {
|
|
47
|
-
return {};
|
|
48
|
-
}
|
|
49
|
-
return {
|
|
50
|
-
height: 60,
|
|
51
|
-
};
|
|
52
|
-
}, [cardListItemHeight, lastItem, expanded]);
|
|
53
|
-
|
|
54
|
-
const cardWrapperStyle: ViewStyle = {
|
|
55
|
-
minHeight: cardWidth ? Math.ceil(cardWidth / CredentialCardRatio) : undefined,
|
|
56
|
-
}
|
|
21
|
+
const cardWidth = props.card.width;
|
|
22
|
+
const minHeight = lastItem ? Math.ceil(cardWidth / CredentialCardRatio) : 60;
|
|
57
23
|
|
|
58
24
|
const onContentLayout = useCallback(
|
|
59
25
|
(event: LayoutChangeEvent) => {
|
|
60
|
-
const {
|
|
26
|
+
const { height } = event.nativeEvent.layout;
|
|
61
27
|
const borderWidth = StyleSheet.flatten(style)?.borderWidth ?? 0;
|
|
62
28
|
const cardHeight = Math.round(height) + 2 * borderWidth;
|
|
63
29
|
if (cardHeight === detailsCardHeight) {
|
|
64
30
|
return;
|
|
65
31
|
}
|
|
66
|
-
setCardWidth(width);
|
|
67
|
-
if (!minHeight) {
|
|
68
|
-
setMinHeight(lastItem ? Math.ceil(width / CredentialCardRatio) : 60);
|
|
69
|
-
}
|
|
70
32
|
setDetailsCardHeight(cardHeight);
|
|
71
33
|
},
|
|
72
|
-
[
|
|
34
|
+
[style, detailsCardHeight],
|
|
73
35
|
);
|
|
74
36
|
|
|
75
37
|
return (
|
|
76
|
-
<Animated.View
|
|
77
|
-
|
|
38
|
+
<Animated.View
|
|
39
|
+
layout={LinearTransition}
|
|
40
|
+
style={[
|
|
41
|
+
styles.animatedWrapper,
|
|
42
|
+
// eslint-disable-next-line react-native/no-inline-styles
|
|
43
|
+
{
|
|
44
|
+
height: expanded ? 'auto' : minHeight,
|
|
45
|
+
},
|
|
46
|
+
style,
|
|
47
|
+
]}>
|
|
48
|
+
<Animated.View
|
|
49
|
+
layout={LinearTransition}
|
|
50
|
+
style={[
|
|
51
|
+
styles.cardWrapper,
|
|
52
|
+
// eslint-disable-next-line react-native/no-inline-styles
|
|
53
|
+
{
|
|
54
|
+
height: expanded ? 'auto' : Math.ceil(cardWidth / CredentialCardRatio),
|
|
55
|
+
},
|
|
56
|
+
]}>
|
|
78
57
|
<CredentialDetailsCard
|
|
79
58
|
animate={false}
|
|
80
59
|
expanded={true}
|
|
@@ -82,7 +61,7 @@ const CredentialDetailsCardListItem: FC<CredentialDetailsCardListItemProps> = ({
|
|
|
82
61
|
style={detailsCardStyle}
|
|
83
62
|
{...props}
|
|
84
63
|
/>
|
|
85
|
-
</View>
|
|
64
|
+
</Animated.View>
|
|
86
65
|
</Animated.View>
|
|
87
66
|
);
|
|
88
67
|
};
|
|
@@ -93,7 +72,6 @@ const styles = StyleSheet.create({
|
|
|
93
72
|
},
|
|
94
73
|
cardWrapper: {
|
|
95
74
|
borderRadius: 10,
|
|
96
|
-
height: '100%',
|
|
97
75
|
overflow: 'hidden',
|
|
98
76
|
},
|
|
99
77
|
});
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { FC, useMemo } from 'react';
|
|
2
|
+
import { AccessibilityProps, StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { concatTestID } from '../../../utils';
|
|
5
|
+
import { Typography } from '../../text';
|
|
6
|
+
import { useAppColorScheme } from '../../theme';
|
|
7
|
+
|
|
8
|
+
export interface CredentialGroupHeaderProps extends AccessibilityProps {
|
|
9
|
+
accessory?: React.ComponentType<any> | React.ReactElement;
|
|
10
|
+
name: string;
|
|
11
|
+
style?: StyleProp<ViewStyle>;
|
|
12
|
+
testID?: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const CredentialGroupHeader: FC<CredentialGroupHeaderProps> = ({ accessory, name, style, testID, ...props }) => {
|
|
16
|
+
const colorScheme = useAppColorScheme();
|
|
17
|
+
|
|
18
|
+
const accessoryView: React.ReactElement | undefined = useMemo(() => {
|
|
19
|
+
if (!accessory) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
22
|
+
if (React.isValidElement(accessory)) {
|
|
23
|
+
return accessory;
|
|
24
|
+
} else {
|
|
25
|
+
const AccessoryComponent = accessory as React.ComponentType<any>;
|
|
26
|
+
return <AccessoryComponent />;
|
|
27
|
+
}
|
|
28
|
+
}, [accessory]);
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<View {...props} style={[styles.container, style]} testID={testID}>
|
|
32
|
+
<View style={styles.text}>
|
|
33
|
+
<Typography
|
|
34
|
+
color={colorScheme.white}
|
|
35
|
+
ellipsizeMode={'tail'}
|
|
36
|
+
numberOfLines={1}
|
|
37
|
+
preset="regular"
|
|
38
|
+
style={styles.nameText}
|
|
39
|
+
testID={concatTestID(testID, 'name')}>
|
|
40
|
+
{name}
|
|
41
|
+
</Typography>
|
|
42
|
+
</View>
|
|
43
|
+
{accessoryView && <View style={styles.accessory}>{accessoryView}</View>}
|
|
44
|
+
</View>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const styles = StyleSheet.create({
|
|
49
|
+
accessory: {
|
|
50
|
+
alignItems: 'center',
|
|
51
|
+
height: 44,
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
width: 44,
|
|
54
|
+
},
|
|
55
|
+
container: {
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
flexDirection: 'row',
|
|
58
|
+
height: 60,
|
|
59
|
+
padding: 8,
|
|
60
|
+
},
|
|
61
|
+
nameText: {
|
|
62
|
+
marginTop: 2,
|
|
63
|
+
},
|
|
64
|
+
text: {
|
|
65
|
+
flex: 1,
|
|
66
|
+
justifyContent: 'center',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export default CredentialGroupHeader;
|
|
@@ -12,6 +12,7 @@ export type FoldableHeaderProps = {
|
|
|
12
12
|
searchBar?: Omit<AnimatedSearchBarProps, 'collapsed'>;
|
|
13
13
|
// if true, the header won't fold / fade out on scroll
|
|
14
14
|
staticHeader?: boolean;
|
|
15
|
+
withNotice?: boolean;
|
|
15
16
|
};
|
|
16
17
|
|
|
17
18
|
const FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({
|
|
@@ -19,12 +20,17 @@ const FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({
|
|
|
19
20
|
scrollOffset,
|
|
20
21
|
searchBar,
|
|
21
22
|
header,
|
|
23
|
+
withNotice,
|
|
22
24
|
}) => {
|
|
23
25
|
const safeAreaInsets = useSafeAreaInsets();
|
|
24
26
|
const colorScheme = useAppColorScheme();
|
|
25
27
|
const [collapsed, setCollapsed] = useState(header ? false : true);
|
|
26
28
|
const [headerHeight, setHeaderHeight] = useState<number>();
|
|
27
29
|
|
|
30
|
+
const containerPaddingStyle = {
|
|
31
|
+
paddingTop: withNotice ? 15 : safeAreaInsets.top,
|
|
32
|
+
};
|
|
33
|
+
|
|
28
34
|
useEffect(() => {
|
|
29
35
|
const id = scrollOffset.addListener(({ value }) => {
|
|
30
36
|
if (!headerHeight) {
|
|
@@ -46,15 +52,11 @@ const FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({
|
|
|
46
52
|
|
|
47
53
|
const scrollHeaderAnimatedStyle: Animated.WithAnimatedObject<ViewStyle> | undefined = playHeaderFoldAnimation
|
|
48
54
|
? {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
outputRange: [0, -headerHeight],
|
|
55
|
-
}),
|
|
56
|
-
},
|
|
57
|
-
],
|
|
55
|
+
paddingTop: scrollOffset.interpolate({
|
|
56
|
+
extrapolate: 'clamp',
|
|
57
|
+
inputRange: [0, headerHeight],
|
|
58
|
+
outputRange: [headerHeight, 0]
|
|
59
|
+
})
|
|
58
60
|
}
|
|
59
61
|
: undefined;
|
|
60
62
|
|
|
@@ -79,29 +81,42 @@ const FoldableSearchHeader: FunctionComponent<FoldableHeaderProps> = ({
|
|
|
79
81
|
<Animated.View
|
|
80
82
|
style={[
|
|
81
83
|
styles.headerContainer,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
scrollHeaderAnimatedStyle,
|
|
84
|
+
containerPaddingStyle,
|
|
85
|
+
withNotice ? styles.noticeBorderRadius : undefined,
|
|
86
86
|
]}>
|
|
87
|
-
<
|
|
87
|
+
<View style={[styles.blurWrapper, StyleSheet.absoluteFill]}>
|
|
88
|
+
<BlurView blurStyle={'header'} color={colorScheme.background} style={[
|
|
89
|
+
StyleSheet.absoluteFill,
|
|
90
|
+
withNotice ? styles.noticeBorderRadius : undefined,
|
|
91
|
+
]} />
|
|
92
|
+
</View>
|
|
88
93
|
<View>
|
|
94
|
+
<Animated.View style={scrollHeaderAnimatedStyle}>
|
|
95
|
+
{searchBar && <AnimatedSearchBar {...searchBar} collapsed={collapsed} />}
|
|
96
|
+
</Animated.View>
|
|
89
97
|
{header && (
|
|
90
|
-
<Animated.View onLayout={onHeaderLayout} style={fadeHeaderOutAnimatedStyle}>
|
|
98
|
+
<Animated.View onLayout={onHeaderLayout} style={[styles.headerContainer, fadeHeaderOutAnimatedStyle]}>
|
|
91
99
|
{header}
|
|
92
100
|
</Animated.View>
|
|
93
101
|
)}
|
|
94
|
-
{searchBar && <AnimatedSearchBar {...searchBar} collapsed={collapsed} />}
|
|
95
102
|
</View>
|
|
96
103
|
</Animated.View>
|
|
97
104
|
);
|
|
98
105
|
};
|
|
99
106
|
|
|
100
107
|
const styles = StyleSheet.create({
|
|
108
|
+
blurWrapper: {
|
|
109
|
+
overflow: 'hidden',
|
|
110
|
+
},
|
|
101
111
|
headerContainer: {
|
|
102
112
|
position: 'absolute',
|
|
103
113
|
width: '100%',
|
|
104
114
|
},
|
|
115
|
+
noticeBorderRadius: {
|
|
116
|
+
borderTopLeftRadius: 30,
|
|
117
|
+
borderTopRightRadius: 30,
|
|
118
|
+
overflow: 'hidden',
|
|
119
|
+
},
|
|
105
120
|
});
|
|
106
121
|
|
|
107
122
|
export default FoldableSearchHeader;
|
|
@@ -230,3 +230,25 @@ export const StatusWarningIcon: FC<SvgProps> = ({ ...props }) => (
|
|
|
230
230
|
/>
|
|
231
231
|
</Svg>
|
|
232
232
|
);
|
|
233
|
+
|
|
234
|
+
export const NFCIcon: FC<SvgProps> = ({ color, ...props }) => {
|
|
235
|
+
const colorScheme = useAppColorScheme();
|
|
236
|
+
const iconColor = color ?? colorScheme.black;
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<Svg fill="none" height={64} viewBox="0 0 65 64" width={65} {...props}>
|
|
240
|
+
<Path
|
|
241
|
+
d="M37.459 53.317c12.2-12.201 12.2-31.984 0-44.186A1.6 1.6 0 0139.72 6.87c13.451 13.45 13.451 35.26 0 48.71a1.601 1.601 0 01-2.262-2.262z"
|
|
242
|
+
fill={iconColor}
|
|
243
|
+
/>
|
|
244
|
+
<Path
|
|
245
|
+
d="M31.653 47.508c8.994-8.994 8.994-23.576 0-32.57a1.6 1.6 0 012.262-2.263c10.245 10.244 10.244 26.852 0 37.096a1.6 1.6 0 11-2.262-2.263z"
|
|
246
|
+
fill={iconColor}
|
|
247
|
+
/>
|
|
248
|
+
<Path
|
|
249
|
+
d="M25.847 41.705c5.788-5.789 5.788-15.174 0-20.962a1.6 1.6 0 012.262-2.263c7.038 7.038 7.038 18.45 0 25.487a1.6 1.6 0 01-2.262-2.262zM21.172 33.159a2.737 2.737 0 11-3.87-3.87 2.737 2.737 0 013.87 3.87z"
|
|
250
|
+
fill={iconColor}
|
|
251
|
+
/>
|
|
252
|
+
</Svg>
|
|
253
|
+
);
|
|
254
|
+
};
|
|
@@ -16,7 +16,9 @@ export * from './input';
|
|
|
16
16
|
export * from './list';
|
|
17
17
|
export * from './loader';
|
|
18
18
|
export * from './nerd-view';
|
|
19
|
+
export * from './nfc';
|
|
19
20
|
export * from './pin';
|
|
21
|
+
export * from './proof-request';
|
|
20
22
|
export * from './screens';
|
|
21
23
|
export * from './searchbar';
|
|
22
24
|
export * from './settings';
|
|
@@ -13,13 +13,15 @@ type Args = {
|
|
|
13
13
|
withButton2: boolean;
|
|
14
14
|
withButton3: boolean;
|
|
15
15
|
withHeader: boolean;
|
|
16
|
+
withShareButton: boolean;
|
|
16
17
|
};
|
|
17
18
|
|
|
18
|
-
const Render = ({ label, state, withButton1, withButton2, withButton3, withHeader }: Args) => {
|
|
19
|
+
const Render = ({ label, state, withButton1, withButton2, withButton3, withHeader, withShareButton }: Args) => {
|
|
19
20
|
return (
|
|
20
21
|
<LoadingResultScreen
|
|
21
22
|
button={withButton1 ? { title: 'Button 1' } : undefined}
|
|
22
23
|
secondaryButton={withButton2 ? { type: ButtonType.Secondary, title: 'Button 2' } : undefined}
|
|
24
|
+
shareButton={withShareButton ? { title: 'qr-code-date.com' } : undefined}
|
|
23
25
|
tertiaryButton={withButton3 ? { type: ButtonType.Secondary, title: 'Button 3' } : undefined}
|
|
24
26
|
header={
|
|
25
27
|
withHeader
|
|
@@ -46,6 +48,7 @@ const Basic: StoryObj<Args> = {
|
|
|
46
48
|
withButton2: false,
|
|
47
49
|
withButton3: false,
|
|
48
50
|
withHeader: true,
|
|
51
|
+
withShareButton: false,
|
|
49
52
|
},
|
|
50
53
|
render: Render,
|
|
51
54
|
};
|
|
@@ -3,6 +3,7 @@ import { Platform, StyleSheet, View, ViewProps, ViewStyle } from 'react-native';
|
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
5
|
import { Button, ButtonProps } from '../buttons/button';
|
|
6
|
+
import ShareButton, { ShareButtonProps } from '../buttons/share-button';
|
|
6
7
|
import NavigationHeader, { NavigationHeaderProps } from '../header/navigation-header';
|
|
7
8
|
import Typography from '../text/typography';
|
|
8
9
|
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
@@ -15,6 +16,7 @@ export type LoadingResultScreenProps = ViewProps & {
|
|
|
15
16
|
label?: string;
|
|
16
17
|
};
|
|
17
18
|
secondaryButton?: ButtonProps;
|
|
19
|
+
shareButton?: ShareButtonProps;
|
|
18
20
|
tertiaryButton?: ButtonProps;
|
|
19
21
|
};
|
|
20
22
|
|
|
@@ -23,6 +25,7 @@ const LoadingResultScreen: FC<LoadingResultScreenProps> = ({
|
|
|
23
25
|
header,
|
|
24
26
|
loader: { label, ...loaderProps },
|
|
25
27
|
secondaryButton: button2,
|
|
28
|
+
shareButton,
|
|
26
29
|
style,
|
|
27
30
|
tertiaryButton: button3,
|
|
28
31
|
...viewProps
|
|
@@ -55,6 +58,7 @@ const LoadingResultScreen: FC<LoadingResultScreenProps> = ({
|
|
|
55
58
|
</Typography>
|
|
56
59
|
</View>
|
|
57
60
|
<View style={[styles.buttonWrapper, buttonsWrapperMarginStyle]}>
|
|
61
|
+
{shareButton && <ShareButton {...shareButton} style={styles.shareButton} />}
|
|
58
62
|
{button && <Button {...button}>{button.title}</Button>}
|
|
59
63
|
{button2 && <Button {...button2}>{button2.title}</Button>}
|
|
60
64
|
{button3 && <Button {...button3}>{button3.title}</Button>}
|
|
@@ -92,6 +96,9 @@ const styles = StyleSheet.create({
|
|
|
92
96
|
modalHeaderWithoutHandle: {
|
|
93
97
|
paddingTop: 15,
|
|
94
98
|
},
|
|
99
|
+
shareButton: {
|
|
100
|
+
alignSelf: 'center',
|
|
101
|
+
},
|
|
95
102
|
});
|
|
96
103
|
|
|
97
104
|
export default LoadingResultScreen;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React, { FC, memo } from 'react';
|
|
2
|
+
import { Platform, StyleSheet, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { HeaderCloseButton } from '../../components';
|
|
5
|
+
import { useAppColorScheme } from '../../ui-components';
|
|
6
|
+
import { concatTestID } from '../../utils';
|
|
7
|
+
import { Typography } from '..';
|
|
8
|
+
import { Button, ButtonType } from '../buttons';
|
|
9
|
+
import { NFCIcon, StatusWarningIcon } from '../icons';
|
|
10
|
+
import { LoaderViewState } from '../loader';
|
|
11
|
+
import { ScrollViewScreen } from '../screens';
|
|
12
|
+
|
|
13
|
+
interface NFCProcessProps {
|
|
14
|
+
testID: string;
|
|
15
|
+
processState: LoaderViewState;
|
|
16
|
+
handleButtonClick: () => void;
|
|
17
|
+
labels: {
|
|
18
|
+
share: string;
|
|
19
|
+
connectivity: string;
|
|
20
|
+
close: string;
|
|
21
|
+
tryAgain: string;
|
|
22
|
+
conectivityInfo: string;
|
|
23
|
+
shareInfo: string;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const NFCProcess: FC<NFCProcessProps> = ({ testID, processState, labels, handleButtonClick }) => {
|
|
28
|
+
const colorScheme = useAppColorScheme();
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<ScrollViewScreen
|
|
32
|
+
header={{
|
|
33
|
+
leftItem: <HeaderCloseButton testID={concatTestID(testID, 'header.back')} />,
|
|
34
|
+
modalHandleVisible: Platform.OS === 'ios',
|
|
35
|
+
static: true,
|
|
36
|
+
testID: concatTestID(testID, 'header'),
|
|
37
|
+
title: processState === LoaderViewState.InProgress ? labels.share : labels.connectivity,
|
|
38
|
+
}}
|
|
39
|
+
scrollView={{
|
|
40
|
+
testID: concatTestID(testID, 'scroll'),
|
|
41
|
+
}}
|
|
42
|
+
testID={testID}>
|
|
43
|
+
<View style={styles.content} testID={concatTestID(testID, 'content')}>
|
|
44
|
+
<View style={styles.info}>
|
|
45
|
+
{processState === LoaderViewState.InProgress ? <NFCIcon width={50} height={50} /> : <StatusWarningIcon />}
|
|
46
|
+
<Typography align="center" color={colorScheme.black}>
|
|
47
|
+
{processState === LoaderViewState.InProgress ? labels.shareInfo : labels.conectivityInfo}
|
|
48
|
+
</Typography>
|
|
49
|
+
</View>
|
|
50
|
+
</View>
|
|
51
|
+
<View style={styles.bottom}>
|
|
52
|
+
<Button
|
|
53
|
+
onPress={handleButtonClick}
|
|
54
|
+
testID={concatTestID(testID, 'button')}
|
|
55
|
+
title={processState === LoaderViewState.InProgress ? labels.close : labels.tryAgain}
|
|
56
|
+
type={processState === LoaderViewState.InProgress ? ButtonType.Secondary : ButtonType.Primary}
|
|
57
|
+
/>
|
|
58
|
+
</View>
|
|
59
|
+
</ScrollViewScreen>
|
|
60
|
+
);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const styles = StyleSheet.create({
|
|
64
|
+
bottom: {
|
|
65
|
+
paddingHorizontal: 12,
|
|
66
|
+
paddingTop: 16,
|
|
67
|
+
},
|
|
68
|
+
content: {
|
|
69
|
+
flex: 1,
|
|
70
|
+
paddingHorizontal: 16,
|
|
71
|
+
},
|
|
72
|
+
info: {
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
flex: 1,
|
|
75
|
+
gap: 20,
|
|
76
|
+
justifyContent: 'center',
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export default memo(NFCProcess);
|