@saasquatch/mint-components 1.11.1-35 → 1.11.1-37
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-63618d84.js → ShadowViewAddon-074b426e.js} +1 -1
- package/dist/cjs/{copy-text-view-042d78f9.js → copy-text-view-acb2707b.js} +41 -20
- package/dist/cjs/sqm-big-stat_38.cjs.entry.js +2 -2
- package/dist/cjs/sqm-pagination_3.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +2 -2
- package/dist/collection/components/sqm-referral-codes/useReferralCodes.js +41 -20
- package/dist/esm/{ShadowViewAddon-5834d95f.js → ShadowViewAddon-100e4928.js} +1 -1
- package/dist/esm/{copy-text-view-ded4c93b.js → copy-text-view-cfdca341.js} +41 -20
- package/dist/esm/sqm-big-stat_38.entry.js +2 -2
- package/dist/esm/sqm-pagination_3.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +2 -2
- package/dist/esm-es5/{ShadowViewAddon-5834d95f.js → ShadowViewAddon-100e4928.js} +1 -1
- package/dist/esm-es5/copy-text-view-cfdca341.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-ae962b3a.entry.js → p-267a2e5a.entry.js} +2 -2
- package/dist/mint-components/{p-d4562b26.system.entry.js → p-4da7a951.system.entry.js} +1 -1
- package/dist/mint-components/{p-653dd099.system.entry.js → p-60213708.system.entry.js} +1 -1
- package/dist/mint-components/{p-98a30ffb.entry.js → p-6aac1288.entry.js} +1 -1
- package/dist/mint-components/{p-3a4f6060.system.entry.js → p-799cd8f5.system.entry.js} +1 -1
- package/dist/mint-components/{p-e738a10a.entry.js → p-89c05109.entry.js} +1 -1
- package/dist/mint-components/p-9ed09b3a.system.js +1 -1
- package/dist/mint-components/{p-bcd4dc09.js → p-bc49a074.js} +1 -1
- package/dist/mint-components/p-cda9aafd.js +52 -0
- package/dist/mint-components/{p-6149dbb3.system.js → p-d4f00976.system.js} +1 -1
- package/dist/mint-components/p-efcb080f.system.js +1 -0
- package/docs/docs.docx +0 -0
- package/package.json +1 -1
- package/dist/esm-es5/copy-text-view-ded4c93b.js +0 -1
- package/dist/mint-components/p-0d472053.system.js +0 -1
- package/dist/mint-components/p-1dd76ec3.js +0 -59
|
@@ -6,7 +6,7 @@ const global = require('./global-e067aa06.js');
|
|
|
6
6
|
const index_module = require('./index.module-224d7b8d.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-acb2707b.js');
|
|
10
10
|
const cjs = require('./cjs-1066ec21.js');
|
|
11
11
|
const mixins = require('./mixins-fe9d4112.js');
|
|
12
12
|
const useChildElements = require('./useChildElements-176ac928.js');
|
|
@@ -8,26 +8,19 @@ const mixins = require('./mixins-fe9d4112.js');
|
|
|
8
8
|
|
|
9
9
|
const GET_REFERRAL_CODES = index_module.dist.gql `
|
|
10
10
|
query getCodes(
|
|
11
|
+
$engagementMedium: UserEngagementMedium!
|
|
11
12
|
$limit: Int!
|
|
12
13
|
$offset: Int!
|
|
13
|
-
$
|
|
14
|
-
$programId: ID
|
|
14
|
+
$filter: ReferralCodeFilterInput
|
|
15
15
|
) {
|
|
16
16
|
viewer {
|
|
17
17
|
... on User {
|
|
18
|
-
referralCodeList(
|
|
19
|
-
limit: $limit
|
|
20
|
-
offset: $offset
|
|
21
|
-
filter: {
|
|
22
|
-
fuelTank_eq: true
|
|
23
|
-
programId_eq: $programId
|
|
24
|
-
dateUsed_exists: false
|
|
25
|
-
}
|
|
26
|
-
) {
|
|
18
|
+
referralCodeList(limit: $limit, offset: $offset, filter: $filter) {
|
|
27
19
|
data {
|
|
28
20
|
code
|
|
29
21
|
dateUsed
|
|
30
22
|
dateCopied
|
|
23
|
+
singleUse
|
|
31
24
|
shareLinkCodes(limit: $limit) {
|
|
32
25
|
data {
|
|
33
26
|
linkCode
|
|
@@ -69,22 +62,47 @@ const SET_CODE_COPIED = index_module.dist.gql `
|
|
|
69
62
|
}
|
|
70
63
|
`;
|
|
71
64
|
function useReferralCodes(props) {
|
|
65
|
+
var _a;
|
|
72
66
|
const user = index_module.Q();
|
|
73
67
|
const engagementMedium = index_module.B();
|
|
74
68
|
const programId = props.programId || index_module.H();
|
|
75
69
|
console.log({ props });
|
|
76
70
|
const { refresh } = index_module.ze();
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList;
|
|
71
|
+
const singleUseReferralCodes = index_module.kn(GET_REFERRAL_CODES, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList; }, {
|
|
72
|
+
limit: 1,
|
|
73
|
+
offset: 0,
|
|
81
74
|
}, {
|
|
75
|
+
engagementMedium,
|
|
76
|
+
programId,
|
|
77
|
+
filter: {
|
|
78
|
+
fuelTank_eq: true,
|
|
79
|
+
programId_eq: programId,
|
|
80
|
+
dateUsed_exists: false,
|
|
81
|
+
singleUse_eq: true,
|
|
82
|
+
},
|
|
83
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
84
|
+
const multiUseReferralCodes = index_module.kn(GET_REFERRAL_CODES, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList; }, {
|
|
82
85
|
limit: 1,
|
|
83
86
|
offset: 0,
|
|
84
|
-
}, {
|
|
87
|
+
}, {
|
|
88
|
+
engagementMedium,
|
|
89
|
+
programId,
|
|
90
|
+
filter: {
|
|
91
|
+
fuelTank_eq: true,
|
|
92
|
+
programId_eq: programId,
|
|
93
|
+
singleUse_eq: false,
|
|
94
|
+
},
|
|
95
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
96
|
+
const referralCodes = ((_a = singleUseReferralCodes === null || singleUseReferralCodes === void 0 ? void 0 : singleUseReferralCodes.envelope) === null || _a === void 0 ? void 0 : _a.totalCount) > 0
|
|
97
|
+
? singleUseReferralCodes
|
|
98
|
+
: multiUseReferralCodes;
|
|
99
|
+
const referralData = referralCodes.envelope;
|
|
85
100
|
const [paginationContext, setPaginationContext] = index_module.Cn({
|
|
86
101
|
namespace: REFERRAL_CODES_PAGINATION_CONTEXT,
|
|
87
|
-
initialValue: {
|
|
102
|
+
initialValue: {
|
|
103
|
+
states: referralCodes.states,
|
|
104
|
+
callbacks: referralCodes.callbacks,
|
|
105
|
+
},
|
|
88
106
|
});
|
|
89
107
|
const [referralCodesContext, setReferralCodesContext] = index_module.Cn({
|
|
90
108
|
namespace: REFERRAL_CODES_NAMESPACE,
|
|
@@ -124,13 +142,16 @@ function useReferralCodes(props) {
|
|
|
124
142
|
},
|
|
125
143
|
whatsapp: { messageLink: (_r = (_q = (_p = data.shareLinkCodes) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.whatsApp },
|
|
126
144
|
});
|
|
127
|
-
setPaginationContext({
|
|
145
|
+
setPaginationContext({
|
|
146
|
+
states: referralCodes.states,
|
|
147
|
+
callbacks: referralCodes.callbacks,
|
|
148
|
+
});
|
|
128
149
|
}
|
|
129
150
|
}, [referralData]);
|
|
130
|
-
console.log({ referralData, states });
|
|
151
|
+
console.log({ referralData, states: referralCodes.states });
|
|
131
152
|
return {
|
|
132
153
|
states: {
|
|
133
|
-
...states,
|
|
154
|
+
...referralCodes.states,
|
|
134
155
|
noCodes: (referralData === null || referralData === void 0 ? void 0 : referralData.totalCount) === 0,
|
|
135
156
|
},
|
|
136
157
|
data: referralCodesContext,
|
|
@@ -9,7 +9,7 @@ const index_module = require('./index.module-224d7b8d.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-acb2707b.js');
|
|
13
13
|
const cjs = require('./cjs-1066ec21.js');
|
|
14
14
|
require('./mixins-fe9d4112.js');
|
|
15
15
|
const reRender = require('./re-render-cd2f8774.js');
|
|
@@ -20,7 +20,7 @@ const index$1 = require('./index-8c6255f5.js');
|
|
|
20
20
|
const useRegistrationFormState = require('./useRegistrationFormState-49dd9295.js');
|
|
21
21
|
const utilities = require('./utilities-719c980a.js');
|
|
22
22
|
const AsYouType = require('./AsYouType-6788393a.js');
|
|
23
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
23
|
+
const ShadowViewAddon = require('./ShadowViewAddon-074b426e.js');
|
|
24
24
|
require('./sqm-portal-container-view-976bf0f5.js');
|
|
25
25
|
|
|
26
26
|
const BigStat = class {
|
|
@@ -7,7 +7,7 @@ const stencilHooks_module = require('./stencil-hooks.module-8f69ed33.js');
|
|
|
7
7
|
const index_module = require('./index.module-224d7b8d.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-acb2707b.js');
|
|
11
11
|
const cjs = require('./cjs-1066ec21.js');
|
|
12
12
|
require('./mixins-fe9d4112.js');
|
|
13
13
|
|
|
@@ -8,7 +8,7 @@ require('./global-e067aa06.js');
|
|
|
8
8
|
const index_module = require('./index.module-224d7b8d.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-acb2707b.js');
|
|
12
12
|
require('./cjs-1066ec21.js');
|
|
13
13
|
require('./mixins-fe9d4112.js');
|
|
14
14
|
const GenericTableView = require('./GenericTableView-bb2fcd95.js');
|
|
@@ -29,7 +29,7 @@ const sqmPortalProfileView = require('./sqm-portal-profile-view-7c70d7f9.js');
|
|
|
29
29
|
require('./utilities-719c980a.js');
|
|
30
30
|
const sqmPortalResetPasswordView = require('./sqm-portal-reset-password-view-1b85b8cf.js');
|
|
31
31
|
const sqmPortalVerifyEmailView = require('./sqm-portal-verify-email-view-cc3c87c3.js');
|
|
32
|
-
const ShadowViewAddon = require('./ShadowViewAddon-
|
|
32
|
+
const ShadowViewAddon = require('./ShadowViewAddon-074b426e.js');
|
|
33
33
|
const sqmPortalContainerView = require('./sqm-portal-container-view-976bf0f5.js');
|
|
34
34
|
const sqmInvoiceTableView = require('./sqm-invoice-table-view-2f4f426b.js');
|
|
35
35
|
|
|
@@ -3,26 +3,19 @@ import { useEffect } from "@saasquatch/universal-hooks";
|
|
|
3
3
|
import { gql } from "graphql-request";
|
|
4
4
|
const GET_REFERRAL_CODES = gql `
|
|
5
5
|
query getCodes(
|
|
6
|
+
$engagementMedium: UserEngagementMedium!
|
|
6
7
|
$limit: Int!
|
|
7
8
|
$offset: Int!
|
|
8
|
-
$
|
|
9
|
-
$programId: ID
|
|
9
|
+
$filter: ReferralCodeFilterInput
|
|
10
10
|
) {
|
|
11
11
|
viewer {
|
|
12
12
|
... on User {
|
|
13
|
-
referralCodeList(
|
|
14
|
-
limit: $limit
|
|
15
|
-
offset: $offset
|
|
16
|
-
filter: {
|
|
17
|
-
fuelTank_eq: true
|
|
18
|
-
programId_eq: $programId
|
|
19
|
-
dateUsed_exists: false
|
|
20
|
-
}
|
|
21
|
-
) {
|
|
13
|
+
referralCodeList(limit: $limit, offset: $offset, filter: $filter) {
|
|
22
14
|
data {
|
|
23
15
|
code
|
|
24
16
|
dateUsed
|
|
25
17
|
dateCopied
|
|
18
|
+
singleUse
|
|
26
19
|
shareLinkCodes(limit: $limit) {
|
|
27
20
|
data {
|
|
28
21
|
linkCode
|
|
@@ -64,22 +57,47 @@ export const SET_CODE_COPIED = gql `
|
|
|
64
57
|
}
|
|
65
58
|
`;
|
|
66
59
|
export function useReferralCodes(props) {
|
|
60
|
+
var _a;
|
|
67
61
|
const user = useUserIdentity();
|
|
68
62
|
const engagementMedium = useEngagementMedium();
|
|
69
63
|
const programId = props.programId || useProgramId();
|
|
70
64
|
console.log({ props });
|
|
71
65
|
const { refresh } = useRefreshDispatcher();
|
|
72
|
-
const
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList;
|
|
66
|
+
const singleUseReferralCodes = usePaginatedQuery(GET_REFERRAL_CODES, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList; }, {
|
|
67
|
+
limit: 1,
|
|
68
|
+
offset: 0,
|
|
76
69
|
}, {
|
|
70
|
+
engagementMedium,
|
|
71
|
+
programId,
|
|
72
|
+
filter: {
|
|
73
|
+
fuelTank_eq: true,
|
|
74
|
+
programId_eq: programId,
|
|
75
|
+
dateUsed_exists: false,
|
|
76
|
+
singleUse_eq: true,
|
|
77
|
+
},
|
|
78
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
79
|
+
const multiUseReferralCodes = usePaginatedQuery(GET_REFERRAL_CODES, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList; }, {
|
|
77
80
|
limit: 1,
|
|
78
81
|
offset: 0,
|
|
79
|
-
}, {
|
|
82
|
+
}, {
|
|
83
|
+
engagementMedium,
|
|
84
|
+
programId,
|
|
85
|
+
filter: {
|
|
86
|
+
fuelTank_eq: true,
|
|
87
|
+
programId_eq: programId,
|
|
88
|
+
singleUse_eq: false,
|
|
89
|
+
},
|
|
90
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
91
|
+
const referralCodes = ((_a = singleUseReferralCodes === null || singleUseReferralCodes === void 0 ? void 0 : singleUseReferralCodes.envelope) === null || _a === void 0 ? void 0 : _a.totalCount) > 0
|
|
92
|
+
? singleUseReferralCodes
|
|
93
|
+
: multiUseReferralCodes;
|
|
94
|
+
const referralData = referralCodes.envelope;
|
|
80
95
|
const [paginationContext, setPaginationContext] = useParentState({
|
|
81
96
|
namespace: REFERRAL_CODES_PAGINATION_CONTEXT,
|
|
82
|
-
initialValue: {
|
|
97
|
+
initialValue: {
|
|
98
|
+
states: referralCodes.states,
|
|
99
|
+
callbacks: referralCodes.callbacks,
|
|
100
|
+
},
|
|
83
101
|
});
|
|
84
102
|
const [referralCodesContext, setReferralCodesContext] = useParentState({
|
|
85
103
|
namespace: REFERRAL_CODES_NAMESPACE,
|
|
@@ -119,13 +137,16 @@ export function useReferralCodes(props) {
|
|
|
119
137
|
},
|
|
120
138
|
whatsapp: { messageLink: (_r = (_q = (_p = data.shareLinkCodes) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.whatsApp },
|
|
121
139
|
});
|
|
122
|
-
setPaginationContext({
|
|
140
|
+
setPaginationContext({
|
|
141
|
+
states: referralCodes.states,
|
|
142
|
+
callbacks: referralCodes.callbacks,
|
|
143
|
+
});
|
|
123
144
|
}
|
|
124
145
|
}, [referralData]);
|
|
125
|
-
console.log({ referralData, states });
|
|
146
|
+
console.log({ referralData, states: referralCodes.states });
|
|
126
147
|
return {
|
|
127
148
|
states: {
|
|
128
|
-
...states,
|
|
149
|
+
...referralCodes.states,
|
|
129
150
|
noCodes: (referralData === null || referralData === void 0 ? void 0 : referralData.totalCount) === 0,
|
|
130
151
|
},
|
|
131
152
|
data: referralCodesContext,
|
|
@@ -4,7 +4,7 @@ import { i as intl } from './global-701bd5b0.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-5eb0926c.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_COPIED, C as CopyTextView } from './copy-text-view-
|
|
7
|
+
import { a as REFERRAL_CODES_NAMESPACE, S as SET_CODE_COPIED, C as CopyTextView } from './copy-text-view-cfdca341.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-ebcfbc19.js';
|
|
@@ -6,26 +6,19 @@ import { H as HostBlock } from './mixins-f60a614c.js';
|
|
|
6
6
|
|
|
7
7
|
const GET_REFERRAL_CODES = dist.gql `
|
|
8
8
|
query getCodes(
|
|
9
|
+
$engagementMedium: UserEngagementMedium!
|
|
9
10
|
$limit: Int!
|
|
10
11
|
$offset: Int!
|
|
11
|
-
$
|
|
12
|
-
$programId: ID
|
|
12
|
+
$filter: ReferralCodeFilterInput
|
|
13
13
|
) {
|
|
14
14
|
viewer {
|
|
15
15
|
... on User {
|
|
16
|
-
referralCodeList(
|
|
17
|
-
limit: $limit
|
|
18
|
-
offset: $offset
|
|
19
|
-
filter: {
|
|
20
|
-
fuelTank_eq: true
|
|
21
|
-
programId_eq: $programId
|
|
22
|
-
dateUsed_exists: false
|
|
23
|
-
}
|
|
24
|
-
) {
|
|
16
|
+
referralCodeList(limit: $limit, offset: $offset, filter: $filter) {
|
|
25
17
|
data {
|
|
26
18
|
code
|
|
27
19
|
dateUsed
|
|
28
20
|
dateCopied
|
|
21
|
+
singleUse
|
|
29
22
|
shareLinkCodes(limit: $limit) {
|
|
30
23
|
data {
|
|
31
24
|
linkCode
|
|
@@ -67,22 +60,47 @@ const SET_CODE_COPIED = dist.gql `
|
|
|
67
60
|
}
|
|
68
61
|
`;
|
|
69
62
|
function useReferralCodes(props) {
|
|
63
|
+
var _a;
|
|
70
64
|
const user = Q();
|
|
71
65
|
const engagementMedium = B();
|
|
72
66
|
const programId = props.programId || H();
|
|
73
67
|
console.log({ props });
|
|
74
68
|
const { refresh } = ze();
|
|
75
|
-
const
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList;
|
|
69
|
+
const singleUseReferralCodes = kn(GET_REFERRAL_CODES, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList; }, {
|
|
70
|
+
limit: 1,
|
|
71
|
+
offset: 0,
|
|
79
72
|
}, {
|
|
73
|
+
engagementMedium,
|
|
74
|
+
programId,
|
|
75
|
+
filter: {
|
|
76
|
+
fuelTank_eq: true,
|
|
77
|
+
programId_eq: programId,
|
|
78
|
+
dateUsed_exists: false,
|
|
79
|
+
singleUse_eq: true,
|
|
80
|
+
},
|
|
81
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
82
|
+
const multiUseReferralCodes = kn(GET_REFERRAL_CODES, (data) => { var _a; return (_a = data === null || data === void 0 ? void 0 : data.viewer) === null || _a === void 0 ? void 0 : _a.referralCodeList; }, {
|
|
80
83
|
limit: 1,
|
|
81
84
|
offset: 0,
|
|
82
|
-
}, {
|
|
85
|
+
}, {
|
|
86
|
+
engagementMedium,
|
|
87
|
+
programId,
|
|
88
|
+
filter: {
|
|
89
|
+
fuelTank_eq: true,
|
|
90
|
+
programId_eq: programId,
|
|
91
|
+
singleUse_eq: false,
|
|
92
|
+
},
|
|
93
|
+
}, !(user === null || user === void 0 ? void 0 : user.jwt));
|
|
94
|
+
const referralCodes = ((_a = singleUseReferralCodes === null || singleUseReferralCodes === void 0 ? void 0 : singleUseReferralCodes.envelope) === null || _a === void 0 ? void 0 : _a.totalCount) > 0
|
|
95
|
+
? singleUseReferralCodes
|
|
96
|
+
: multiUseReferralCodes;
|
|
97
|
+
const referralData = referralCodes.envelope;
|
|
83
98
|
const [paginationContext, setPaginationContext] = Cn({
|
|
84
99
|
namespace: REFERRAL_CODES_PAGINATION_CONTEXT,
|
|
85
|
-
initialValue: {
|
|
100
|
+
initialValue: {
|
|
101
|
+
states: referralCodes.states,
|
|
102
|
+
callbacks: referralCodes.callbacks,
|
|
103
|
+
},
|
|
86
104
|
});
|
|
87
105
|
const [referralCodesContext, setReferralCodesContext] = Cn({
|
|
88
106
|
namespace: REFERRAL_CODES_NAMESPACE,
|
|
@@ -122,13 +140,16 @@ function useReferralCodes(props) {
|
|
|
122
140
|
},
|
|
123
141
|
whatsapp: { messageLink: (_r = (_q = (_p = data.shareLinkCodes) === null || _p === void 0 ? void 0 : _p.data) === null || _q === void 0 ? void 0 : _q[0]) === null || _r === void 0 ? void 0 : _r.whatsApp },
|
|
124
142
|
});
|
|
125
|
-
setPaginationContext({
|
|
143
|
+
setPaginationContext({
|
|
144
|
+
states: referralCodes.states,
|
|
145
|
+
callbacks: referralCodes.callbacks,
|
|
146
|
+
});
|
|
126
147
|
}
|
|
127
148
|
}, [referralData]);
|
|
128
|
-
console.log({ referralData, states });
|
|
149
|
+
console.log({ referralData, states: referralCodes.states });
|
|
129
150
|
return {
|
|
130
151
|
states: {
|
|
131
|
-
...states,
|
|
152
|
+
...referralCodes.states,
|
|
132
153
|
noCodes: (referralData === null || referralData === void 0 ? void 0 : referralData.totalCount) === 0,
|
|
133
154
|
},
|
|
134
155
|
data: referralCodesContext,
|
|
@@ -5,7 +5,7 @@ import { i as isDemo, _, d as dist, Q, H, $ as $e, y as yn, B, L, g as gn, f 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-cfdca341.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-b31d83d7.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-faea9402.js';
|
|
17
17
|
import { i as isEmpty } from './utilities-292b61b9.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-100e4928.js';
|
|
20
20
|
import './sqm-portal-container-view-83df005d.js';
|
|
21
21
|
|
|
22
22
|
const BigStat = class {
|
|
@@ -3,7 +3,7 @@ import { n as h$1, k as useState } from './stencil-hooks.module-576d7f01.js';
|
|
|
3
3
|
import { I as In, i as isDemo, d as dist, H, Q, y as yn, $ as $e, B } from './index.module-5eb0926c.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_COPIED, 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_COPIED, C as CopyTextView, u as useReferralCodes } from './copy-text-view-cfdca341.js';
|
|
7
7
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
8
8
|
import './mixins-f60a614c.js';
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@ import './global-701bd5b0.js';
|
|
|
4
4
|
import { f as $n, S as Sn, c as setUserIdentity, d as dist, X as Xe, p as setProgramId } from './index.module-5eb0926c.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-cfdca341.js';
|
|
8
8
|
import './cjs-bdfb4486.js';
|
|
9
9
|
import './mixins-f60a614c.js';
|
|
10
10
|
import { G as GenericTableView } from './GenericTableView-706f5b56.js';
|
|
@@ -25,7 +25,7 @@ import { P as PortalProfileView } from './sqm-portal-profile-view-847526a2.js';
|
|
|
25
25
|
import './utilities-292b61b9.js';
|
|
26
26
|
import { P as PortalResetPasswordView } from './sqm-portal-reset-password-view-865655da.js';
|
|
27
27
|
import { P as PortalVerifyEmailView } from './sqm-portal-verify-email-view-6c60df25.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-100e4928.js';
|
|
29
29
|
import { P as PortalContainerView, a as PortalSectionView } from './sqm-portal-container-view-83df005d.js';
|
|
30
30
|
import { O as OtherRegionSlotView, I as InvoiceTableView, T as TaxForm } from './sqm-invoice-table-view-7d1aa71f.js';
|
|
31
31
|
|