@procivis/one-react-native-components 0.3.62 → 0.3.71
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/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/icons/icons.js +24 -1
- package/lib/commonjs/ui-components/icons/icons.js.map +1 -1
- package/lib/commonjs/ui-components/index.js +11 -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/screens/section-list-screen.js +20 -5
- package/lib/commonjs/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/commonjs/utils/hooks/core/backup.js +3 -4
- 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/proofs.js +10 -2
- package/lib/commonjs/utils/hooks/core/proofs.js.map +1 -1
- package/lib/commonjs/utils/hooks/index.js +11 -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/index.js +12 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/utils/parsers/query.js +1 -1
- 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/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/icons/icons.js +22 -0
- package/lib/module/ui-components/icons/icons.js.map +1 -1
- package/lib/module/ui-components/index.js +1 -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/screens/section-list-screen.js +21 -6
- package/lib/module/ui-components/screens/section-list-screen.js.map +1 -1
- package/lib/module/utils/hooks/core/backup.js +4 -5
- 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/proofs.js +9 -1
- package/lib/module/utils/hooks/core/proofs.js.map +1 -1
- package/lib/module/utils/hooks/index.js +1 -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/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/module/utils/parsers/query.js +1 -1
- 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/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/icons/icons.d.ts +1 -0
- package/lib/typescript/ui-components/index.d.ts +1 -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/screens/section-list-screen.d.ts +2 -1
- 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/proofs.d.ts +9 -1
- package/lib/typescript/utils/hooks/index.d.ts +1 -0
- package/lib/typescript/utils/hooks/nfc/nfc-status.d.ts +6 -0
- package/lib/typescript/utils/index.d.ts +1 -0
- package/lib/typescript/utils/url.d.ts +19 -0
- package/package.json +7 -3
- 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/icons/icons.tsx +22 -0
- package/src/ui-components/index.ts +1 -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/screens/section-list-screen.tsx +21 -4
- package/src/utils/hooks/core/backup.ts +1 -4
- package/src/utils/hooks/core/core-init.ts +1 -23
- package/src/utils/hooks/core/proofs.ts +17 -4
- package/src/utils/hooks/index.ts +1 -0
- package/src/utils/hooks/nfc/nfc-status.ts +31 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/parsers/query.ts +1 -0
- package/src/utils/url.ts +61 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getQueryKey","queryParams","params","map","param","getQueryKeyFromCredentialListQueryParams","getQueryKeyFromHistoryListQueryParams","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","getQueryKeyFromDidListQueryParams","getQueryKeyFromIdentifierListQueryParams"],"sources":["query.ts"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n IdentifierListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\ntype QueryKey<ListQuery, ParamList> = ParamList extends ReadonlyArray<keyof ListQuery> // all params are inside the ListQuery\n ? keyof ListQuery extends ParamList[number] // all ListQuery fields are in the params\n ? Array<ListQuery[keyof ListQuery]>\n : void\n : void; // otherwise produce a wrong return type which should trigger compilation error\n\n/** Typecheck that all query params are included in the query key */\nfunction getQueryKey<ListQuery extends {}, ParamList extends ReadonlyArray<keyof ListQuery>>(\n queryParams: ListQuery,\n params: ParamList,\n): QueryKey<ListQuery, ParamList> {\n return params.map((param) => queryParams[param]) as QueryKey<ListQuery, ParamList>;\n}\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<CredentialListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'searchText',\n 'searchType',\n 'sort',\n 'sortDirection',\n 'exact',\n 'role',\n 'ids',\n 'status',\n 'include',\n 'profile',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'issuanceDateAfter',\n 'issuanceDateBefore',\n 'revocationDateAfter',\n 'revocationDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<HistoryListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'entityId',\n 'actions',\n 'entityTypes',\n 'createdDateAfter',\n 'createdDateBefore',\n 'identifierId',\n 'credentialId',\n 'credentialSchemaId',\n 'proofSchemaId',\n 'search',\n ]);\n};\n\nexport const getQueryKeyFromCredentialSchemaListQueryParams = (\n queryParams: Partial<CredentialSchemaListQuery> = {},\n) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'include',\n 'schemaId',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofSchemaListQueryParams = (queryParams: Partial<ProofSchemaListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofListQueryParams = (queryParams: Partial<ProofListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'ids',\n 'proofStates',\n 'proofRoles',\n 'proofSchemaIds',\n 'exact',\n 'profile',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'requestedDateAfter',\n 'requestedDateBefore',\n 'completedDateAfter',\n 'completedDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromDidListQueryParams = (queryParams: Partial<DidListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'did',\n 'type',\n 'deactivated',\n 'exact',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'keyIds',\n 'didMethods',\n ]);\n};\n\nexport const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<IdentifierListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'types',\n 'state',\n 'exact',\n 'didMethods',\n 'isRemote',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n"],"mapp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mB,EACnB,oBAAoB,CACrB,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["getQueryKey","queryParams","params","map","param","getQueryKeyFromCredentialListQueryParams","getQueryKeyFromHistoryListQueryParams","getQueryKeyFromCredentialSchemaListQueryParams","getQueryKeyFromProofSchemaListQueryParams","getQueryKeyFromProofListQueryParams","getQueryKeyFromDidListQueryParams","getQueryKeyFromIdentifierListQueryParams"],"sources":["query.ts"],"sourcesContent":["import {\n CredentialListQuery,\n CredentialSchemaListQuery,\n DidListQuery,\n HistoryListQuery,\n IdentifierListQuery,\n ProofListQuery,\n ProofSchemaListQuery,\n} from '@procivis/react-native-one-core';\n\ntype QueryKey<ListQuery, ParamList> = ParamList extends ReadonlyArray<keyof ListQuery> // all params are inside the ListQuery\n ? keyof ListQuery extends ParamList[number] // all ListQuery fields are in the params\n ? Array<ListQuery[keyof ListQuery]>\n : void\n : void; // otherwise produce a wrong return type which should trigger compilation error\n\n/** Typecheck that all query params are included in the query key */\nfunction getQueryKey<ListQuery extends {}, ParamList extends ReadonlyArray<keyof ListQuery>>(\n queryParams: ListQuery,\n params: ParamList,\n): QueryKey<ListQuery, ParamList> {\n return params.map((param) => queryParams[param]) as QueryKey<ListQuery, ParamList>;\n}\n\nexport const getQueryKeyFromCredentialListQueryParams = (queryParams: Partial<CredentialListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'searchText',\n 'searchType',\n 'sort',\n 'sortDirection',\n 'exact',\n 'role',\n 'ids',\n 'status',\n 'include',\n 'profile',\n 'credentialSchemaIds',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'issuanceDateAfter',\n 'issuanceDateBefore',\n 'revocationDateAfter',\n 'revocationDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromHistoryListQueryParams = (queryParams: Partial<HistoryListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'entityId',\n 'actions',\n 'entityTypes',\n 'createdDateAfter',\n 'createdDateBefore',\n 'identifierId',\n 'credentialId',\n 'credentialSchemaId',\n 'proofSchemaId',\n 'search',\n ]);\n};\n\nexport const getQueryKeyFromCredentialSchemaListQueryParams = (\n queryParams: Partial<CredentialSchemaListQuery> = {},\n) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'include',\n 'schemaId',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofSchemaListQueryParams = (queryParams: Partial<ProofSchemaListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'name',\n 'sort',\n 'sortDirection',\n 'exact',\n 'ids',\n 'formats',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n\nexport const getQueryKeyFromProofListQueryParams = (queryParams: Partial<ProofListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'ids',\n 'proofStates',\n 'proofRoles',\n 'proofSchemaIds',\n 'exact',\n 'profile',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n 'requestedDateAfter',\n 'requestedDateBefore',\n 'completedDateAfter',\n 'completedDateBefore',\n ]);\n};\n\nexport const getQueryKeyFromDidListQueryParams = (queryParams: Partial<DidListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'did',\n 'type',\n 'deactivated',\n 'exact',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'keyIds',\n 'didMethods',\n ]);\n};\n\nexport const getQueryKeyFromIdentifierListQueryParams = (queryParams: Partial<IdentifierListQuery> = {}) => {\n return getQueryKey(queryParams, [\n 'page',\n 'pageSize',\n 'organisationId',\n 'sort',\n 'sortDirection',\n 'name',\n 'types',\n 'state',\n 'exact',\n 'didMethods',\n 'isRemote',\n 'keyAlgorithms',\n 'keyRoles',\n 'keyStorages',\n 'createdDateAfter',\n 'createdDateBefore',\n 'lastModifiedAfter',\n 'lastModifiedBefore',\n ]);\n};\n"],"mappings":"AAcU;;AAEV;AACA,SAASA,WAAWA,CAClBC,WAAsB,EACtBC,MAAiB,EACe;EAChC,OAAOA,MAAM,CAACC,GAAG,CAAEC,KAAK,IAAKH,WAAW,CAACG,KAAK,CAAC,CAAC;AAClD;AAEA,OAAO,MAAMC,wCAAwC,GAAGA,CAACJ,WAAyC,GAAG,CAAC,CAAC,KAAK;EAC1G,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,MAAM,EACN,eAAe,EACf,OAAO,EACP,MAAM,EACN,KAAK,EACL,QAAQ,EACR,SAAS,EACT,SAAS,EACT,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,CACvB,CAAC;AACJ,CAAC;AAED,OAAO,MAAMK,qCAAqC,GAAGA,CAACL,WAAsC,GAAG,CAAC,CAAC,KAAK;EACpG,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,SAAS,EACT,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,eAAe,EACf,QAAQ,CACT,CAAC;AACJ,CAAC;AAED,OAAO,MAAMM,8CAA8C,GAAGA,CAC5DN,WAA+C,GAAG,CAAC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,CAAC;AAED,OAAO,MAAMU,wCAAwC,GAAGA,CAACV,WAAyC,GAAG,CAAC,CAAC,KAAK;EAC1G,OAAOD,WAAW,CAACC,WAAW,EAAE,CAC9B,MAAM,EACN,UAAU,EACV,gBAAgB,EAChB,MAAM,EACN,eAAe,EACf,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,YAAY,EACZ,UAAU,EACV,eAAe,EACf,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,CACrB,CAAC;AACJ,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { Platform } from 'react-native';
|
|
2
|
+
import Share from 'react-native-share';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Check URL validity
|
|
6
|
+
* @param {string} urlString URL to validate.
|
|
7
|
+
* @returns {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export const isUrlValid = urlString => {
|
|
10
|
+
try {
|
|
11
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
12
|
+
const url = new URL(urlString);
|
|
13
|
+
return true;
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Check URL http(s) validity
|
|
21
|
+
* @param {string} urlString URL to validate.
|
|
22
|
+
* @returns {boolean}
|
|
23
|
+
*/
|
|
24
|
+
export const isValidHttpUrl = urlString => {
|
|
25
|
+
try {
|
|
26
|
+
const url = new URL(urlString);
|
|
27
|
+
return (url === null || url === void 0 ? void 0 : url.protocol) === 'http:' || (url === null || url === void 0 ? void 0 : url.protocol) === 'https:';
|
|
28
|
+
} catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Share URL via share sheet
|
|
35
|
+
* @param {string} url URL to share.
|
|
36
|
+
* @param {string} title _(optional)_ title for iOS share sheet.
|
|
37
|
+
* @returns {boolean}
|
|
38
|
+
*/
|
|
39
|
+
export const shareUrl = async (url, title) => {
|
|
40
|
+
if (Platform.OS === 'ios') {
|
|
41
|
+
await Share.open({
|
|
42
|
+
activityItemSources: [{
|
|
43
|
+
placeholderItem: {
|
|
44
|
+
type: 'url',
|
|
45
|
+
content: url
|
|
46
|
+
},
|
|
47
|
+
item: {
|
|
48
|
+
default: {
|
|
49
|
+
type: 'url',
|
|
50
|
+
content: url
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
subject: title ? {
|
|
54
|
+
default: title
|
|
55
|
+
} : undefined,
|
|
56
|
+
linkMetadata: {
|
|
57
|
+
originalUrl: url,
|
|
58
|
+
url,
|
|
59
|
+
title
|
|
60
|
+
}
|
|
61
|
+
}],
|
|
62
|
+
failOnCancel: false
|
|
63
|
+
});
|
|
64
|
+
} else {
|
|
65
|
+
await Share.open({
|
|
66
|
+
url,
|
|
67
|
+
failOnCancel: false
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=url.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Platform","Share","isUrlValid","urlString","url","URL","isValidHttpUrl","protocol","shareUrl","title","OS","open","activityItemSources","placeholderItem","type","content","item","default","subject","undefined","linkMetadata","originalUrl","failOnCancel"],"sources":["url.ts"],"sourcesContent":["import { Platform } from 'react-native';\nimport Share from 'react-native-share';\n\n/**\n * Check URL validity\n * @param {string} urlString URL to validate.\n * @returns {boolean}\n */\nexport const isUrlValid = (urlString: string): boolean => {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const url = new URL(urlString);\n return true;\n } catch {\n return false;\n }\n};\n\n/**\n * Check URL http(s) validity\n * @param {string} urlString URL to validate.\n * @returns {boolean}\n */\nexport const isValidHttpUrl = (urlString: string): boolean => {\n try {\n const url = new URL(urlString);\n return url?.protocol === 'http:' || url?.protocol === 'https:';\n } catch {\n return false;\n }\n};\n\n/**\n * Share URL via share sheet\n * @param {string} url URL to share.\n * @param {string} title _(optional)_ title for iOS share sheet.\n * @returns {boolean}\n */\nexport const shareUrl = async (url: string, title?: string) => {\n if (Platform.OS === 'ios') {\n await Share.open({\n activityItemSources: [\n {\n placeholderItem: { type: 'url', content: url },\n item: {\n default: { type: 'url', content: url },\n },\n subject: title\n ? {\n default: title,\n }\n : undefined,\n linkMetadata: { originalUrl: url, url, title },\n },\n ],\n failOnCancel: false,\n });\n } else {\n await Share.open({ url, failOnCancel: false });\n }\n};"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,OAAOC,KAAK,MAAM,oBAAoB;;AAEtC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,UAAU,GAAIC,SAAiB,IAAc;EACxD,IAAI;IACF;IACA,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAACF,SAAS,CAAC;IAC9B,OAAO,IAAI;EACb,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,cAAc,GAAIH,SAAiB,IAAc;EAC5D,IAAI;IACF,MAAMC,GAAG,GAAG,IAAIC,GAAG,CAACF,SAAS,CAAC;IAC9B,OAAO,CAAAC,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEG,QAAQ,MAAK,OAAO,IAAI,CAAAH,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEG,QAAQ,MAAK,QAAQ;EAChE,CAAC,CAAC,MAAM;IACN,OAAO,KAAK;EACd;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,QAAQ,GAAG,MAAAA,CAAOJ,GAAW,EAAEK,KAAc,KAAK;EAC7D,IAAIT,QAAQ,CAACU,EAAE,KAAK,KAAK,EAAE;IACzB,MAAMT,KAAK,CAACU,IAAI,CAAC;MACfC,mBAAmB,EAAE,CACnB;QACEC,eAAe,EAAE;UAAEC,IAAI,EAAE,KAAK;UAAEC,OAAO,EAAEX;QAAI,CAAC;QAC9CY,IAAI,EAAE;UACJC,OAAO,EAAE;YAAEH,IAAI,EAAE,KAAK;YAAEC,OAAO,EAAEX;UAAI;QACvC,CAAC;QACDc,OAAO,EAAET,KAAK,GACV;UACEQ,OAAO,EAAER;QACX,CAAC,GACDU,SAAS;QACbC,YAAY,EAAE;UAAEC,WAAW,EAAEjB,GAAG;UAAEA,GAAG;UAAEK;QAAM;MAC/C,CAAC,CACF;MACDa,YAAY,EAAE;IAChB,CAAC,CAAC;EACJ,CAAC,MAAM;IACL,MAAMrB,KAAK,CAACU,IAAI,CAAC;MAAEP,GAAG;MAAEkB,YAAY,EAAE;IAAM,CAAC,CAAC;EAChD;AACF,CAAC","ignoreList":[]}
|
|
@@ -12,4 +12,6 @@ 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
|
-
|
|
15
|
+
import type { ShareButtonProps } from './share-button';
|
|
16
|
+
import ShareButton from './share-button';
|
|
17
|
+
export { BackButton, BackButtonIcon, BackButtonProps, Button, ButtonProps, ButtonType, ConnectivityButton, ConnectivityButtonProps, ConnectivityTransport, FilterButton, FilterButtonProps, GhostButton, GhostButtonProps, HoldButton, HoldButtonProps, ScanButton, ScanButtonProps, ShareButton, ShareButtonProps, };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
+
export type ShareButtonProps = {
|
|
4
|
+
onPress?: () => void;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
title?: string;
|
|
7
|
+
testID?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const ShareButton: FC<ShareButtonProps>;
|
|
10
|
+
export default ShareButton;
|
|
@@ -16,3 +16,4 @@ export declare const WalletUnitAttestationIcon: FC<SvgProps>;
|
|
|
16
16
|
export declare const StatusErrorIcon: FC<SvgProps>;
|
|
17
17
|
export declare const StatusSuccessIcon: FC<SvgProps>;
|
|
18
18
|
export declare const StatusWarningIcon: FC<SvgProps>;
|
|
19
|
+
export declare const NFCIcon: FC<SvgProps>;
|
|
@@ -3,6 +3,7 @@ import { ViewProps } from 'react-native';
|
|
|
3
3
|
import { ButtonProps } from '../buttons/button';
|
|
4
4
|
import { NavigationHeaderProps } from '../header/navigation-header';
|
|
5
5
|
import { LoaderViewProps } from './loader';
|
|
6
|
+
import { ShareButtonProps } from '../buttons/share-button';
|
|
6
7
|
export type LoadingResultScreenProps = ViewProps & {
|
|
7
8
|
button?: ButtonProps;
|
|
8
9
|
header?: NavigationHeaderProps;
|
|
@@ -10,6 +11,7 @@ export type LoadingResultScreenProps = ViewProps & {
|
|
|
10
11
|
label?: string;
|
|
11
12
|
};
|
|
12
13
|
secondaryButton?: ButtonProps;
|
|
14
|
+
shareButton?: ShareButtonProps;
|
|
13
15
|
tertiaryButton?: ButtonProps;
|
|
14
16
|
};
|
|
15
17
|
declare const LoadingResultScreen: FC<LoadingResultScreenProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { LoaderViewState } from '../loader';
|
|
3
|
+
interface NFCProcessProps {
|
|
4
|
+
testID: string;
|
|
5
|
+
processState: LoaderViewState;
|
|
6
|
+
handleButtonClick: () => void;
|
|
7
|
+
labels: {
|
|
8
|
+
share: string;
|
|
9
|
+
connectivity: string;
|
|
10
|
+
close: string;
|
|
11
|
+
tryAgain: string;
|
|
12
|
+
conectivityInfo: string;
|
|
13
|
+
shareInfo: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const _default: React.NamedExoticComponent<NFCProcessProps>;
|
|
17
|
+
export default _default;
|
|
@@ -7,6 +7,7 @@ export type SectionListScreenProps<ItemT, SectionT> = ViewProps & {
|
|
|
7
7
|
title: string;
|
|
8
8
|
};
|
|
9
9
|
list: Omit<SectionListProps<ItemT, SectionT>, 'ListHeaderComponent' | 'onScroll'>;
|
|
10
|
+
modalPresentation?: boolean;
|
|
10
11
|
};
|
|
11
|
-
declare const SectionListScreen: <ItemT, SectionT>({ header, list: { contentContainerStyle, stickySectionHeadersEnabled, ...listProps }, style, ...viewProps }: SectionListScreenProps<ItemT, SectionT>) => React.JSX.Element;
|
|
12
|
+
declare const SectionListScreen: <ItemT, SectionT>({ header, list: { contentContainerStyle, stickySectionHeadersEnabled, ...listProps }, modalPresentation, style, ...viewProps }: SectionListScreenProps<ItemT, SectionT>) => React.JSX.Element;
|
|
12
13
|
export default SectionListScreen;
|
|
@@ -15,4 +15,4 @@ export declare const useRollbackImport: () => import("react-query").UseMutationR
|
|
|
15
15
|
* @param {IdentifiersInitializationConfig} config Select desired keys/dids to be restored/created
|
|
16
16
|
* @returns [hwIdentifierId, swIdentifierId]
|
|
17
17
|
*/
|
|
18
|
-
export declare const useBackupFinalizeImportProcedure: ({ generateHwKey, generateSwKey,
|
|
18
|
+
export declare const useBackupFinalizeImportProcedure: ({ generateHwKey, generateSwKey, }: IdentifiersInitializationConfig) => () => Promise<[string | null, string | undefined]>;
|
|
@@ -4,15 +4,13 @@ export declare const HW_DID_NAME_PREFIX = "holder-did-hw-key";
|
|
|
4
4
|
export declare const ATTESTATION_DID_NAME_PREFIX = "holder-did-attestation-key";
|
|
5
5
|
export declare const generateHwIdentifier: (core: ONECore, organisationId: string) => Promise<string | null>;
|
|
6
6
|
export declare const generateSwIdentifier: (core: ONECore, organisationId: string) => Promise<string>;
|
|
7
|
-
export declare const generateAttestationKey: (core: ONECore, organisationId: string) => Promise<string | null>;
|
|
8
7
|
export interface IdentifiersInitializationConfig {
|
|
9
8
|
generateHwKey: boolean;
|
|
10
9
|
generateSwKey: boolean;
|
|
11
|
-
generateAttestationKey: boolean;
|
|
12
10
|
}
|
|
13
11
|
/**
|
|
14
12
|
* Create base local identifiers
|
|
15
13
|
* @param {IdentifiersInitializationConfig} config Select desired keys/dids to be created
|
|
16
14
|
* @returns [hwIdentifierId, swIdentifierId]
|
|
17
15
|
*/
|
|
18
|
-
export declare const useInitializeONECoreIdentifiers: ({ generateHwKey, generateSwKey,
|
|
16
|
+
export declare const useInitializeONECoreIdentifiers: ({ generateHwKey, generateSwKey, }: IdentifiersInitializationConfig) => () => Promise<[string | null, string | null]>;
|
|
@@ -28,7 +28,15 @@ export declare enum VerificationProtocol {
|
|
|
28
28
|
OPENID4VP_PROXIMITY_DRAFT00 = "OPENID4VP_PROXIMITY_DRAFT00",
|
|
29
29
|
SCAN_TO_VERIFY = "SCAN_TO_VERIFY"
|
|
30
30
|
}
|
|
31
|
-
export declare
|
|
31
|
+
export declare enum VerificationEngagement {
|
|
32
|
+
QR_CODE = "QR_CODE",
|
|
33
|
+
NFC = "NFC"
|
|
34
|
+
}
|
|
35
|
+
export interface ProposeProofRequest {
|
|
36
|
+
exchange: VerificationProtocol;
|
|
37
|
+
engagement: VerificationEngagement[];
|
|
38
|
+
}
|
|
39
|
+
export declare const useProposeProof: () => import("react-query").UseMutationResult<import("@procivis/react-native-one-core").ProposeProofResponse, unknown, ProposeProofRequest, unknown>;
|
|
32
40
|
export declare const useProofDelete: () => import("react-query").UseMutationResult<void, unknown, string, unknown>;
|
|
33
41
|
export declare const useProofs: (queryParams?: Partial<ProofListQuery>) => import("react-query").UseQueryResult<import("@procivis/react-native-one-core").ItemList<import("@procivis/react-native-one-core").ProofListItem>, unknown>;
|
|
34
42
|
export declare const useProofCreate: () => import("react-query").UseMutationResult<string, unknown, CreateProofRequest, unknown>;
|
|
@@ -4,5 +4,6 @@ export * from './credential-card/credential-card-expanding';
|
|
|
4
4
|
export * from './header/on-scroll-header-state';
|
|
5
5
|
export * from './list/list-content-inset';
|
|
6
6
|
export * from './navigation';
|
|
7
|
+
export * from './nfc/nfc-status';
|
|
7
8
|
export * from './pin-security/pin-security';
|
|
8
9
|
export * from './revocation/credential-status';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check URL validity
|
|
3
|
+
* @param {string} urlString URL to validate.
|
|
4
|
+
* @returns {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export declare const isUrlValid: (urlString: string) => boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Check URL http(s) validity
|
|
9
|
+
* @param {string} urlString URL to validate.
|
|
10
|
+
* @returns {boolean}
|
|
11
|
+
*/
|
|
12
|
+
export declare const isValidHttpUrl: (urlString: string) => boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Share URL via share sheet
|
|
15
|
+
* @param {string} url URL to share.
|
|
16
|
+
* @param {string} title _(optional)_ title for iOS share sheet.
|
|
17
|
+
* @returns {boolean}
|
|
18
|
+
*/
|
|
19
|
+
export declare const shareUrl: (url: string, title?: string) => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@procivis/one-react-native-components",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.71",
|
|
4
4
|
"author": "Procivis AG (https://procivis.ch)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"description": "Common Procivis ONE UI components for react-native",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@babel/runtime": "^7.25.0",
|
|
52
52
|
"@commitlint/config-conventional": "^11.0.0",
|
|
53
53
|
"@gorhom/bottom-sheet": "^5.1.2",
|
|
54
|
-
"@procivis/react-native-one-core": "1.
|
|
54
|
+
"@procivis/react-native-one-core": "1.60537.0",
|
|
55
55
|
"@procivis/react-native-picker": "5.0.3",
|
|
56
56
|
"@react-native-async-storage/async-storage": "^1.17.3",
|
|
57
57
|
"@react-native-community/blur": "^4.4.0",
|
|
@@ -120,10 +120,12 @@
|
|
|
120
120
|
"react-native-bluetooth-state-manager": "^1.3.5",
|
|
121
121
|
"react-native-builder-bob": "^0.18.0",
|
|
122
122
|
"react-native-gesture-handler": "2.24.0",
|
|
123
|
+
"react-native-nfc-manager": "^3.16.3",
|
|
123
124
|
"react-native-reanimated": "^3.17.1",
|
|
124
125
|
"react-native-reanimated-carousel": "^3.5.1",
|
|
125
126
|
"react-native-safe-area-context": "^5.3.0",
|
|
126
127
|
"react-native-screens": "^4.9.0",
|
|
128
|
+
"react-native-share": "^12.2.0",
|
|
127
129
|
"react-native-svg": "^15.11.2",
|
|
128
130
|
"react-native-system-time": "git+https://github.com/procivis/react-native-system-time.git#f184f8a45a7d6974a34dffa47544424ac9d382c3",
|
|
129
131
|
"react-native-uuid": "^2.0.1",
|
|
@@ -138,7 +140,7 @@
|
|
|
138
140
|
"vite": "^6.2.2"
|
|
139
141
|
},
|
|
140
142
|
"peerDependencies": {
|
|
141
|
-
"@procivis/react-native-one-core": "^1.
|
|
143
|
+
"@procivis/react-native-one-core": "^1.60537.0",
|
|
142
144
|
"@procivis/react-native-picker": "*",
|
|
143
145
|
"@react-native-community/blur": "*",
|
|
144
146
|
"@react-native-community/netinfo": "^11.4.1",
|
|
@@ -155,8 +157,10 @@
|
|
|
155
157
|
"react": "*",
|
|
156
158
|
"react-native": "*",
|
|
157
159
|
"react-native-bluetooth-state-manager": "^1.3.5",
|
|
160
|
+
"react-native-nfc-manager": "^3.16.3",
|
|
158
161
|
"react-native-reanimated-carousel": "*",
|
|
159
162
|
"react-native-safe-area-context": "*",
|
|
163
|
+
"react-native-share": "^12.2.0",
|
|
160
164
|
"react-native-svg": "*",
|
|
161
165
|
"react-native-system-time": "*",
|
|
162
166
|
"react-native-uuid": "^2.0.1",
|
|
@@ -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
|
};
|
|
@@ -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 { Typography } from '../text';
|
|
7
|
+
import { useAppColorScheme } from '../theme';
|
|
8
|
+
import { LinkIcon } from '../icons';
|
|
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;
|
|
@@ -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
|
+
};
|
|
@@ -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
|
};
|
|
@@ -7,6 +7,7 @@ import NavigationHeader, { NavigationHeaderProps } from '../header/navigation-he
|
|
|
7
7
|
import Typography from '../text/typography';
|
|
8
8
|
import { useAppColorScheme } from '../theme/color-scheme-context';
|
|
9
9
|
import LoaderView, { LoaderViewProps } from './loader';
|
|
10
|
+
import ShareButton, { ShareButtonProps } from '../buttons/share-button';
|
|
10
11
|
|
|
11
12
|
export type LoadingResultScreenProps = ViewProps & {
|
|
12
13
|
button?: ButtonProps;
|
|
@@ -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);
|