@saasquatch/mint-components 1.11.1-7 → 1.11.1-9
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/dist/cjs/{ShadowViewAddon-8326af86.js → ShadowViewAddon-2b0d0016.js} +1 -1
- package/dist/cjs/{copy-text-view-9b049fdc.js → copy-text-view-b2240d63.js} +29 -8
- package/dist/cjs/sqm-big-stat_38.cjs.entry.js +2 -2
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +7 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -2
- package/dist/collection/components/sqm-referral-codes/sqm-referral-codes.js +7 -1
- package/dist/collection/components/sqm-referral-codes/useReferralCodes.js +30 -9
- package/dist/esm/{ShadowViewAddon-cb42b588.js → ShadowViewAddon-81afccad.js} +1 -1
- package/dist/esm/{copy-text-view-af943b5b.js → copy-text-view-30eb24f2.js} +30 -9
- package/dist/esm/sqm-big-stat_38.entry.js +2 -2
- package/dist/esm/sqm-pagination_3.entry.js +7 -1
- package/dist/esm/sqm-stencilbook.entry.js +2 -2
- package/dist/esm-es5/{ShadowViewAddon-cb42b588.js → ShadowViewAddon-81afccad.js} +1 -1
- package/dist/esm-es5/copy-text-view-30eb24f2.js +1 -0
- package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
- package/dist/esm-es5/sqm-pagination_3.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/{p-d0ae263a.entry.js → p-1c09c85d.entry.js} +2 -2
- package/dist/mint-components/p-5ac0db5b.js +48 -0
- package/dist/mint-components/{p-2cc32a0d.system.js → p-5c2a7c12.system.js} +1 -1
- package/dist/mint-components/p-5fc8d87c.system.js +1 -1
- package/dist/mint-components/{p-50ff7999.js → p-72234fe8.js} +1 -1
- package/dist/mint-components/{p-8677cd57.system.entry.js → p-76f11db8.system.entry.js} +1 -1
- package/dist/mint-components/{p-905e08b1.entry.js → p-a21567fa.entry.js} +1 -1
- package/dist/mint-components/{p-1bdc4f75.system.entry.js → p-bbb41b23.system.entry.js} +1 -1
- package/dist/mint-components/{p-503a4056.entry.js → p-c728e889.entry.js} +1 -1
- package/dist/mint-components/{p-117e39a7.system.entry.js → p-d69163f5.system.entry.js} +1 -1
- package/dist/mint-components/p-f86a9b05.system.js +1 -0
- package/dist/types/components/sqm-referral-codes/sqm-referral-codes-view.d.ts +2 -0
- package/dist/types/components/sqm-referral-codes/useReferralCodes.d.ts +1 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/copy-text-view-af943b5b.js +0 -1
- package/dist/mint-components/p-ef918fe9.js +0 -29
- package/dist/mint-components/p-f7f77e96.system.js +0 -1
|
@@ -6,7 +6,7 @@ const global = require('./global-02e50f09.js');
|
|
|
6
6
|
const index_module = require('./index.module-df530553.js');
|
|
7
7
|
const utils = require('./utils-6847bc06.js');
|
|
8
8
|
const JSS = require('./JSS-8503a151.js');
|
|
9
|
-
const copyTextView = require('./copy-text-view-
|
|
9
|
+
const copyTextView = require('./copy-text-view-b2240d63.js');
|
|
10
10
|
const cjs = require('./cjs-1066ec21.js');
|
|
11
11
|
const mixins = require('./mixins-fe9d4112.js');
|
|
12
12
|
const useChildElements = require('./useChildElements-e0d44916.js');
|
|
@@ -7,7 +7,11 @@ const JSS = require('./JSS-8503a151.js');
|
|
|
7
7
|
const mixins = require('./mixins-fe9d4112.js');
|
|
8
8
|
|
|
9
9
|
const GET_REFERRAL_CODES = index_module.dist.gql `
|
|
10
|
-
query getCodes(
|
|
10
|
+
query getCodes(
|
|
11
|
+
$limit: Int!
|
|
12
|
+
$offset: Int!
|
|
13
|
+
$engagementMedium: UserEngagementMedium!
|
|
14
|
+
) {
|
|
11
15
|
viewer {
|
|
12
16
|
... on User {
|
|
13
17
|
referralCodeList(
|
|
@@ -22,7 +26,22 @@ const GET_REFERRAL_CODES = index_module.dist.gql `
|
|
|
22
26
|
shareLinkCodes(limit: $limit, offset: $offset) {
|
|
23
27
|
data {
|
|
24
28
|
linkCode
|
|
25
|
-
shortUrl
|
|
29
|
+
shareLink: shortUrl(
|
|
30
|
+
shareMedium: DIRECT
|
|
31
|
+
engagementMedium: EMBED
|
|
32
|
+
)
|
|
33
|
+
email: shortUrl(
|
|
34
|
+
shareMedium: EMAIL
|
|
35
|
+
engagementMedium: $engagementMedium
|
|
36
|
+
)
|
|
37
|
+
whatsApp: shortUrl(
|
|
38
|
+
shareMedium: WHATSAPP
|
|
39
|
+
engagementMedium: $engagementMedium
|
|
40
|
+
)
|
|
41
|
+
fbMessenger: shortUrl(
|
|
42
|
+
shareMedium: FBMESSENGER
|
|
43
|
+
engagementMedium: $engagementMedium
|
|
44
|
+
)
|
|
26
45
|
}
|
|
27
46
|
}
|
|
28
47
|
}
|
|
@@ -40,6 +59,7 @@ mutation test {}
|
|
|
40
59
|
`;
|
|
41
60
|
function useReferralCodes(props) {
|
|
42
61
|
const user = index_module.Q();
|
|
62
|
+
const engagementMedium = index_module.B();
|
|
43
63
|
console.log({ props });
|
|
44
64
|
const { envelope: referralData, states, callbacks, } = index_module.kn(GET_REFERRAL_CODES, (data) => {
|
|
45
65
|
var _a;
|
|
@@ -48,7 +68,7 @@ function useReferralCodes(props) {
|
|
|
48
68
|
}, {
|
|
49
69
|
limit: 1,
|
|
50
70
|
offset: 0,
|
|
51
|
-
}, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
71
|
+
}, { engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
52
72
|
const [paginationContext, setPaginationContext] = index_module.Cn({
|
|
53
73
|
namespace: REFERRAL_CODES_PAGINATION_CONTEXT,
|
|
54
74
|
initialValue: { states, callbacks },
|
|
@@ -75,15 +95,15 @@ function useReferralCodes(props) {
|
|
|
75
95
|
const data = referralData.data[0];
|
|
76
96
|
setReferralCodesContext({
|
|
77
97
|
referralCode: data.code,
|
|
78
|
-
shareLink: (_c = (_b = data.shareLinkCodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.
|
|
98
|
+
shareLink: (_c = (_b = data.shareLinkCodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.direct,
|
|
79
99
|
email: {
|
|
80
|
-
messageLink: (_e = (_d = data.shareLinkCodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.
|
|
100
|
+
messageLink: (_e = (_d = data.shareLinkCodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.email,
|
|
81
101
|
},
|
|
82
102
|
fbMessenger: {
|
|
83
|
-
messageLink: (_g = (_f = data.shareLinkCodes) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.
|
|
84
|
-
shareLink: (_j = (_h = data.shareLinkCodes) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.
|
|
103
|
+
messageLink: (_g = (_f = data.shareLinkCodes) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.fbMessenger,
|
|
104
|
+
shareLink: (_j = (_h = data.shareLinkCodes) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.fbMessenger,
|
|
85
105
|
},
|
|
86
|
-
whatsApp: { messageLink: (_l = (_k = data.shareLinkCodes) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.
|
|
106
|
+
whatsApp: { messageLink: (_l = (_k = data.shareLinkCodes) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.whatsApp },
|
|
87
107
|
});
|
|
88
108
|
}
|
|
89
109
|
}, [referralData]);
|
|
@@ -94,6 +114,7 @@ function useReferralCodes(props) {
|
|
|
94
114
|
return {
|
|
95
115
|
states: {
|
|
96
116
|
...states,
|
|
117
|
+
noCodes: referralData.totalCount === 0,
|
|
97
118
|
},
|
|
98
119
|
data: referralCodesContext,
|
|
99
120
|
callbacks: {
|
|
@@ -9,7 +9,7 @@ const index_module = require('./index.module-df530553.js');
|
|
|
9
9
|
const jsonpointer = require('./jsonpointer-11327262.js');
|
|
10
10
|
const utils = require('./utils-6847bc06.js');
|
|
11
11
|
const JSS = require('./JSS-8503a151.js');
|
|
12
|
-
const copyTextView = require('./copy-text-view-
|
|
12
|
+
const copyTextView = require('./copy-text-view-b2240d63.js');
|
|
13
13
|
const cjs = require('./cjs-1066ec21.js');
|
|
14
14
|
require('./mixins-fe9d4112.js');
|
|
15
15
|
const reRender = require('./re-render-1976e05e.js');
|
|
@@ -20,7 +20,7 @@ const index$1 = require('./index-8c6255f5.js');
|
|
|
20
20
|
const useRegistrationFormState = require('./useRegistrationFormState-876ed65d.js');
|
|
21
21
|
const utilities = require('./utilities-cec9dd36.js');
|
|
22
22
|
const AsYouType = require('./AsYouType-6788393a.js');
|
|
23
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
23
|
+
const ShadowViewAddon = require('./ShadowViewAddon-2b0d0016.js');
|
|
24
24
|
require('./sqm-portal-container-view-990a85a3.js');
|
|
25
25
|
|
|
26
26
|
const BigStat = class {
|
|
@@ -7,7 +7,7 @@ const stencilHooks_module = require('./stencil-hooks.module-72742a0b.js');
|
|
|
7
7
|
const index_module = require('./index.module-df530553.js');
|
|
8
8
|
const utils = require('./utils-6847bc06.js');
|
|
9
9
|
const JSS = require('./JSS-8503a151.js');
|
|
10
|
-
const copyTextView = require('./copy-text-view-
|
|
10
|
+
const copyTextView = require('./copy-text-view-b2240d63.js');
|
|
11
11
|
const cjs = require('./cjs-1066ec21.js');
|
|
12
12
|
require('./mixins-fe9d4112.js');
|
|
13
13
|
|
|
@@ -306,6 +306,8 @@ const ReferralCodes = class {
|
|
|
306
306
|
const viewProps = {
|
|
307
307
|
slots,
|
|
308
308
|
...props,
|
|
309
|
+
loading: props.states.loading,
|
|
310
|
+
noCodes: props.states.noCodes,
|
|
309
311
|
};
|
|
310
312
|
return index.h(ReferralCodesView, Object.assign({}, viewProps));
|
|
311
313
|
}
|
|
@@ -313,6 +315,10 @@ const ReferralCodes = class {
|
|
|
313
315
|
function useDemoReferralCodes(props) {
|
|
314
316
|
return cjs.cjs({
|
|
315
317
|
titleText: props.titleText,
|
|
318
|
+
states: {
|
|
319
|
+
noCodes: false,
|
|
320
|
+
loading: false,
|
|
321
|
+
},
|
|
316
322
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
317
323
|
}
|
|
318
324
|
|
|
@@ -8,7 +8,7 @@ require('./global-02e50f09.js');
|
|
|
8
8
|
const index_module = require('./index.module-df530553.js');
|
|
9
9
|
require('./utils-6847bc06.js');
|
|
10
10
|
const JSS = require('./JSS-8503a151.js');
|
|
11
|
-
const copyTextView = require('./copy-text-view-
|
|
11
|
+
const copyTextView = require('./copy-text-view-b2240d63.js');
|
|
12
12
|
require('./cjs-1066ec21.js');
|
|
13
13
|
require('./mixins-fe9d4112.js');
|
|
14
14
|
const GenericTableView = require('./GenericTableView-a3f48e15.js');
|
|
@@ -29,7 +29,7 @@ const sqmPortalProfileView = require('./sqm-portal-profile-view-fde54e35.js');
|
|
|
29
29
|
require('./utilities-cec9dd36.js');
|
|
30
30
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-34771d2c.js');
|
|
31
31
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-c8f91506.js');
|
|
32
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
32
|
+
const ShadowViewAddon = require('./ShadowViewAddon-2b0d0016.js');
|
|
33
33
|
const sqmPortalContainerView = require('./sqm-portal-container-view-990a85a3.js');
|
|
34
34
|
const sqmInvoiceTableView = require('./sqm-invoice-table-view-e3b03a00.js');
|
|
35
35
|
|
|
@@ -33,6 +33,8 @@ export class ReferralCodes {
|
|
|
33
33
|
const viewProps = {
|
|
34
34
|
slots,
|
|
35
35
|
...props,
|
|
36
|
+
loading: props.states.loading,
|
|
37
|
+
noCodes: props.states.noCodes,
|
|
36
38
|
};
|
|
37
39
|
return h(ReferralCodesView, Object.assign({}, viewProps));
|
|
38
40
|
}
|
|
@@ -65,7 +67,7 @@ export class ReferralCodes {
|
|
|
65
67
|
"mutable": false,
|
|
66
68
|
"complexType": {
|
|
67
69
|
"original": "DemoData<ReferralCodesViewProps>",
|
|
68
|
-
"resolved": "{ slots?: { shareButtons: VNode; shareCodes: VNode; pagination: VNode; }; titleText?: string; }",
|
|
70
|
+
"resolved": "{ slots?: { shareButtons: VNode; shareCodes: VNode; pagination: VNode; }; loading?: boolean; titleText?: string; noCodes?: boolean; }",
|
|
69
71
|
"references": {
|
|
70
72
|
"DemoData": {
|
|
71
73
|
"location": "import",
|
|
@@ -95,5 +97,9 @@ export class ReferralCodes {
|
|
|
95
97
|
function useDemoReferralCodes(props) {
|
|
96
98
|
return deepmerge({
|
|
97
99
|
titleText: props.titleText,
|
|
100
|
+
states: {
|
|
101
|
+
noCodes: false,
|
|
102
|
+
loading: false,
|
|
103
|
+
},
|
|
98
104
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
99
105
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { usePaginatedQuery, useParentState, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
1
|
+
import { useEngagementMedium, usePaginatedQuery, useParentState, useUserIdentity, } from "@saasquatch/component-boilerplate";
|
|
2
2
|
import { gql } from "graphql-request";
|
|
3
3
|
import { useEffect } from "@saasquatch/universal-hooks";
|
|
4
4
|
const GET_REFERRAL_CODES = gql `
|
|
5
|
-
query getCodes(
|
|
5
|
+
query getCodes(
|
|
6
|
+
$limit: Int!
|
|
7
|
+
$offset: Int!
|
|
8
|
+
$engagementMedium: UserEngagementMedium!
|
|
9
|
+
) {
|
|
6
10
|
viewer {
|
|
7
11
|
... on User {
|
|
8
12
|
referralCodeList(
|
|
@@ -17,7 +21,22 @@ const GET_REFERRAL_CODES = gql `
|
|
|
17
21
|
shareLinkCodes(limit: $limit, offset: $offset) {
|
|
18
22
|
data {
|
|
19
23
|
linkCode
|
|
20
|
-
shortUrl
|
|
24
|
+
shareLink: shortUrl(
|
|
25
|
+
shareMedium: DIRECT
|
|
26
|
+
engagementMedium: EMBED
|
|
27
|
+
)
|
|
28
|
+
email: shortUrl(
|
|
29
|
+
shareMedium: EMAIL
|
|
30
|
+
engagementMedium: $engagementMedium
|
|
31
|
+
)
|
|
32
|
+
whatsApp: shortUrl(
|
|
33
|
+
shareMedium: WHATSAPP
|
|
34
|
+
engagementMedium: $engagementMedium
|
|
35
|
+
)
|
|
36
|
+
fbMessenger: shortUrl(
|
|
37
|
+
shareMedium: FBMESSENGER
|
|
38
|
+
engagementMedium: $engagementMedium
|
|
39
|
+
)
|
|
21
40
|
}
|
|
22
41
|
}
|
|
23
42
|
}
|
|
@@ -35,6 +54,7 @@ mutation test {}
|
|
|
35
54
|
`;
|
|
36
55
|
export function useReferralCodes(props) {
|
|
37
56
|
const user = useUserIdentity();
|
|
57
|
+
const engagementMedium = useEngagementMedium();
|
|
38
58
|
console.log({ props });
|
|
39
59
|
const { envelope: referralData, states, callbacks, } = usePaginatedQuery(GET_REFERRAL_CODES, (data) => {
|
|
40
60
|
var _a;
|
|
@@ -43,7 +63,7 @@ export function useReferralCodes(props) {
|
|
|
43
63
|
}, {
|
|
44
64
|
limit: 1,
|
|
45
65
|
offset: 0,
|
|
46
|
-
}, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
66
|
+
}, { engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
47
67
|
const [paginationContext, setPaginationContext] = useParentState({
|
|
48
68
|
namespace: REFERRAL_CODES_PAGINATION_CONTEXT,
|
|
49
69
|
initialValue: { states, callbacks },
|
|
@@ -70,15 +90,15 @@ export function useReferralCodes(props) {
|
|
|
70
90
|
const data = referralData.data[0];
|
|
71
91
|
setReferralCodesContext({
|
|
72
92
|
referralCode: data.code,
|
|
73
|
-
shareLink: (_c = (_b = data.shareLinkCodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.
|
|
93
|
+
shareLink: (_c = (_b = data.shareLinkCodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.direct,
|
|
74
94
|
email: {
|
|
75
|
-
messageLink: (_e = (_d = data.shareLinkCodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.
|
|
95
|
+
messageLink: (_e = (_d = data.shareLinkCodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.email,
|
|
76
96
|
},
|
|
77
97
|
fbMessenger: {
|
|
78
|
-
messageLink: (_g = (_f = data.shareLinkCodes) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.
|
|
79
|
-
shareLink: (_j = (_h = data.shareLinkCodes) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.
|
|
98
|
+
messageLink: (_g = (_f = data.shareLinkCodes) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.fbMessenger,
|
|
99
|
+
shareLink: (_j = (_h = data.shareLinkCodes) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.fbMessenger,
|
|
80
100
|
},
|
|
81
|
-
whatsApp: { messageLink: (_l = (_k = data.shareLinkCodes) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.
|
|
101
|
+
whatsApp: { messageLink: (_l = (_k = data.shareLinkCodes) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.whatsApp },
|
|
82
102
|
});
|
|
83
103
|
}
|
|
84
104
|
}, [referralData]);
|
|
@@ -89,6 +109,7 @@ export function useReferralCodes(props) {
|
|
|
89
109
|
return {
|
|
90
110
|
states: {
|
|
91
111
|
...states,
|
|
112
|
+
noCodes: referralData.totalCount === 0,
|
|
92
113
|
},
|
|
93
114
|
data: referralCodesContext,
|
|
94
115
|
callbacks: {
|
|
@@ -4,7 +4,7 @@ import { i as intl } from './global-b89b6edc.js';
|
|
|
4
4
|
import { d as dist, H, Q, I as In, y as yn, $ as $e, B, a as getEnvironmentSDK, L } from './index.module-f122af7b.js';
|
|
5
5
|
import { l as luxonLocale } from './utils-334c1e34.js';
|
|
6
6
|
import { c as createStyleSheet, j as jss, a as create } from './JSS-67b5cff8.js';
|
|
7
|
-
import { a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_USED, C as CopyTextView } from './copy-text-view-
|
|
7
|
+
import { a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_USED, C as CopyTextView } from './copy-text-view-30eb24f2.js';
|
|
8
8
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
9
9
|
import { H as HostBlock, A as AuthWrapper, a as AuthColumn, b as AuthButtonsContainer, E as ErrorStyles } from './mixins-f60a614c.js';
|
|
10
10
|
import { u as useChildElements } from './useChildElements-37daf533.js';
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { h } from './index-17b4da69.js';
|
|
2
2
|
import { f as useEffect } from './stencil-hooks.module-ac12ca1c.js';
|
|
3
|
-
import { d as dist, Q, k as kn, C as Cn } from './index.module-f122af7b.js';
|
|
3
|
+
import { d as dist, Q, k as kn, C as Cn, B } from './index.module-f122af7b.js';
|
|
4
4
|
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
5
5
|
import { H as HostBlock } from './mixins-f60a614c.js';
|
|
6
6
|
|
|
7
7
|
const GET_REFERRAL_CODES = dist.gql `
|
|
8
|
-
query getCodes(
|
|
8
|
+
query getCodes(
|
|
9
|
+
$limit: Int!
|
|
10
|
+
$offset: Int!
|
|
11
|
+
$engagementMedium: UserEngagementMedium!
|
|
12
|
+
) {
|
|
9
13
|
viewer {
|
|
10
14
|
... on User {
|
|
11
15
|
referralCodeList(
|
|
@@ -20,7 +24,22 @@ const GET_REFERRAL_CODES = dist.gql `
|
|
|
20
24
|
shareLinkCodes(limit: $limit, offset: $offset) {
|
|
21
25
|
data {
|
|
22
26
|
linkCode
|
|
23
|
-
shortUrl
|
|
27
|
+
shareLink: shortUrl(
|
|
28
|
+
shareMedium: DIRECT
|
|
29
|
+
engagementMedium: EMBED
|
|
30
|
+
)
|
|
31
|
+
email: shortUrl(
|
|
32
|
+
shareMedium: EMAIL
|
|
33
|
+
engagementMedium: $engagementMedium
|
|
34
|
+
)
|
|
35
|
+
whatsApp: shortUrl(
|
|
36
|
+
shareMedium: WHATSAPP
|
|
37
|
+
engagementMedium: $engagementMedium
|
|
38
|
+
)
|
|
39
|
+
fbMessenger: shortUrl(
|
|
40
|
+
shareMedium: FBMESSENGER
|
|
41
|
+
engagementMedium: $engagementMedium
|
|
42
|
+
)
|
|
24
43
|
}
|
|
25
44
|
}
|
|
26
45
|
}
|
|
@@ -38,6 +57,7 @@ mutation test {}
|
|
|
38
57
|
`;
|
|
39
58
|
function useReferralCodes(props) {
|
|
40
59
|
const user = Q();
|
|
60
|
+
const engagementMedium = B();
|
|
41
61
|
console.log({ props });
|
|
42
62
|
const { envelope: referralData, states, callbacks, } = kn(GET_REFERRAL_CODES, (data) => {
|
|
43
63
|
var _a;
|
|
@@ -46,7 +66,7 @@ function useReferralCodes(props) {
|
|
|
46
66
|
}, {
|
|
47
67
|
limit: 1,
|
|
48
68
|
offset: 0,
|
|
49
|
-
}, {}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
69
|
+
}, { engagementMedium }, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
50
70
|
const [paginationContext, setPaginationContext] = Cn({
|
|
51
71
|
namespace: REFERRAL_CODES_PAGINATION_CONTEXT,
|
|
52
72
|
initialValue: { states, callbacks },
|
|
@@ -73,15 +93,15 @@ function useReferralCodes(props) {
|
|
|
73
93
|
const data = referralData.data[0];
|
|
74
94
|
setReferralCodesContext({
|
|
75
95
|
referralCode: data.code,
|
|
76
|
-
shareLink: (_c = (_b = data.shareLinkCodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.
|
|
96
|
+
shareLink: (_c = (_b = data.shareLinkCodes) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.direct,
|
|
77
97
|
email: {
|
|
78
|
-
messageLink: (_e = (_d = data.shareLinkCodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.
|
|
98
|
+
messageLink: (_e = (_d = data.shareLinkCodes) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.email,
|
|
79
99
|
},
|
|
80
100
|
fbMessenger: {
|
|
81
|
-
messageLink: (_g = (_f = data.shareLinkCodes) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.
|
|
82
|
-
shareLink: (_j = (_h = data.shareLinkCodes) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.
|
|
101
|
+
messageLink: (_g = (_f = data.shareLinkCodes) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.fbMessenger,
|
|
102
|
+
shareLink: (_j = (_h = data.shareLinkCodes) === null || _h === void 0 ? void 0 : _h[0]) === null || _j === void 0 ? void 0 : _j.fbMessenger,
|
|
83
103
|
},
|
|
84
|
-
whatsApp: { messageLink: (_l = (_k = data.shareLinkCodes) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.
|
|
104
|
+
whatsApp: { messageLink: (_l = (_k = data.shareLinkCodes) === null || _k === void 0 ? void 0 : _k[0]) === null || _l === void 0 ? void 0 : _l.whatsApp },
|
|
85
105
|
});
|
|
86
106
|
}
|
|
87
107
|
}, [referralData]);
|
|
@@ -92,6 +112,7 @@ function useReferralCodes(props) {
|
|
|
92
112
|
return {
|
|
93
113
|
states: {
|
|
94
114
|
...states,
|
|
115
|
+
noCodes: referralData.totalCount === 0,
|
|
95
116
|
},
|
|
96
117
|
data: referralCodesContext,
|
|
97
118
|
callbacks: {
|
|
@@ -5,7 +5,7 @@ import { i as isDemo, _, d as dist, Q, H, $ as $e, y as yn, B, L, g as gn, e as
|
|
|
5
5
|
import { j as jsonpointer } from './jsonpointer-388a7082.js';
|
|
6
6
|
import { g as getProps, a as getMissingProps, s as sanitizeUrlPath } from './utils-334c1e34.js';
|
|
7
7
|
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
8
|
-
import { C as CopyTextView } from './copy-text-view-
|
|
8
|
+
import { C as CopyTextView } from './copy-text-view-30eb24f2.js';
|
|
9
9
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
10
10
|
import './mixins-f60a614c.js';
|
|
11
11
|
import { a as useRequestRerender } from './re-render-c64289f3.js';
|
|
@@ -16,7 +16,7 @@ import { p as pathToRegexp } from './index-ffa26b43.js';
|
|
|
16
16
|
import { R as REGISTRATION_FORM_STATE_CONTEXT, u as useRegistrationFormState } from './useRegistrationFormState-53c71782.js';
|
|
17
17
|
import { i as isEmpty } from './utilities-18d10876.js';
|
|
18
18
|
import { A as AsYouType } from './AsYouType-46f67d0d.js';
|
|
19
|
-
import { b as useDemoBigStat, U as useBigStat, B as BigStatView, O as autoColorScaleCss, J as CardFeedView, C as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, V as withShadowView, L as LeaderboardView, N as NameFieldsView, d as PortalChangePasswordView, i as PortalFooterView, P as PortalFrameView, e as PortalLoginView, f as PortalRegisterView, R as ReferralIframeView, W as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-
|
|
19
|
+
import { b as useDemoBigStat, U as useBigStat, B as BigStatView, O as autoColorScaleCss, J as CardFeedView, C as CheckboxFieldView, K as CouponCodeView, D as DropdownFieldView, E as EditProfileView, H as HeroView, I as InputFieldView, V as withShadowView, L as LeaderboardView, N as NameFieldsView, d as PortalChangePasswordView, i as PortalFooterView, P as PortalFrameView, e as PortalLoginView, f as PortalRegisterView, R as ReferralIframeView, W as demoRewardExchange, j as RewardExchangeView, a as useShareButton, S as ShareButtonView, u as useShareLink, c as StatContainerView, T as TaskCardView } from './ShadowViewAddon-81afccad.js';
|
|
20
20
|
import './sqm-portal-container-view-6c582684.js';
|
|
21
21
|
|
|
22
22
|
const BigStat = class {
|
|
@@ -3,7 +3,7 @@ import { n as h$1, k as useState } from './stencil-hooks.module-ac12ca1c.js';
|
|
|
3
3
|
import { I as In, i as isDemo, d as dist, H, Q, y as yn, $ as $e, B } from './index.module-f122af7b.js';
|
|
4
4
|
import { g as getProps } from './utils-334c1e34.js';
|
|
5
5
|
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
6
|
-
import { R as REFERRAL_CODES_PAGINATION_CONTEXT, a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_USED, C as CopyTextView, u as useReferralCodes } from './copy-text-view-
|
|
6
|
+
import { R as REFERRAL_CODES_PAGINATION_CONTEXT, a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_USED, C as CopyTextView, u as useReferralCodes } from './copy-text-view-30eb24f2.js';
|
|
7
7
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
8
8
|
import './mixins-f60a614c.js';
|
|
9
9
|
|
|
@@ -302,6 +302,8 @@ const ReferralCodes = class {
|
|
|
302
302
|
const viewProps = {
|
|
303
303
|
slots,
|
|
304
304
|
...props,
|
|
305
|
+
loading: props.states.loading,
|
|
306
|
+
noCodes: props.states.noCodes,
|
|
305
307
|
};
|
|
306
308
|
return h(ReferralCodesView, Object.assign({}, viewProps));
|
|
307
309
|
}
|
|
@@ -309,6 +311,10 @@ const ReferralCodes = class {
|
|
|
309
311
|
function useDemoReferralCodes(props) {
|
|
310
312
|
return cjs({
|
|
311
313
|
titleText: props.titleText,
|
|
314
|
+
states: {
|
|
315
|
+
noCodes: false,
|
|
316
|
+
loading: false,
|
|
317
|
+
},
|
|
312
318
|
}, props.demoData || {}, { arrayMerge: (_, a) => a });
|
|
313
319
|
}
|
|
314
320
|
|
|
@@ -4,7 +4,7 @@ import './global-b89b6edc.js';
|
|
|
4
4
|
import { e as $n, S as Sn, b as setUserIdentity, d as dist, X as Xe, o as setProgramId } from './index.module-f122af7b.js';
|
|
5
5
|
import './utils-334c1e34.js';
|
|
6
6
|
import { c as createStyleSheet } from './JSS-67b5cff8.js';
|
|
7
|
-
import { C as CopyTextView } from './copy-text-view-
|
|
7
|
+
import { C as CopyTextView } from './copy-text-view-30eb24f2.js';
|
|
8
8
|
import './cjs-bdfb4486.js';
|
|
9
9
|
import './mixins-f60a614c.js';
|
|
10
10
|
import { G as GenericTableView } from './GenericTableView-bf154727.js';
|
|
@@ -25,7 +25,7 @@ import { P as PortalProfileView } from './sqm-portal-profile-view-d72dd5ac.js';
|
|
|
25
25
|
import './utilities-18d10876.js';
|
|
26
26
|
import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-f1454d43.js';
|
|
27
27
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-3739f523.js';
|
|
28
|
-
import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, C as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as autoColorScaleCss, Q as ShadowViewAddon } from './ShadowViewAddon-
|
|
28
|
+
import { S as ShareButtonView, L as LeaderboardView, B as BigStatView, P as PortalFrameView, E as EditProfileView, u as useShareLink, a as useShareButton, b as useDemoBigStat, c as StatContainerView, d as PortalChangePasswordView, e as PortalLoginView, f as PortalRegisterView, T as TaskCardView, g as ProgressBarView, h as PoweredByImg$1, i as PortalFooterView, H as HeroView, R as ReferralIframeView, N as NameFieldsView, C as CheckboxFieldView, D as DropdownFieldView, I as InputFieldView, j as RewardExchangeView, r as rewardExchangeCustomErrorMsg, k as rewardExchangeLongText, l as rewardExchangeSelected, m as chooseAmountFixed, n as chooseAmountFixedNoDescription, o as chooseAmountVariable, p as chooseAmountVariableNoDescription, q as chooseAmountVariableDisabled, s as chooseAmountVariableUnavailable, t as confirmFixed, v as confirmVariable, w as redemptionError, x as queryError, y as success, z as successVariable, A as loading, F as empty$1, G as rewardExchange, J as CardFeedView, K as CouponCodeView, M as ProgressBar$2, O as autoColorScaleCss, Q as ShadowViewAddon } from './ShadowViewAddon-81afccad.js';
|
|
29
29
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-6c582684.js';
|
|
30
30
|
import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-09cc28d6.js';
|
|
31
31
|
|