be-components 3.4.5 → 3.4.6

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 (42) hide show
  1. package/lib/commonjs/Share/index.js +185 -160
  2. package/lib/commonjs/Share/index.js.map +1 -1
  3. package/lib/commonjs/SocialComponents/Contacts/api/index.js +96 -0
  4. package/lib/commonjs/SocialComponents/Contacts/api/index.js.map +1 -0
  5. package/lib/commonjs/SocialComponents/Contacts/useContacts.js +137 -0
  6. package/lib/commonjs/SocialComponents/Contacts/useContacts.js.map +1 -0
  7. package/lib/commonjs/SocialComponents/index.js +7 -0
  8. package/lib/commonjs/SocialComponents/index.js.map +1 -1
  9. package/lib/module/Share/index.js +127 -102
  10. package/lib/module/Share/index.js.map +1 -1
  11. package/lib/module/SocialComponents/Contacts/api/index.js +90 -0
  12. package/lib/module/SocialComponents/Contacts/api/index.js.map +1 -0
  13. package/lib/module/SocialComponents/Contacts/useContacts.js +129 -0
  14. package/lib/module/SocialComponents/Contacts/useContacts.js.map +1 -0
  15. package/lib/module/SocialComponents/index.js +2 -1
  16. package/lib/module/SocialComponents/index.js.map +1 -1
  17. package/lib/typescript/lib/commonjs/Share/index.d.ts.map +1 -1
  18. package/lib/typescript/lib/commonjs/SocialComponents/Contacts/api/index.d.ts +11 -0
  19. package/lib/typescript/lib/commonjs/SocialComponents/Contacts/api/index.d.ts.map +1 -0
  20. package/lib/typescript/lib/commonjs/SocialComponents/Contacts/useContacts.d.ts +18 -0
  21. package/lib/typescript/lib/commonjs/SocialComponents/Contacts/useContacts.d.ts.map +1 -0
  22. package/lib/typescript/lib/commonjs/SocialComponents/index.d.ts +16 -0
  23. package/lib/typescript/lib/module/Share/index.d.ts +1 -2
  24. package/lib/typescript/lib/module/Share/index.d.ts.map +1 -1
  25. package/lib/typescript/lib/module/SocialComponents/Contacts/api/index.d.ts +10 -0
  26. package/lib/typescript/lib/module/SocialComponents/Contacts/api/index.d.ts.map +1 -0
  27. package/lib/typescript/lib/module/SocialComponents/Contacts/useContacts.d.ts +18 -0
  28. package/lib/typescript/lib/module/SocialComponents/Contacts/useContacts.d.ts.map +1 -0
  29. package/lib/typescript/lib/module/SocialComponents/index.d.ts +2 -1
  30. package/lib/typescript/lib/module/SocialComponents/index.d.ts.map +1 -1
  31. package/lib/typescript/src/Share/index.d.ts.map +1 -1
  32. package/lib/typescript/src/SocialComponents/Contacts/api/index.d.ts +15 -0
  33. package/lib/typescript/src/SocialComponents/Contacts/api/index.d.ts.map +1 -0
  34. package/lib/typescript/src/SocialComponents/Contacts/useContacts.d.ts +21 -0
  35. package/lib/typescript/src/SocialComponents/Contacts/useContacts.d.ts.map +1 -0
  36. package/lib/typescript/src/SocialComponents/index.d.ts +2 -1
  37. package/lib/typescript/src/SocialComponents/index.d.ts.map +1 -1
  38. package/package.json +4 -1
  39. package/src/Share/index.tsx +99 -76
  40. package/src/SocialComponents/Contacts/api/index.tsx +75 -0
  41. package/src/SocialComponents/Contacts/useContacts.tsx +113 -0
  42. package/src/SocialComponents/index.tsx +3 -1
@@ -0,0 +1,90 @@
1
+ import axios from "axios";
2
+ import { APIOverrides } from "../../../ApiOverrides";
3
+ let AUTH_SVC_API = '';
4
+ export { ContactsApi, ContactsHelpers };
5
+ const ContactsApi = {
6
+ setEnvironment: () => {
7
+ const endpoints = APIOverrides.getEndpoints();
8
+ AUTH_SVC_API = endpoints['AUTH_SVC_API'];
9
+ },
10
+ getPlayerByPhone: async phone => {
11
+ try {
12
+ console.log('getting playerby phone now!!!');
13
+ const resp = await axios.post(`${AUTH_SVC_API}/v1/players/player/search/phone`, {
14
+ phone
15
+ });
16
+ console.log(resp.data);
17
+ return resp.data.player;
18
+ } catch (e) {
19
+ console.log('WE HIT AN ERROR!!!!!');
20
+ return undefined;
21
+ }
22
+ },
23
+ generatePlayerByPhone: async (phone, referral_code) => {
24
+ try {
25
+ const resp = await axios.post(`${AUTH_SVC_API}/v1/players/player/phone/authenticate`, {
26
+ phone,
27
+ silent: true,
28
+ referral_code
29
+ });
30
+ return resp.data.player_id;
31
+ } catch (e) {
32
+ return undefined;
33
+ }
34
+ },
35
+ getPlayerById: async player_id => {
36
+ try {
37
+ const resp = await axios.get(`${AUTH_SVC_API}/v1/players/player/${player_id}`);
38
+ return resp.data.player;
39
+ } catch (e) {
40
+ return undefined;
41
+ }
42
+ }
43
+ };
44
+ const ContactsHelpers = {
45
+ formatContactPhoneNumber: contact => {
46
+ if (!contact.phoneNumbers) {
47
+ return undefined;
48
+ }
49
+ let us_phone_numbers = contact.phoneNumbers.filter(p => p.countryCode?.toLowerCase() == 'us');
50
+ if (us_phone_numbers.length == 0) {
51
+ return undefined;
52
+ }
53
+ //Ok, we have some US numbers!. Lets format them
54
+ let us_phone_number = us_phone_numbers.find(n => n.isPrimary);
55
+ if (!us_phone_number) {
56
+ us_phone_number = us_phone_numbers.find(n => n.label?.toLowerCase() == 'mobile');
57
+ }
58
+ if (!us_phone_number) {
59
+ us_phone_number = us_phone_numbers[0];
60
+ }
61
+ if (!us_phone_number) {
62
+ return undefined;
63
+ }
64
+ if (!us_phone_number.digits) {
65
+ return undefined;
66
+ }
67
+ let split_num = us_phone_number.digits.split('+');
68
+ //Now check the split for the number
69
+ let number = '';
70
+ if (split_num.length == 1) {
71
+ if (split_num[0]) {
72
+ number = split_num[0];
73
+ }
74
+ }
75
+ if (split_num[1]) {
76
+ number = split_num[1];
77
+ }
78
+
79
+ //If it is ten digits - lets add to array
80
+ if (number.length == 11) {
81
+ //Drop the first 1
82
+ number = number.substring(1);
83
+ }
84
+ if (number.length != 10) {
85
+ return undefined;
86
+ }
87
+ return number;
88
+ }
89
+ };
90
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["axios","APIOverrides","AUTH_SVC_API","ContactsApi","ContactsHelpers","setEnvironment","endpoints","getEndpoints","getPlayerByPhone","phone","console","log","resp","post","data","player","e","undefined","generatePlayerByPhone","referral_code","silent","player_id","getPlayerById","get","formatContactPhoneNumber","contact","phoneNumbers","us_phone_numbers","filter","p","countryCode","toLowerCase","length","us_phone_number","find","n","isPrimary","label","digits","split_num","split","number","substring"],"sourceRoot":"../../../../../src","sources":["SocialComponents/Contacts/api/index.tsx"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,YAAY,QAAQ,uBAAuB;AAIpD,IAAIC,YAAY,GAAG,EAAE;AAGrB,SAASC,WAAW,EAAEC,eAAe;AAErC,MAAMD,WAAW,GAAG;EAChBE,cAAc,EAAEA,CAAA,KAAM;IAClB,MAAMC,SAAS,GAAGL,YAAY,CAACM,YAAY,CAAC,CAAC;IAC7CL,YAAY,GAAGI,SAAS,CAAC,cAAc,CAAW;EACtD,CAAC;EACDE,gBAAgB,EAAE,MAAMC,KAAY,IAA4C;IAC5E,IAAI;MACAC,OAAO,CAACC,GAAG,CAAC,+BAA+B,CAAC;MAC5C,MAAMC,IAAI,GAAG,MAAMZ,KAAK,CAACa,IAAI,CAAC,GAAGX,YAAY,iCAAiC,EAAE;QAAEO;MAAM,CAAC,CAAC;MAC1FC,OAAO,CAACC,GAAG,CAACC,IAAI,CAACE,IAAI,CAAC;MACtB,OAAOF,IAAI,CAACE,IAAI,CAACC,MAAM;IAC3B,CAAC,CAAC,OAAOC,CAAC,EAAE;MACRN,OAAO,CAACC,GAAG,CAAC,sBAAsB,CAAC;MACnC,OAAOM,SAAS;IACpB;EACJ,CAAC;EACDC,qBAAqB,EAAE,MAAAA,CAAOT,KAAY,EAAEU,aAAqB,KAAgD;IAC7G,IAAI;MACA,MAAMP,IAAI,GAAG,MAAMZ,KAAK,CAACa,IAAI,CAAC,GAAGX,YAAY,uCAAuC,EAAE;QAAEO,KAAK;QAAEW,MAAM,EAAC,IAAI;QAAED;MAAc,CAAC,CAAC;MAC5H,OAAOP,IAAI,CAACE,IAAI,CAACO,SAAS;IAC9B,CAAC,CAAC,OAAOL,CAAC,EAAE;MACR,OAAOC,SAAS;IACpB;EACJ,CAAC;EACDK,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AAI,CAAC,EAAC;MAAE,IAAGO,SAAS,CAAC,CAAC,CAAC,EAAC;QAAEE,MAAM,GAAGF,SAAS,CAAC,CAAC,CAAC;MAAC;IAAE;IACrE,IAAGA,SAAS,CAAC,CAAC,CAAC,EAAC;MAAEE,MAAM,GAAGF,SAAS,CAAC,CAAC,CAAC;IAAC;;IAExC;IACA,IAAGE,MAAM,CAACT,MAAM,IAAI,EAAE,EAAC;MACnB;MACAS,MAAM,GAAGA,MAAM,CAACC,SAAS,CAAC,CAAC,CAAC;IAChC;IACA,IAAGD,MAAM,CAACT,MAAM,IAAI,EAAE,EAAC;MAAE,OAAOf,SAAS;IAAC;IAC1C,OAAOwB,MAAM;EACjB;AACJ,CAAC","ignoreList":[]}
@@ -0,0 +1,129 @@
1
+ import { useEffect, useState } from 'react';
2
+ import * as Contacts from 'expo-contacts';
3
+ import { ContactsApi, ContactsHelpers } from './api';
4
+ const useContacts = ({
5
+ referral_code
6
+ }) => {
7
+ const [permission_state, setPermissionState] = useState({
8
+ permission_checked: false
9
+ });
10
+ const [contact_loading, setContactLoading] = useState(false);
11
+ const {
12
+ permission_checked,
13
+ permission
14
+ } = permission_state;
15
+ const [available_state, setAvailableState] = useState({
16
+ is_available_checked: false,
17
+ is_available: false
18
+ });
19
+ const {
20
+ is_available_checked,
21
+ is_available
22
+ } = available_state;
23
+ useEffect(() => {
24
+ ContactsApi.setEnvironment();
25
+ launch();
26
+ }, []);
27
+ const launch = async () => {
28
+ if (is_available_checked) {
29
+ return;
30
+ } //Already checked!
31
+ let avail = await checkAvailable();
32
+ if (!avail) {
33
+ return;
34
+ }
35
+ await checkPermissions();
36
+ };
37
+ const checkAvailable = async () => {
38
+ try {
39
+ const available = await Contacts.isAvailableAsync();
40
+ setAvailableState({
41
+ is_available_checked: true,
42
+ is_available: available
43
+ });
44
+ return available;
45
+ } catch (e) {
46
+ setAvailableState({
47
+ is_available_checked: false,
48
+ is_available: false
49
+ });
50
+ return false;
51
+ }
52
+ };
53
+ const checkPermissions = async () => {
54
+ try {
55
+ const response = await Contacts.getPermissionsAsync();
56
+ setPermissionState({
57
+ permission_checked: true,
58
+ permission: response
59
+ });
60
+ return response;
61
+ } catch (e) {
62
+ setPermissionState({
63
+ permission_checked: true
64
+ });
65
+ return undefined;
66
+ }
67
+ };
68
+ const requestPermissions = async () => {
69
+ try {
70
+ const response = await Contacts.requestPermissionsAsync();
71
+ setPermissionState({
72
+ permission_checked: true,
73
+ permission: response
74
+ });
75
+ return response;
76
+ } catch (e) {
77
+ return undefined;
78
+ }
79
+ };
80
+ const getContact = async () => {
81
+ try {
82
+ if (!permission?.granted) {
83
+ return undefined;
84
+ } //We do not have permission
85
+ setContactLoading(true);
86
+ const contact = await Contacts.presentContactPickerAsync();
87
+ if (!contact) {
88
+ setContactLoading(false);
89
+ return undefined;
90
+ }
91
+ let number = ContactsHelpers.formatContactPhoneNumber(contact);
92
+ if (!number) {
93
+ return undefined;
94
+ }
95
+ //Lets check for the player by phone!
96
+ let player = await ContactsApi.getPlayerByPhone(number);
97
+ if (!player) {
98
+ //ok we need to save the number so we can grab a player id for it
99
+ const gen_response = await ContactsApi.generatePlayerByPhone(number, referral_code);
100
+ if (!gen_response) {
101
+ return undefined;
102
+ } //We failed!
103
+ player = await ContactsApi.getPlayerById(gen_response.player_id);
104
+ if (!player) {
105
+ return undefined;
106
+ }
107
+ }
108
+ return {
109
+ player,
110
+ number
111
+ };
112
+ } catch (e) {
113
+ return undefined;
114
+ }
115
+ };
116
+ return {
117
+ is_available_checked,
118
+ is_available,
119
+ permission_checked,
120
+ permission,
121
+ contact_loading,
122
+ checkPermissions,
123
+ checkAvailable,
124
+ requestPermissions,
125
+ getContact
126
+ };
127
+ };
128
+ export { useContacts };
129
+ //# sourceMappingURL=useContacts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","useState","Contacts","ContactsApi","ContactsHelpers","useContacts","referral_code","permission_state","setPermissionState","permission_checked","contact_loading","setContactLoading","permission","available_state","setAvailableState","is_available_checked","is_available","setEnvironment","launch","avail","checkAvailable","checkPermissions","available","isAvailableAsync","e","response","getPermissionsAsync","undefined","requestPermissions","requestPermissionsAsync","getContact","granted","contact","presentContactPickerAsync","number","formatContactPhoneNumber","player","getPlayerByPhone","gen_response","generatePlayerByPhone","getPlayerById","player_id"],"sourceRoot":"../../../../src","sources":["SocialComponents/Contacts/useContacts.tsx"],"mappings":"AAAA,SAASA,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAC3C,OAAO,KAAKC,QAAQ,MAAM,eAAe;AAEzC,SAASC,WAAW,EAAEC,eAAe,QAAQ,OAAO;AAMpD,MAAMC,WAAW,GAAGA,CAAC;EAAEC;AAA8B,CAAC,KAAK;EACvD,MAAM,CAAEC,gBAAgB,EAAEC,kBAAkB,CAAE,GAAGP,QAAQ,CAGtD;IACCQ,kBAAkB,EAAC;EACvB,CAAC,CAAC;EACF,MAAM,CAAEC,eAAe,EAAEC,iBAAiB,CAAE,GAAGV,QAAQ,CAAC,KAAK,CAAC;EAC9D,MAAM;IAAEQ,kBAAkB;IAAEG;EAAW,CAAC,GAAGL,gBAAgB;EAC3D,MAAM,CAAEM,eAAe,EAAEC,iBAAiB,CAAE,GAAGb,QAAQ,CAGpD;IACCc,oBAAoB,EAAE,KAAK;IAC3BC,YAAY,EAAE;EAClB,CAAC,CAAC;EACF,MAAM;IAAED,oBAAoB;IAAEC;EAAa,CAAC,GAAGH,eAAe;EAE9Db,SAAS,CAAC,MAAM;IACZG,WAAW,CAACc,cAAc,CAAC,CAAC;IAC5BC,MAAM,CAAC,CAAC;EACZ,CAAC,EAAC,EAAE,CAAC;EAEL,MAAMA,MAAM,GAAG,MAAAA,CAAA,KAAW;IACtB,IAAGH,oBAAoB,EAAC;MAAE;IAAO,CAAC,CAAC;IACnC,IAAII,KAAK,GAAG,MAAMC,cAAc,CAAC,CAAC;IAClC,IAAG,CAACD,KAAK,EAAC;MAAE;IAAO;IACnB,MAAME,gBAAgB,CAAC,CAAC;EAC5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AiB,CAAC,IAAI,CAAC;MACvB,MAAMqB,OAAO,GAAG,MAAM9B,QAAQ,CAAC+B,yBAAyB,CAAC,CAAC;MAC1D,IAAG,CAACD,OAAO,EAAC;QACRrB,iBAAiB,CAAC,KAAK,CAAC;QACxB,OAAOgB,SAAS;MACpB;MACA,IAAIO,MAAM,GAAG9B,eAAe,CAAC+B,wBAAwB,CAACH,OAAO,CAAC;MAE9D,IAAG,CAACE,MAAM,EAAC;QAAE,OAAOP,SAAS;MAAC;MAC9B;MACA,IAAIS,MAAM,GAAG,MAAMjC,WAAW,CAACkC,gBAAgB,CAACH,MAAM,CAAC;MACvD,IAAG,CAACE,MAAM,EAAC;QACP;QACA,MAAME,YAAY,GAAG,MAAMnC,WAAW,CAACoC,qBAAqB,CAACL,MAAM,EAAE5B,aAAa,CAAC;QACnF,IAAG,CAACgC,YAAY,EAAC;UAAE,OAAOX,SAAS;QAAC,CAAC,CAAC;QACtCS,MAAM,GAAG,MAAMjC,WAAW,CAACqC,aAAa,CAACF,YAAY,CAACG,SAAS,CAAC;QAChE,IAAG,CAACL,MAAM,EAAC;UAAE,OAAOT,SAAS;QAAC;MAClC;MACA,OAAO;QAAES,MAAM;QAAEF;MAAO,CAAC;IAE7B,CAAC,CAAC,OAAOV,CAAC,EAAE;MACR,OAAOG,SAAS;IACpB;EACJ,CAAC;EAED,OAAO;IAAEZ,oBAAoB;IAAEC,YAAY;IAAEP,kBAAkB;IAAEG,UAAU;IAAEF,eAAe;IAAEW,gBAAgB;IAAED,cAAc;IAAEQ,kBAAkB;IAAEE;EAAW,CAAC;AAEpK,CAAC;AAED,SAASzB,WAAW","ignoreList":[]}
@@ -4,5 +4,6 @@ import PlayerProfile from "./PlayerProfile";
4
4
  import CompanyProfile from './CompanyProfile';
5
5
  import PodcastModule from './PodcastModule';
6
6
  import AudioPlayer from "./AudioPlayer";
7
- export { PlayerCard, PlayerList, PlayerProfile, CompanyProfile, PodcastModule, AudioPlayer };
7
+ import { useContacts } from "./Contacts/useContacts";
8
+ export { PlayerCard, PlayerList, PlayerProfile, CompanyProfile, PodcastModule, AudioPlayer, useContacts };
8
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["PlayerCard","PlayerList","PlayerProfile","CompanyProfile","PodcastModule","AudioPlayer"],"sourceRoot":"../../../src","sources":["SocialComponents/index.tsx"],"mappings":"AAAA,OAAOA,UAAU,MAAM,cAAc;AACrC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,WAAW,MAAM,eAAe;AACvC,SACIL,UAAU,EACVC,UAAU,EACVC,aAAa,EACbC,cAAc,EACdC,aAAa,EACbC,WAAW","ignoreList":[]}
1
+ {"version":3,"names":["PlayerCard","PlayerList","PlayerProfile","CompanyProfile","PodcastModule","AudioPlayer","useContacts"],"sourceRoot":"../../../src","sources":["SocialComponents/index.tsx"],"mappings":"AAAA,OAAOA,UAAU,MAAM,cAAc;AACrC,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,cAAc,MAAM,kBAAkB;AAC7C,OAAOC,aAAa,MAAM,iBAAiB;AAC3C,OAAOC,WAAW,MAAM,eAAe;AACvC,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SACIN,UAAU,EACVC,UAAU,EACVC,aAAa,EACbC,cAAc,EACdC,aAAa,EACbC,WAAW,EACXC,WAAW","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commonjs/Share/index.js"],"names":[],"mappings":";;AAuCA;;;;;;;;;;;;;;;;QAsjBC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../commonjs/Share/index.js"],"names":[],"mappings":";;AAoBA;;;;;;;;;;;;;;;;QAkmBC"}
@@ -0,0 +1,11 @@
1
+ export const __esModule: boolean;
2
+ export namespace ContactsApi {
3
+ function setEnvironment(): void;
4
+ function getPlayerByPhone(phone: any): Promise<any>;
5
+ function generatePlayerByPhone(phone: any, referral_code: any): Promise<any>;
6
+ function getPlayerById(player_id: any): Promise<any>;
7
+ }
8
+ export namespace ContactsHelpers {
9
+ function formatContactPhoneNumber(contact: any): string | undefined;
10
+ }
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../commonjs/SocialComponents/Contacts/api/index.js"],"names":[],"mappings":";;IAWkB,gCAGf;IACiB,oDAYjB;IACsB,6EAWtB;IACc,qDAOd;;;IAGyB,oEA2CzB"}
@@ -0,0 +1,18 @@
1
+ export const __esModule: boolean;
2
+ export function useContacts({ referral_code }: {
3
+ referral_code: any;
4
+ }): {
5
+ is_available_checked: boolean;
6
+ is_available: boolean;
7
+ permission_checked: boolean;
8
+ permission: any;
9
+ contact_loading: boolean;
10
+ checkPermissions: () => Promise<any>;
11
+ checkAvailable: () => Promise<any>;
12
+ requestPermissions: () => Promise<any>;
13
+ getContact: () => Promise<{
14
+ player: any;
15
+ number: string;
16
+ } | undefined>;
17
+ };
18
+ //# sourceMappingURL=useContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContacts.d.ts","sourceRoot":"","sources":["../../../../../commonjs/SocialComponents/Contacts/useContacts.js"],"names":[],"mappings":";AAWA;;;;;;;;;;;;;;;EA2HC"}
@@ -5,4 +5,20 @@ export const PlayerCard: any;
5
5
  export const PlayerList: any;
6
6
  export const PlayerProfile: any;
7
7
  export const PodcastModule: any;
8
+ export const useContacts: ({ referral_code }: {
9
+ referral_code: any;
10
+ }) => {
11
+ is_available_checked: boolean;
12
+ is_available: boolean;
13
+ permission_checked: boolean;
14
+ permission: any;
15
+ contact_loading: boolean;
16
+ checkPermissions: () => Promise<any>;
17
+ checkAvailable: () => Promise<any>;
18
+ requestPermissions: () => Promise<any>;
19
+ getContact: () => Promise<{
20
+ player: any;
21
+ number: string;
22
+ } | undefined>;
23
+ };
8
24
  //# sourceMappingURL=index.d.ts.map
@@ -15,7 +15,6 @@ declare function ShareWidget({ generated_link_id, title, body, redirect_url, max
15
15
  embed: any;
16
16
  onCancel: any;
17
17
  onShare: any;
18
- }): React.CElement<import("react-native").ViewProps, View>;
19
- import { View } from 'react-native';
18
+ }): React.FunctionComponentElement<any>;
20
19
  import React from 'react';
21
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/Share/index.js"],"names":[],"mappings":";AA8BA;;;;;;;;;;;;;;;;2DAsjBC;qBAllBoG,cAAc;kBAFxE,OAAO"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/Share/index.js"],"names":[],"mappings":";AAWA;;;;;;;;;;;;;;;;wCAkmBC;kBA7mB0C,OAAO"}
@@ -0,0 +1,10 @@
1
+ export namespace ContactsApi {
2
+ function setEnvironment(): void;
3
+ function getPlayerByPhone(phone: any): Promise<any>;
4
+ function generatePlayerByPhone(phone: any, referral_code: any): Promise<any>;
5
+ function getPlayerById(player_id: any): Promise<any>;
6
+ }
7
+ export namespace ContactsHelpers {
8
+ function formatContactPhoneNumber(contact: any): string | undefined;
9
+ }
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../module/SocialComponents/Contacts/api/index.js"],"names":[],"mappings":";IAKkB,gCAGf;IACiB,oDAYjB;IACsB,6EAWtB;IACc,qDAOd;;;IAGyB,oEA2CzB"}
@@ -0,0 +1,18 @@
1
+ export function useContacts({ referral_code }: {
2
+ referral_code: any;
3
+ }): {
4
+ is_available_checked: boolean;
5
+ is_available: boolean;
6
+ permission_checked: boolean;
7
+ permission: any;
8
+ contact_loading: boolean;
9
+ checkPermissions: () => Promise<Contacts.PermissionResponse | undefined>;
10
+ checkAvailable: () => Promise<boolean>;
11
+ requestPermissions: () => Promise<Contacts.PermissionResponse | undefined>;
12
+ getContact: () => Promise<{
13
+ player: any;
14
+ number: string;
15
+ } | undefined>;
16
+ };
17
+ import * as Contacts from 'expo-contacts';
18
+ //# sourceMappingURL=useContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContacts.d.ts","sourceRoot":"","sources":["../../../../../module/SocialComponents/Contacts/useContacts.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;EA2HC;0BA7HyB,eAAe"}
@@ -4,5 +4,6 @@ import PlayerProfile from "./PlayerProfile";
4
4
  import CompanyProfile from './CompanyProfile';
5
5
  import PodcastModule from './PodcastModule';
6
6
  import AudioPlayer from "./AudioPlayer";
7
- export { PlayerCard, PlayerList, PlayerProfile, CompanyProfile, PodcastModule, AudioPlayer };
7
+ import { useContacts } from "./Contacts/useContacts";
8
+ export { PlayerCard, PlayerList, PlayerProfile, CompanyProfile, PodcastModule, AudioPlayer, useContacts };
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/SocialComponents/index.js"],"names":[],"mappings":"uBAAuB,cAAc;uBACd,cAAc;0BACX,iBAAiB;2BAChB,kBAAkB;0BACnB,iBAAiB;wBACnB,eAAe"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../module/SocialComponents/index.js"],"names":[],"mappings":"uBAAuB,cAAc;uBACd,cAAc;0BACX,iBAAiB;2BAChB,kBAAkB;0BACnB,iBAAiB;wBACnB,eAAe;4BACX,wBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Share/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAOnD,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAUjE,KA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EAAC,MAAM,CAAC;IAClB,SAAS,EAAE,QAAQ,GAAC,SAAS,GAAC,MAAM,CAAC;IACrC,SAAS,EAAE,kBAAkB,CAAC,WAAW,CAAC,CAAC;IAC3C,aAAa,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACnD,OAAO,CAAC,EAAC,MAAM,CAAC;IAChB,KAAK,CAAC,EAAC;QACH,UAAU,EAAC,MAAM,CAAC;QAClB,aAAa,CAAC,EAAC,MAAM,CAAC;QACtB,cAAc,CAAC,EAAC,GAAG,CAAC;QACpB,MAAM,CAAC,EAAC,MAAM,CAAA;KACjB,CAAC;IACF,QAAQ,EAAC,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAC,CAAC,QAAQ,EAAC,YAAY,KAAK,IAAI,CAAC;IACzC,UAAU,CAAC,EAAC,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAC,MAAM,CAAA;IAChB,SAAS,CAAC,EAAC,MAAM,CAAA;CACpB,CAAA;AAED,QAAA,MAAM,WAAW,yKAAyK,gBAAgB,sBAsWzM,CAAA;AAED,eAAe,WAAW,CAAA"}
@@ -0,0 +1,15 @@
1
+ import type { PublicPlayerProps } from "../../../types";
2
+ import type { Contact } from "expo-contacts";
3
+ export { ContactsApi, ContactsHelpers };
4
+ declare const ContactsApi: {
5
+ setEnvironment: () => void;
6
+ getPlayerByPhone: (phone: string) => Promise<PublicPlayerProps | undefined>;
7
+ generatePlayerByPhone: (phone: string, referral_code?: string) => Promise<{
8
+ player_id: string;
9
+ } | undefined>;
10
+ getPlayerById: (player_id: string) => Promise<PublicPlayerProps | undefined>;
11
+ };
12
+ declare const ContactsHelpers: {
13
+ formatContactPhoneNumber: (contact: Contact) => string | undefined;
14
+ };
15
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/SocialComponents/Contacts/api/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAK7C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA;AAEvC,QAAA,MAAM,WAAW;;8BAKiB,MAAM,KAAE,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;mCAWxC,MAAM,kBAAiB,MAAM,KAAG,OAAO,CAAC;QAAE,SAAS,EAAC,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;+BAQ9E,MAAM,KAAE,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC;CAQhF,CAAA;AAGD,QAAA,MAAM,eAAe;wCACkB,OAAO,KAAE,MAAM,GAAG,SAAS;CA4BjE,CAAA"}
@@ -0,0 +1,21 @@
1
+ import * as Contacts from 'expo-contacts';
2
+ import type { PublicPlayerProps } from '../../types';
3
+ type UseContactProps = {
4
+ referral_code?: string;
5
+ };
6
+ declare const useContacts: ({ referral_code }: UseContactProps) => {
7
+ is_available_checked: boolean;
8
+ is_available: boolean;
9
+ permission_checked: boolean;
10
+ permission: Contacts.PermissionResponse | undefined;
11
+ contact_loading: boolean;
12
+ checkPermissions: () => Promise<Contacts.PermissionResponse | undefined>;
13
+ checkAvailable: () => Promise<boolean>;
14
+ requestPermissions: () => Promise<Contacts.PermissionResponse | undefined>;
15
+ getContact: () => Promise<{
16
+ player: PublicPlayerProps;
17
+ number: string;
18
+ } | undefined>;
19
+ };
20
+ export { useContacts };
21
+ //# sourceMappingURL=useContacts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useContacts.d.ts","sourceRoot":"","sources":["../../../../../src/SocialComponents/Contacts/useContacts.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,eAAe,CAAC;AAC1C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAGrD,KAAK,eAAe,GAAG;IACnB,aAAa,CAAC,EAAC,MAAM,CAAA;CACxB,CAAA;AAED,QAAA,MAAM,WAAW,sBAAsB,eAAe;;;;;;4BA4CjB,OAAO,CAAC,QAAQ,CAAC,kBAAkB,GAAG,SAAS,CAAC;0BAdlD,OAAO,CAAC,OAAO,CAAC;8BA4BZ,OAAO,CAAC,QAAQ,CAAC,kBAAkB,GAAG,SAAS,CAAC;sBAaxD,OAAO,CAAC;QAAE,MAAM,EAAC,iBAAiB,CAAC;QAAC,MAAM,EAAC,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;CA8B9F,CAAA;AAED,OAAO,EAAE,WAAW,EAAE,CAAA"}
@@ -4,5 +4,6 @@ import PlayerProfile from "./PlayerProfile";
4
4
  import CompanyProfile from './CompanyProfile';
5
5
  import PodcastModule from './PodcastModule';
6
6
  import AudioPlayer from "./AudioPlayer";
7
- export { PlayerCard, PlayerList, PlayerProfile, CompanyProfile, PodcastModule, AudioPlayer };
7
+ import { useContacts } from "./Contacts/useContacts";
8
+ export { PlayerCard, PlayerList, PlayerProfile, CompanyProfile, PodcastModule, AudioPlayer, useContacts };
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SocialComponents/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EACH,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACd,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SocialComponents/index.tsx"],"names":[],"mappings":"AAAA,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,UAAU,MAAM,cAAc,CAAC;AACtC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EACH,UAAU,EACV,UAAU,EACV,aAAa,EACb,cAAc,EACd,aAAa,EACb,WAAW,EACX,WAAW,EACd,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "be-components",
3
- "version": "3.4.5",
3
+ "version": "3.4.6",
4
4
  "description": "Components for BettorEdge Apps",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -172,6 +172,8 @@
172
172
  "expo": "latest",
173
173
  "expo-asset": "^11.0.1",
174
174
  "expo-av": "^15.0.1",
175
+ "expo-clipboard": "^7.0.0",
176
+ "expo-contacts": "^14.0.2",
175
177
  "expo-crypto": "^14.0.1",
176
178
  "expo-dev-client": "~5.0.1",
177
179
  "expo-font": "latest",
@@ -179,6 +181,7 @@
179
181
  "expo-linear-gradient": "^14.0.1",
180
182
  "expo-location": "^18.0.1",
181
183
  "expo-sharing": "~13.0.0",
184
+ "expo-sms": "^13.0.0",
182
185
  "expo-status-bar": "~2.0.0",
183
186
  "install-expo-modules": "latest",
184
187
  "is-url": "^1.2.4",