@saasquatch/mint-components 1.5.0-2 → 1.5.0-3
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/loader.cjs.js +1 -1
- package/dist/cjs/mint-components.cjs.js +1 -1
- package/dist/cjs/sqm-brand_31.cjs.entry.js +295 -121
- package/dist/cjs/sqm-program-explainer-step-view-98958ab1.js +64 -0
- package/dist/cjs/sqm-program-explainer-step.cjs.entry.js +3 -16
- package/dist/cjs/sqm-program-explainer-view-ba7ed24a.js +44 -0
- package/dist/cjs/sqm-program-explainer.cjs.entry.js +4 -33
- package/dist/collection/components/sqm-program-explainer/ProgramExplainer.stories.js +42 -29
- package/dist/collection/components/sqm-program-explainer/sqm-program-explainer-view.js +35 -28
- package/dist/collection/components/sqm-program-explainer/sqm-program-explainer.js +112 -5
- package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step-view.js +35 -20
- package/dist/collection/components/sqm-program-explainer-step/sqm-program-explainer-step.js +23 -46
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeList.stories.js +5 -3
- package/dist/collection/components/sqm-reward-exchange-list/RewardExchangeListData.js +38 -19
- package/dist/collection/components/sqm-reward-exchange-list/SVGs.js +3 -0
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js +133 -87
- package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list.js +349 -3
- package/dist/collection/components/sqm-reward-exchange-list/useRewardExchangeList.js +17 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mint-components.js +1 -1
- package/dist/esm/sqm-brand_31.entry.js +295 -121
- package/dist/esm/sqm-program-explainer-step-view-64fc0c37.js +62 -0
- package/dist/esm/sqm-program-explainer-step.entry.js +3 -16
- package/dist/esm/sqm-program-explainer-view-68f0d242.js +42 -0
- package/dist/esm/sqm-program-explainer.entry.js +7 -36
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-brand_31.entry.js +2 -2
- package/dist/esm-es5/sqm-program-explainer-step-view-64fc0c37.js +1 -0
- package/dist/esm-es5/sqm-program-explainer-step.entry.js +1 -1
- package/dist/esm-es5/sqm-program-explainer-view-68f0d242.js +1 -0
- package/dist/esm-es5/sqm-program-explainer.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/p-1435350e.system.js +1 -0
- package/dist/mint-components/p-16f5a7cb.system.js +1 -1
- package/dist/mint-components/p-259d31fc.entry.js +1 -0
- package/dist/mint-components/p-5cda79ed.system.entry.js +1 -0
- package/dist/mint-components/p-6d6be8bd.system.js +1 -0
- package/dist/mint-components/p-864f49d2.system.entry.js +1 -0
- package/dist/mint-components/p-8c4931a5.js +1 -0
- package/dist/mint-components/p-adcde089.system.entry.js +58 -0
- package/dist/mint-components/p-bf7fcf0c.js +1 -0
- package/dist/mint-components/{p-7300b0ae.entry.js → p-dd865aa8.entry.js} +15 -15
- package/dist/mint-components/p-f52bc20c.entry.js +1 -0
- package/dist/types/components/sqm-program-explainer/ProgramExplainer.stories.d.ts +3 -1
- package/dist/types/components/sqm-program-explainer/sqm-program-explainer-view.d.ts +9 -0
- package/dist/types/components/sqm-program-explainer/sqm-program-explainer.d.ts +23 -3
- package/dist/types/components/sqm-program-explainer-step/sqm-program-explainer-step.d.ts +9 -12
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeList.stories.d.ts +2 -0
- package/dist/types/components/sqm-reward-exchange-list/RewardExchangeListData.d.ts +85 -0
- package/dist/types/components/sqm-reward-exchange-list/SVGs.d.ts +1 -0
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.d.ts +3 -0
- package/dist/types/components/sqm-reward-exchange-list/sqm-reward-exchange-list.d.ts +53 -0
- package/dist/types/components/sqm-reward-exchange-list/useRewardExchangeList.d.ts +16 -0
- package/dist/types/components.d.ts +166 -19
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/sqm-program-explainer-step-view-0e66bea1.js +0 -49
- package/dist/esm/sqm-program-explainer-step-view-26920cf9.js +0 -47
- package/dist/esm-es5/sqm-program-explainer-step-view-26920cf9.js +0 -1
- package/dist/mint-components/p-1ea0804d.js +0 -1
- package/dist/mint-components/p-244f3d9b.system.entry.js +0 -1
- package/dist/mint-components/p-4fd17832.entry.js +0 -1
- package/dist/mint-components/p-9bda1dc4.system.entry.js +0 -1
- package/dist/mint-components/p-d12c666e.system.js +0 -1
- package/dist/mint-components/p-ded1509b.entry.js +0 -1
- package/dist/mint-components/p-f8c5f710.system.entry.js +0 -58
package/dist/collection/components/sqm-reward-exchange-list/sqm-reward-exchange-list-view.js
CHANGED
|
@@ -4,14 +4,17 @@ import preset from "jss-preset-default";
|
|
|
4
4
|
import { intl } from "../../global/global";
|
|
5
5
|
import { HostBlock } from "../../global/mixins";
|
|
6
6
|
import { ProgressBar } from "./progressBar";
|
|
7
|
-
import {
|
|
7
|
+
import { ShareLinkView } from "../sqm-share-link/sqm-share-link-view";
|
|
8
|
+
import { ExchangeArrows, Gift, CheckmarkFilled, } from "./SVGs";
|
|
8
9
|
const stageList = ["chooseReward", "chooseAmount", "confirmation", "success"];
|
|
9
|
-
const stageProgressList = {
|
|
10
|
-
chooseReward: "Choose reward",
|
|
11
|
-
chooseAmount: "Amount",
|
|
12
|
-
confirmation: "Confirm",
|
|
13
|
-
};
|
|
14
10
|
export function RewardExchangeView(props) {
|
|
11
|
+
const { states, data, callbacks } = props;
|
|
12
|
+
const { selectedItem, selectedStep } = states;
|
|
13
|
+
const stageProgressList = {
|
|
14
|
+
chooseReward: states.content.text.chooseRewardTitle,
|
|
15
|
+
chooseAmount: states.content.text.chooseAmountTitle,
|
|
16
|
+
confirmation: states.content.text.confirmationTitle,
|
|
17
|
+
};
|
|
15
18
|
const style = {
|
|
16
19
|
HostBlock: HostBlock,
|
|
17
20
|
Container: {
|
|
@@ -75,17 +78,6 @@ export function RewardExchangeView(props) {
|
|
|
75
78
|
color: "var(--sl-color-primary-500)",
|
|
76
79
|
},
|
|
77
80
|
},
|
|
78
|
-
Buttons: {
|
|
79
|
-
marginLeft: "auto",
|
|
80
|
-
width: "100%",
|
|
81
|
-
maxWidth: "300px",
|
|
82
|
-
},
|
|
83
|
-
Button: {
|
|
84
|
-
margin: "10px 0",
|
|
85
|
-
display: "block",
|
|
86
|
-
textAlign: "center",
|
|
87
|
-
cursor: "pointer",
|
|
88
|
-
},
|
|
89
81
|
ProgressBar: {
|
|
90
82
|
maxWidth: "350px",
|
|
91
83
|
width: "100%",
|
|
@@ -107,7 +99,13 @@ export function RewardExchangeView(props) {
|
|
|
107
99
|
},
|
|
108
100
|
},
|
|
109
101
|
},
|
|
110
|
-
|
|
102
|
+
CardLayout: {
|
|
103
|
+
display: "flex",
|
|
104
|
+
width: "100%",
|
|
105
|
+
borderRadius: "3px",
|
|
106
|
+
background: "rgba(0, 0, 0, 0)",
|
|
107
|
+
},
|
|
108
|
+
Card: {
|
|
111
109
|
display: "flex",
|
|
112
110
|
userSelect: "none",
|
|
113
111
|
height: "120px",
|
|
@@ -119,21 +117,12 @@ export function RewardExchangeView(props) {
|
|
|
119
117
|
display: "flex",
|
|
120
118
|
padding: 0,
|
|
121
119
|
},
|
|
122
|
-
"& .selected
|
|
123
|
-
width: "18px",
|
|
124
|
-
height: "18px",
|
|
125
|
-
minWidth: "18px",
|
|
126
|
-
borderRadius: "50%",
|
|
127
|
-
background: "var(--sl-color-primary-500)",
|
|
120
|
+
"& .selected": {
|
|
128
121
|
position: "relative",
|
|
129
|
-
|
|
122
|
+
top: "-2%",
|
|
130
123
|
left: "100%",
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
position: "relative",
|
|
134
|
-
left: "12%",
|
|
135
|
-
top: "-29%",
|
|
136
|
-
transform: "scale(0.8)",
|
|
124
|
+
color: "var(--sl-color-primary-500)",
|
|
125
|
+
margin: "-9px",
|
|
137
126
|
},
|
|
138
127
|
},
|
|
139
128
|
Square: {
|
|
@@ -152,14 +141,18 @@ export function RewardExchangeView(props) {
|
|
|
152
141
|
},
|
|
153
142
|
},
|
|
154
143
|
Image: {
|
|
144
|
+
padding: "8px",
|
|
145
|
+
minWidth: "96px",
|
|
146
|
+
maxWidth: "96px",
|
|
155
147
|
"& .image": {
|
|
148
|
+
width: "100%",
|
|
149
|
+
height: "100%",
|
|
156
150
|
objectFit: "contain",
|
|
157
|
-
|
|
158
|
-
height: "118px",
|
|
159
|
-
flex: 0.33,
|
|
151
|
+
borderRadius: "4px",
|
|
160
152
|
},
|
|
161
|
-
"& .image.
|
|
162
|
-
filter: "brightness(
|
|
153
|
+
"& .image.subdued": {
|
|
154
|
+
filter: "brightness(0.95)",
|
|
155
|
+
opacity: "0.5",
|
|
163
156
|
},
|
|
164
157
|
},
|
|
165
158
|
TextArea: {
|
|
@@ -170,12 +163,20 @@ export function RewardExchangeView(props) {
|
|
|
170
163
|
lineHeight: "20px",
|
|
171
164
|
fontWeight: "600",
|
|
172
165
|
color: "var(--sl-color-neutral-1000)",
|
|
166
|
+
display: "-webkit-box",
|
|
167
|
+
"-webkit-line-clamp": "1",
|
|
168
|
+
"-webkit-box-orient": "vertical",
|
|
169
|
+
overflow: "hidden",
|
|
173
170
|
},
|
|
174
171
|
"& .amount": {
|
|
175
172
|
fontSize: "14px",
|
|
176
173
|
lineHeight: "18px",
|
|
177
174
|
marginTop: "8px",
|
|
178
175
|
color: "var(--sl-color-neutral-500)",
|
|
176
|
+
display: "-webkit-box",
|
|
177
|
+
"-webkit-line-clamp": "1",
|
|
178
|
+
"-webkit-box-orient": "vertical",
|
|
179
|
+
overflow: "hidden",
|
|
179
180
|
},
|
|
180
181
|
"& .error": {
|
|
181
182
|
fontSize: "14px",
|
|
@@ -183,6 +184,10 @@ export function RewardExchangeView(props) {
|
|
|
183
184
|
marginTop: "8px",
|
|
184
185
|
fontWeight: "600",
|
|
185
186
|
color: "var(--sl-color-warning-500)",
|
|
187
|
+
display: "-webkit-box",
|
|
188
|
+
"-webkit-line-clamp": "1",
|
|
189
|
+
"-webkit-box-orient": "vertical",
|
|
190
|
+
overflow: "hidden",
|
|
186
191
|
},
|
|
187
192
|
},
|
|
188
193
|
ChooseAmount: {
|
|
@@ -197,7 +202,7 @@ export function RewardExchangeView(props) {
|
|
|
197
202
|
//fontSize: "var(--sl-font-size-large)",
|
|
198
203
|
fontSize: "113%",
|
|
199
204
|
fontWeight: "var(--sl-font-weight-semibold)",
|
|
200
|
-
color: "var(--sl-color-
|
|
205
|
+
color: "var(--sl-color-primary-500)",
|
|
201
206
|
},
|
|
202
207
|
"& .description": {
|
|
203
208
|
fontSize: "var(--sl-font-size-medium)",
|
|
@@ -234,7 +239,7 @@ export function RewardExchangeView(props) {
|
|
|
234
239
|
gap: "20px",
|
|
235
240
|
gridTemplateColumns: "repeat(auto-fill, minmax(300px, 1fr))",
|
|
236
241
|
},
|
|
237
|
-
|
|
242
|
+
Button: {
|
|
238
243
|
display: "flex",
|
|
239
244
|
flexWrap: "wrap-reverse",
|
|
240
245
|
margin: "var(--sl-spacing-medium) 0",
|
|
@@ -273,18 +278,18 @@ export function RewardExchangeView(props) {
|
|
|
273
278
|
jss.setup(preset());
|
|
274
279
|
const sheet = jss.createStyleSheet(style);
|
|
275
280
|
const styleString = sheet.toString();
|
|
276
|
-
const { states, data, callbacks } = props;
|
|
277
|
-
const { selectedItem, selectedStep } = states;
|
|
278
281
|
function getInput() {
|
|
279
282
|
var _a, _b;
|
|
280
283
|
const item = states.selectedItem;
|
|
281
284
|
if (!item || (item === null || item === void 0 ? void 0 : item.ruleType) === "FIXED_GLOBAL_REWARD")
|
|
282
285
|
return h("span", null, item === null || item === void 0 ? void 0 : item.prettySourceValue);
|
|
283
286
|
if (!((_a = item.steps) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
284
|
-
return h("p", null,
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
287
|
+
return (h("p", null, intl.formatMessage({
|
|
288
|
+
id: "notEnoughError",
|
|
289
|
+
defaultMessage: states.content.text.notEnoughError,
|
|
290
|
+
}, {
|
|
291
|
+
sourceUnit: item.sourceUnit,
|
|
292
|
+
})));
|
|
288
293
|
}
|
|
289
294
|
return (h("sl-select", { style: { width: "auto" }, label: "Select amount to receive", class: sheet.classes.Select, value: states.selectedStep, "onSl-select": (e) => {
|
|
290
295
|
var _a, _b, _c, _d, _e;
|
|
@@ -303,6 +308,7 @@ export function RewardExchangeView(props) {
|
|
|
303
308
|
defaultMessage: (_b = (_a = states.content) === null || _a === void 0 ? void 0 : _a.text) === null || _b === void 0 ? void 0 : _b.notAvailableError,
|
|
304
309
|
}, {
|
|
305
310
|
unavailableReason: step.unavailableReasonCode,
|
|
311
|
+
sourceValue: step.prettySourceValue || item.prettySourceMinValue,
|
|
306
312
|
}))))));
|
|
307
313
|
})));
|
|
308
314
|
}
|
|
@@ -310,57 +316,70 @@ export function RewardExchangeView(props) {
|
|
|
310
316
|
var _a;
|
|
311
317
|
return [
|
|
312
318
|
h("div", { class: sheet.classes.Grid }, (_a = data.exchangeList) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
313
|
-
var _a, _b;
|
|
319
|
+
var _a, _b, _c, _d, _e;
|
|
314
320
|
const style = {
|
|
315
321
|
boxShadow: item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key)
|
|
316
322
|
? "0 0 0 2px var(--sl-color-primary-500)"
|
|
317
323
|
: "none",
|
|
324
|
+
borderRadius: "4px",
|
|
318
325
|
};
|
|
319
326
|
const amount = item.ruleType === "FIXED_GLOBAL_REWARD"
|
|
320
327
|
? item.prettySourceValue
|
|
321
|
-
: item.
|
|
322
|
-
? `${item.
|
|
323
|
-
:
|
|
328
|
+
: item.ruleType === "STEPPED_FIXED_GLOBAL_REWARD"
|
|
329
|
+
? `${(_a = item.steps[0]) === null || _a === void 0 ? void 0 : _a.sourceValue} to ${(_b = item.steps.slice(-1).pop()) === null || _b === void 0 ? void 0 : _b.prettySourceValue}`
|
|
330
|
+
: `${item.prettySourceMinValue} to ${item.prettySourceMaxValue}`;
|
|
324
331
|
return (h("div", { key: item.key, class: item.available ? sheet.classes.CardContainer : "", style: style },
|
|
325
|
-
h("sl-card", { class: sheet.classes.
|
|
332
|
+
h("sl-card", { class: sheet.classes.Card, style: {
|
|
326
333
|
cursor: item.unavailableReasonCode
|
|
327
334
|
? "not-allowed"
|
|
328
335
|
: "pointer",
|
|
329
336
|
}, onClick: () => item.available &&
|
|
330
337
|
callbacks.setExchangeState({ selectedItem: item }) },
|
|
331
|
-
item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { class: "selected
|
|
332
|
-
h(
|
|
333
|
-
h(CheckMark, null)))),
|
|
338
|
+
item.key === (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.key) && (h("div", { class: "selected" },
|
|
339
|
+
h(CheckmarkFilled, null))),
|
|
334
340
|
h("div", { style: {
|
|
335
341
|
display: "flex",
|
|
336
342
|
width: "100%",
|
|
343
|
+
height: "120px",
|
|
337
344
|
borderRadius: "3px",
|
|
338
345
|
background: item.unavailableReasonCode
|
|
339
346
|
? "rgba(0, 0, 0, 0.05)"
|
|
340
347
|
: "rgba(0, 0, 0, 0)",
|
|
341
348
|
} },
|
|
342
|
-
h("div", { class: sheet.classes.
|
|
349
|
+
h("div", { class: sheet.classes.Image, style: {
|
|
350
|
+
opacity: item.unavailableReasonCode ? "0.5" : "1",
|
|
351
|
+
} },
|
|
343
352
|
h("img", { class: item.unavailableReasonCode ? "image subdued" : "image", src: (item === null || item === void 0 ? void 0 : item.imageUrl) ||
|
|
344
353
|
getAssetPath("./assets/placeholder.png") })),
|
|
345
354
|
h("div", { class: sheet.classes.TextArea, style: {
|
|
346
355
|
opacity: item.unavailableReasonCode ? "0.5" : "1",
|
|
347
356
|
} },
|
|
348
|
-
h("div", { class: "title"
|
|
349
|
-
|
|
357
|
+
h("div", { class: "title", style: {
|
|
358
|
+
"-webkit-line-clamp": item.unavailableReasonCode
|
|
359
|
+
? "1"
|
|
360
|
+
: "2",
|
|
361
|
+
} }, (_c = item.name) !== null && _c !== void 0 ? _c : ""),
|
|
362
|
+
h("div", { class: "amount", style: {
|
|
363
|
+
"-webkit-line-clamp": item.unavailableReasonCode
|
|
364
|
+
? "1"
|
|
365
|
+
: "2",
|
|
366
|
+
} }, amount),
|
|
350
367
|
item.unavailableReasonCode && (h("div", { class: "error" }, intl.formatMessage({
|
|
351
368
|
id: "unavailableCode",
|
|
352
|
-
defaultMessage: (
|
|
369
|
+
defaultMessage: (_e = (_d = states.content) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e.notAvailableError,
|
|
353
370
|
}, {
|
|
354
371
|
unavailableReason: item.unavailableReason ||
|
|
355
372
|
item.unavailableReasonCode,
|
|
373
|
+
sourceValue: item.prettySourceValue ||
|
|
374
|
+
item.prettySourceMinValue,
|
|
356
375
|
}))))))));
|
|
357
376
|
})),
|
|
358
|
-
h("div", { class: sheet.classes.
|
|
359
|
-
h("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), disabled: !states.selectedItem },
|
|
377
|
+
h("div", { class: sheet.classes.Button },
|
|
378
|
+
h("sl-button", { class: "continue right", size: "large", onClick: () => callbacks.setStage("chooseAmount"), loading: states.loading, disabled: !states.selectedItem }, states.content.text.continueText)),
|
|
360
379
|
];
|
|
361
380
|
}
|
|
362
381
|
function chooseAmount() {
|
|
363
|
-
var _a, _b, _c;
|
|
382
|
+
var _a, _b, _c, _d;
|
|
364
383
|
const input = getInput();
|
|
365
384
|
const isDisabled = ((_a = states.selectedItem) === null || _a === void 0 ? void 0 : _a.ruleType) === "FIXED_GLOBAL_REWARD"
|
|
366
385
|
? false
|
|
@@ -369,17 +388,18 @@ export function RewardExchangeView(props) {
|
|
|
369
388
|
h("div", null, h("img", { class: sheet.classes.FullImage, src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
370
389
|
getAssetPath("./assets/placeholder.png") })),
|
|
371
390
|
h("div", { class: sheet.classes.ChooseAmount },
|
|
372
|
-
h("div", { class: "title" }, (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name)
|
|
373
|
-
((
|
|
374
|
-
((
|
|
391
|
+
h("div", { class: "title" }, (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : ""),
|
|
392
|
+
((_c = states.selectedItem) === null || _c === void 0 ? void 0 : _c.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "points" }, input)) : (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)),
|
|
393
|
+
((_d = states.selectedItem) === null || _d === void 0 ? void 0 : _d.ruleType) === "FIXED_GLOBAL_REWARD" ? (h("div", { class: "description" }, selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.description)) : (h("div", { class: "points" }, input)),
|
|
375
394
|
h("div", { class: "space" })),
|
|
376
|
-
h("div", { class: sheet.classes.
|
|
377
|
-
h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() },
|
|
378
|
-
h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled },
|
|
395
|
+
h("div", { class: sheet.classes.Button },
|
|
396
|
+
h("sl-button", { class: "cancel", size: "large", type: "text", onClick: () => callbacks.resetState() }, states.content.text.cancelText),
|
|
397
|
+
h("sl-button", { class: "continue", size: "large", onClick: () => callbacks.setStage("confirmation"), disabled: isDisabled }, states.content.text.continueToConfirmationText))));
|
|
379
398
|
}
|
|
380
399
|
function confirmation() {
|
|
400
|
+
var _a, _b;
|
|
381
401
|
return (h("div", null,
|
|
382
|
-
h("h2", { style: { margin: "20px 0" } },
|
|
402
|
+
h("h2", { style: { margin: "20px 0" } }, states.content.text.redeemTitle),
|
|
383
403
|
h("div", { style: {
|
|
384
404
|
textAlign: "center",
|
|
385
405
|
marginBottom: "var(--sl-spacing-xxx-large)",
|
|
@@ -394,27 +414,39 @@ export function RewardExchangeView(props) {
|
|
|
394
414
|
flex: "1",
|
|
395
415
|
minWidth: "100%",
|
|
396
416
|
} },
|
|
397
|
-
h("sl-card", { style: { width: "auto", maxWidth: "350px", margin: "auto" }, class: sheet.classes.
|
|
417
|
+
h("sl-card", { style: { width: "auto", maxWidth: "350px", margin: "auto" }, class: sheet.classes.Card },
|
|
398
418
|
h("div", { class: sheet.classes.Square },
|
|
399
419
|
h("img", { class: "image", src: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.imageUrl) ||
|
|
400
420
|
getAssetPath("./assets/placeholder.png") })),
|
|
401
421
|
h("div", { class: sheet.classes.TextArea, style: {
|
|
402
422
|
lineHeight: "18px",
|
|
403
423
|
alignSelf: "center",
|
|
404
|
-
} }, (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) ? (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) +
|
|
405
|
-
" " + (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) || ""
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
h("sl-button", { class: "
|
|
409
|
-
h("sl-button", { class: "continue", size: "large", onClick: callbacks.exchangeReward }, "Redeem"))));
|
|
424
|
+
} }, (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) ? (_a = (selectedStep === null || selectedStep === void 0 ? void 0 : selectedStep.prettyDestinationValue) +
|
|
425
|
+
" " + (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name)) !== null && _a !== void 0 ? _a : "" : (_b = selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.name) !== null && _b !== void 0 ? _b : "")))),
|
|
426
|
+
h("div", { class: sheet.classes.Button },
|
|
427
|
+
h("sl-button", { class: "cancel", type: "text", size: "large", onClick: () => callbacks.setStage("chooseAmount") }, states.content.text.backText),
|
|
428
|
+
h("sl-button", { class: "continue", size: "large", loading: states.loading, onClick: callbacks.exchangeReward }, states.content.text.redeemText))));
|
|
410
429
|
}
|
|
411
430
|
function success() {
|
|
431
|
+
var _a, _b, _c;
|
|
412
432
|
return (h("div", { class: sheet.classes.Success },
|
|
413
433
|
h(Gift, null),
|
|
414
|
-
h("div", { class: "title" },
|
|
415
|
-
h("div", { class: "description" },
|
|
416
|
-
|
|
417
|
-
|
|
434
|
+
h("div", { class: "title" }, states.content.text.rewardRedeemedText),
|
|
435
|
+
h("div", { class: "description" }, intl.formatMessage({
|
|
436
|
+
id: "successMessage",
|
|
437
|
+
defaultMessage: states.content.text.redemptionSuccessText,
|
|
438
|
+
}, {
|
|
439
|
+
sourceValue: (_a = states.selectedItem.prettySourceValue) !== null && _a !== void 0 ? _a : (_b = states.selectedStep) === null || _b === void 0 ? void 0 : _b.prettySourceValue,
|
|
440
|
+
destinationValue: ((_c = states.selectedStep) === null || _c === void 0 ? void 0 : _c.prettyDestinationValue) ||
|
|
441
|
+
states.selectedItem.globalRewardKey,
|
|
442
|
+
})),
|
|
443
|
+
(data === null || data === void 0 ? void 0 : data.fuelTankCode) && (h("div", { style: {
|
|
444
|
+
width: "40%",
|
|
445
|
+
margin: "-30px auto var(--sl-spacing-xxx-large) auto",
|
|
446
|
+
} },
|
|
447
|
+
h(ShareLinkView, { shareString: data.fuelTankCode, tooltiptext: "Copied", open: states.open, onClick: callbacks.copyFuelTankCode }))),
|
|
448
|
+
h("div", { class: sheet.classes.Button },
|
|
449
|
+
h("sl-button", { class: "continue center", type: "primary", size: "large", onClick: () => callbacks.resetState(true) }, states.content.text.doneText))));
|
|
418
450
|
}
|
|
419
451
|
const stages = {
|
|
420
452
|
chooseReward: () => chooseReward(),
|
|
@@ -437,25 +469,39 @@ export function RewardExchangeView(props) {
|
|
|
437
469
|
h(ProgressBar, { stageCount: 3, currentStage: stageNumber })));
|
|
438
470
|
}
|
|
439
471
|
function loading() {
|
|
440
|
-
return (h("div", {
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
472
|
+
return (h("div", { class: sheet.classes.Grid }, [...Array(8)].map(() => {
|
|
473
|
+
return (h("div", { class: sheet.classes.CardContainer },
|
|
474
|
+
h("sl-card", { class: sheet.classes.Card },
|
|
475
|
+
h("div", { class: sheet.classes.CardLayout },
|
|
476
|
+
h("div", null,
|
|
477
|
+
h("sl-skeleton", { style: {
|
|
478
|
+
width: "100px",
|
|
479
|
+
height: "100px",
|
|
480
|
+
margin: "9px",
|
|
481
|
+
"--border-radius": "4px",
|
|
482
|
+
} })),
|
|
483
|
+
h("div", { style: { margin: "12px 12px 0 0", width: "100%" } },
|
|
484
|
+
h("sl-skeleton", { style: { marginBottom: "12px" } }),
|
|
485
|
+
h("sl-skeleton", { style: { marginBottom: "12px" } }),
|
|
486
|
+
h("sl-skeleton", { style: { width: "45%" } }))))));
|
|
487
|
+
})));
|
|
448
488
|
}
|
|
449
489
|
function errorMessage() {
|
|
450
490
|
return (h("sl-alert", { type: "danger", open: true },
|
|
451
491
|
h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
|
|
452
|
-
|
|
492
|
+
states.content.text.redemptionError));
|
|
493
|
+
}
|
|
494
|
+
function queryErrorMessage() {
|
|
495
|
+
return (h("sl-alert", { type: "danger", open: true },
|
|
496
|
+
h("sl-icon", { slot: "icon", name: "exclamation-octagon" }),
|
|
497
|
+
states.content.text.queryError));
|
|
453
498
|
}
|
|
454
499
|
return (h("div", { class: sheet.classes.Container },
|
|
455
500
|
h("style", { type: "text/css" }, styleString),
|
|
456
501
|
h("div", null,
|
|
457
502
|
stageMap(),
|
|
458
|
-
states.loading && loading(),
|
|
503
|
+
states.redeemStage === "chooseReward" && states.loading && loading(),
|
|
459
504
|
states.exchangeError && errorMessage(),
|
|
505
|
+
states.queryError && queryErrorMessage(),
|
|
460
506
|
currentStage && currentStage())));
|
|
461
507
|
}
|