@wlloyalty/wll-react-sdk 1.0.48 → 1.0.50
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/index.d.ts +1 -1
- package/dist/index.js +19 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -207,7 +207,7 @@ declare class BannerTileConfig {
|
|
|
207
207
|
}
|
|
208
208
|
declare class PointsTileConfig {
|
|
209
209
|
title?: string | null;
|
|
210
|
-
|
|
210
|
+
pointsMultiplier?: number;
|
|
211
211
|
pointsPrefix?: string | null;
|
|
212
212
|
pointsSuffix?: string | null;
|
|
213
213
|
artworkUrl?: string | null;
|
package/dist/index.js
CHANGED
|
@@ -20686,6 +20686,16 @@ var GroupEmptyState = function (_a) {
|
|
|
20686
20686
|
}, message));
|
|
20687
20687
|
};
|
|
20688
20688
|
|
|
20689
|
+
/**
|
|
20690
|
+
* Calculates points based on a base value and multiplier
|
|
20691
|
+
* @param baseValue The base value to calculate points from (can be points or price)
|
|
20692
|
+
* @param pointsMultiplier Optional multiplier value (defaults to 1)
|
|
20693
|
+
* @returns The calculated points value
|
|
20694
|
+
*/
|
|
20695
|
+
var calculatePoints = function (baseValue, pointsMultiplier) {
|
|
20696
|
+
return baseValue * Number(pointsMultiplier !== null && pointsMultiplier !== void 0 ? pointsMultiplier : 1);
|
|
20697
|
+
};
|
|
20698
|
+
|
|
20689
20699
|
var justifyMap = {
|
|
20690
20700
|
start: 'flex-start',
|
|
20691
20701
|
end: 'flex-end',
|
|
@@ -20894,15 +20904,15 @@ var PointsTileFormattedPoints = function () {
|
|
|
20894
20904
|
var styles = usePointsTileStyles();
|
|
20895
20905
|
var configuration = useTileContext().configuration;
|
|
20896
20906
|
var _a = configuration,
|
|
20897
|
-
_b = _a.
|
|
20898
|
-
|
|
20907
|
+
_b = _a.pointsMultiplier,
|
|
20908
|
+
pointsMultiplier = _b === void 0 ? 1 : _b,
|
|
20899
20909
|
_c = _a.pointsPrefix,
|
|
20900
20910
|
pointsPrefix = _c === void 0 ? '' : _c,
|
|
20901
20911
|
_d = _a.pointsSuffix,
|
|
20902
20912
|
pointsSuffix = _d === void 0 ? 'pts' : _d,
|
|
20903
20913
|
points = _a.points;
|
|
20904
20914
|
if (points === undefined) return null;
|
|
20905
|
-
var calculatedPoints = points
|
|
20915
|
+
var calculatedPoints = calculatePoints(points, pointsMultiplier);
|
|
20906
20916
|
var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix);
|
|
20907
20917
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
20908
20918
|
accessible: true,
|
|
@@ -21173,24 +21183,22 @@ var RewardTilePoints = function () {
|
|
|
21173
21183
|
// Exit early if price is not shown or undefined
|
|
21174
21184
|
if (!showPrice || price === undefined) return null;
|
|
21175
21185
|
// Calculate points
|
|
21176
|
-
var calculatedPoints = price
|
|
21177
|
-
var fullPointsText = "".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix);
|
|
21186
|
+
var calculatedPoints = calculatePoints(price, pointsMultiplier);
|
|
21178
21187
|
return /*#__PURE__*/React.createElement(View$2, {
|
|
21179
21188
|
accessible: true,
|
|
21180
21189
|
accessibilityRole: "text",
|
|
21181
|
-
accessibilityLabel: "Reward points: ".concat(
|
|
21190
|
+
accessibilityLabel: "Reward points: ".concat(pointsPrefix).concat(calculatedPoints, " ").concat(pointsSuffix)
|
|
21182
21191
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
21183
21192
|
variant: "caption",
|
|
21184
|
-
style: styles.footer
|
|
21185
|
-
|
|
21186
|
-
importantForAccessibility: "no-hide-descendants"
|
|
21187
|
-
}, pointsPrefix, /*#__PURE__*/React.createElement(View$2, {
|
|
21193
|
+
style: styles.footer
|
|
21194
|
+
}, pointsPrefix), /*#__PURE__*/React.createElement(View$2, {
|
|
21188
21195
|
style: styles.pointsContainer
|
|
21189
21196
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
21190
21197
|
variant: "caption"
|
|
21191
21198
|
}, calculatedPoints), /*#__PURE__*/React.createElement(Text, {
|
|
21199
|
+
variant: "caption",
|
|
21192
21200
|
style: styles.suffix
|
|
21193
|
-
}, pointsSuffix)))
|
|
21201
|
+
}, pointsSuffix)));
|
|
21194
21202
|
};
|
|
21195
21203
|
|
|
21196
21204
|
var RewardTileSummary = function () {
|