@wlloyalty/wll-react-sdk 1.0.29 → 1.0.31
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 +67 -41
- package/dist/index.js +364 -271
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18870,7 +18870,6 @@ MemoedPressable.displayName = 'Pressable';
|
|
|
18870
18870
|
var Pressable$1 = MemoedPressable;
|
|
18871
18871
|
|
|
18872
18872
|
var MAX_WIDTH = 1080;
|
|
18873
|
-
var SLIDE_WIDTH = MAX_WIDTH;
|
|
18874
18873
|
var BUTTON_SIZE = 42;
|
|
18875
18874
|
|
|
18876
18875
|
var useHandleTilePress = function (ctaLink, ctaLinkTarget) {
|
|
@@ -19408,70 +19407,6 @@ var useBadgeTileStyles = function () {
|
|
|
19408
19407
|
});
|
|
19409
19408
|
};
|
|
19410
19409
|
|
|
19411
|
-
var BadgeTileInner = function (_a) {
|
|
19412
|
-
var tile = _a.tile;
|
|
19413
|
-
var styles = useBadgeTileStyles();
|
|
19414
|
-
if (!tile) return null;
|
|
19415
|
-
return /*#__PURE__*/React$1.createElement(BaseTile, {
|
|
19416
|
-
tile: tile
|
|
19417
|
-
}, /*#__PURE__*/React$1.createElement(View$2, {
|
|
19418
|
-
style: styles.container
|
|
19419
|
-
}, /*#__PURE__*/React$1.createElement(BadgeTile.Media, null, /*#__PURE__*/React$1.createElement(BadgeTile.Status, null)), /*#__PURE__*/React$1.createElement(Column$1, {
|
|
19420
|
-
justify: "between",
|
|
19421
|
-
align: "start"
|
|
19422
|
-
}, /*#__PURE__*/React$1.createElement(View$2, null, /*#__PURE__*/React$1.createElement(BadgeTile.Title, null), /*#__PURE__*/React$1.createElement(BadgeTile.Description, null)), /*#__PURE__*/React$1.createElement(BadgeTile.DateEarned, null))));
|
|
19423
|
-
};
|
|
19424
|
-
var BadgeTileMedia = function (_a) {
|
|
19425
|
-
var children = _a.children,
|
|
19426
|
-
props = __rest(_a, ["children"]);
|
|
19427
|
-
var styles = useBadgeTileStyles();
|
|
19428
|
-
var tile = useTileContext();
|
|
19429
|
-
var configuration = tile.configuration;
|
|
19430
|
-
var type = configuration.type,
|
|
19431
|
-
count = configuration.count,
|
|
19432
|
-
artworkUrl = configuration.artworkUrl,
|
|
19433
|
-
emptyBadgeArtworkUrl = configuration.emptyBadgeArtworkUrl;
|
|
19434
|
-
var displayUrl = count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
|
|
19435
|
-
if (!displayUrl) return null;
|
|
19436
|
-
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
19437
|
-
style: styles.header
|
|
19438
|
-
}, /*#__PURE__*/React$1.createElement(ProgressiveImage, _extends({}, props, {
|
|
19439
|
-
source: {
|
|
19440
|
-
uri: displayUrl
|
|
19441
|
-
},
|
|
19442
|
-
style: styles.image,
|
|
19443
|
-
resizeMode: "contain",
|
|
19444
|
-
isDesaturated: shouldDesaturate(type, count)
|
|
19445
|
-
})), children);
|
|
19446
|
-
};
|
|
19447
|
-
var BadgeTileTitle = function () {
|
|
19448
|
-
var styles = useBadgeTileStyles();
|
|
19449
|
-
var tile = useTileContext();
|
|
19450
|
-
var configuration = tile.configuration;
|
|
19451
|
-
var count = configuration.count,
|
|
19452
|
-
name = configuration.name,
|
|
19453
|
-
emptyBadgeMessage = configuration.emptyBadgeMessage;
|
|
19454
|
-
var displayText = count === 0 ? emptyBadgeMessage : name;
|
|
19455
|
-
if (!displayText) return null;
|
|
19456
|
-
return /*#__PURE__*/React$1.createElement(View$2, null, /*#__PURE__*/React$1.createElement(Text, {
|
|
19457
|
-
variant: "title",
|
|
19458
|
-
style: styles.titleText,
|
|
19459
|
-
numberOfLines: 2,
|
|
19460
|
-
ellipsizeMode: "tail"
|
|
19461
|
-
}, displayText));
|
|
19462
|
-
};
|
|
19463
|
-
var BadgeTileDescription = function () {
|
|
19464
|
-
var tile = useTileContext();
|
|
19465
|
-
var configuration = tile.configuration;
|
|
19466
|
-
var count = configuration.count,
|
|
19467
|
-
description = configuration.description;
|
|
19468
|
-
if (count === 0 || !description) return null;
|
|
19469
|
-
return /*#__PURE__*/React$1.createElement(Text, {
|
|
19470
|
-
variant: "body",
|
|
19471
|
-
numberOfLines: 2,
|
|
19472
|
-
ellipsizeMode: "tail"
|
|
19473
|
-
}, description);
|
|
19474
|
-
};
|
|
19475
19410
|
var BadgeTileDateEarned = function () {
|
|
19476
19411
|
var styles = useBadgeTileStyles();
|
|
19477
19412
|
var tile = useTileContext();
|
|
@@ -19503,6 +19438,44 @@ var BadgeTileDateEarned = function () {
|
|
|
19503
19438
|
variant: "label"
|
|
19504
19439
|
}, "".concat(awardedDatePrefix, " ").concat(formattedDate)));
|
|
19505
19440
|
};
|
|
19441
|
+
|
|
19442
|
+
var BadgeTileDescription = function () {
|
|
19443
|
+
var tile = useTileContext();
|
|
19444
|
+
var configuration = tile.configuration;
|
|
19445
|
+
var count = configuration.count,
|
|
19446
|
+
description = configuration.description;
|
|
19447
|
+
if (count === 0 || !description) return null;
|
|
19448
|
+
return /*#__PURE__*/React$1.createElement(Text, {
|
|
19449
|
+
variant: "body",
|
|
19450
|
+
numberOfLines: 2,
|
|
19451
|
+
ellipsizeMode: "tail"
|
|
19452
|
+
}, description);
|
|
19453
|
+
};
|
|
19454
|
+
|
|
19455
|
+
var BadgeTileMedia = function (_a) {
|
|
19456
|
+
var children = _a.children,
|
|
19457
|
+
props = __rest(_a, ["children"]);
|
|
19458
|
+
var styles = useBadgeTileStyles();
|
|
19459
|
+
var tile = useTileContext();
|
|
19460
|
+
var configuration = tile.configuration;
|
|
19461
|
+
var type = configuration.type,
|
|
19462
|
+
count = configuration.count,
|
|
19463
|
+
artworkUrl = configuration.artworkUrl,
|
|
19464
|
+
emptyBadgeArtworkUrl = configuration.emptyBadgeArtworkUrl;
|
|
19465
|
+
var displayUrl = count === 0 ? emptyBadgeArtworkUrl : artworkUrl;
|
|
19466
|
+
if (!displayUrl) return null;
|
|
19467
|
+
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
19468
|
+
style: styles.header
|
|
19469
|
+
}, /*#__PURE__*/React$1.createElement(ProgressiveImage, _extends({}, props, {
|
|
19470
|
+
source: {
|
|
19471
|
+
uri: displayUrl
|
|
19472
|
+
},
|
|
19473
|
+
style: styles.image,
|
|
19474
|
+
resizeMode: "contain",
|
|
19475
|
+
isDesaturated: shouldDesaturate(type, count)
|
|
19476
|
+
})), children);
|
|
19477
|
+
};
|
|
19478
|
+
|
|
19506
19479
|
var BadgeTileStatus = function () {
|
|
19507
19480
|
var styles = useBadgeTileStyles();
|
|
19508
19481
|
var tile = useTileContext();
|
|
@@ -19521,13 +19494,56 @@ var BadgeTileStatus = function () {
|
|
|
19521
19494
|
style: styles.countText
|
|
19522
19495
|
}, count, "x"));
|
|
19523
19496
|
};
|
|
19524
|
-
|
|
19497
|
+
|
|
19498
|
+
var BadgeTileTitle = function () {
|
|
19499
|
+
var styles = useBadgeTileStyles();
|
|
19500
|
+
var tile = useTileContext();
|
|
19501
|
+
var configuration = tile.configuration;
|
|
19502
|
+
var count = configuration.count,
|
|
19503
|
+
name = configuration.name,
|
|
19504
|
+
emptyBadgeMessage = configuration.emptyBadgeMessage;
|
|
19505
|
+
var displayText = count === 0 ? emptyBadgeMessage : name;
|
|
19506
|
+
if (!displayText) return null;
|
|
19507
|
+
return /*#__PURE__*/React$1.createElement(View$2, null, /*#__PURE__*/React$1.createElement(Text, {
|
|
19508
|
+
variant: "title",
|
|
19509
|
+
style: styles.titleText,
|
|
19510
|
+
numberOfLines: 2,
|
|
19511
|
+
ellipsizeMode: "tail"
|
|
19512
|
+
}, displayText));
|
|
19513
|
+
};
|
|
19514
|
+
|
|
19515
|
+
var BadgeTileMain = function (_a) {
|
|
19516
|
+
var tile = _a.tile;
|
|
19517
|
+
if (!tile) return null;
|
|
19518
|
+
return /*#__PURE__*/React$1.createElement(BaseTile, {
|
|
19519
|
+
tile: tile
|
|
19520
|
+
}, /*#__PURE__*/React$1.createElement(BadgeTile.Media, null, /*#__PURE__*/React$1.createElement(BadgeTile.Status, null)), /*#__PURE__*/React$1.createElement(Column, {
|
|
19521
|
+
justify: "between",
|
|
19522
|
+
align: "start"
|
|
19523
|
+
}, /*#__PURE__*/React$1.createElement(View$2, null, /*#__PURE__*/React$1.createElement(BadgeTile.Title, null), /*#__PURE__*/React$1.createElement(BadgeTile.Description, null)), /*#__PURE__*/React$1.createElement(BadgeTile.DateEarned, null)));
|
|
19524
|
+
};
|
|
19525
|
+
var BadgeTile = BadgeTileMain;
|
|
19525
19526
|
BadgeTile.Media = BadgeTileMedia;
|
|
19526
19527
|
BadgeTile.Title = BadgeTileTitle;
|
|
19527
19528
|
BadgeTile.Description = BadgeTileDescription;
|
|
19528
19529
|
BadgeTile.DateEarned = BadgeTileDateEarned;
|
|
19529
19530
|
BadgeTile.Status = BadgeTileStatus;
|
|
19530
19531
|
|
|
19532
|
+
var BannerTileCTA = function () {
|
|
19533
|
+
var configuration = useBannerContext().configuration;
|
|
19534
|
+
var _a = configuration,
|
|
19535
|
+
ctaText = _a.ctaText,
|
|
19536
|
+
ctaLink = _a.ctaLink,
|
|
19537
|
+
ctaLinkTarget = _a.ctaLinkTarget;
|
|
19538
|
+
var handlePress = useHandleTilePress(ctaLink, ctaLinkTarget);
|
|
19539
|
+
if (!ctaText) return null;
|
|
19540
|
+
return /*#__PURE__*/React$1.createElement(Button, {
|
|
19541
|
+
title: ctaText,
|
|
19542
|
+
variant: "accent",
|
|
19543
|
+
onPress: handlePress
|
|
19544
|
+
});
|
|
19545
|
+
};
|
|
19546
|
+
|
|
19531
19547
|
var useBannerTileStyles = function () {
|
|
19532
19548
|
var _a = useResponsive$1(),
|
|
19533
19549
|
isDesktop = _a.isDesktop,
|
|
@@ -19538,12 +19554,11 @@ var useBannerTileStyles = function () {
|
|
|
19538
19554
|
flex: 1
|
|
19539
19555
|
},
|
|
19540
19556
|
mediaContainer: {
|
|
19541
|
-
width: '30%',
|
|
19542
19557
|
aspectRatio: 1,
|
|
19543
19558
|
position: 'relative',
|
|
19544
19559
|
overflow: 'hidden',
|
|
19545
19560
|
marginRight: useResponsiveValue(theme.sizes.xxl, theme.sizes.xxs, isDesktop, isTablet),
|
|
19546
|
-
|
|
19561
|
+
maxHeight: 320
|
|
19547
19562
|
},
|
|
19548
19563
|
media: {
|
|
19549
19564
|
position: 'absolute',
|
|
@@ -19564,70 +19579,75 @@ var useBannerTileStyles = function () {
|
|
|
19564
19579
|
});
|
|
19565
19580
|
};
|
|
19566
19581
|
|
|
19567
|
-
var
|
|
19568
|
-
var tile = _a.tile;
|
|
19582
|
+
var BannerTileDescription = function () {
|
|
19569
19583
|
var styles = useBannerTileStyles();
|
|
19570
|
-
|
|
19571
|
-
|
|
19572
|
-
|
|
19573
|
-
|
|
19574
|
-
|
|
19584
|
+
var configuration = useBannerContext().configuration;
|
|
19585
|
+
var description = configuration.description;
|
|
19586
|
+
var theme = useWllSdk().theme;
|
|
19587
|
+
if (!description) return null;
|
|
19588
|
+
return /*#__PURE__*/React$1.createElement(Text, {
|
|
19589
|
+
style: [styles.description, {
|
|
19590
|
+
color: theme.derivedSurfaceText[20]
|
|
19591
|
+
}]
|
|
19592
|
+
}, description);
|
|
19575
19593
|
};
|
|
19576
|
-
|
|
19594
|
+
|
|
19595
|
+
var BannerTileMedia = function (_a) {
|
|
19596
|
+
var isArtworkOnly = _a.isArtworkOnly;
|
|
19577
19597
|
var styles = useBannerTileStyles();
|
|
19578
19598
|
var configuration = useBannerContext().configuration;
|
|
19579
19599
|
var artworkUrl = configuration.artworkUrl;
|
|
19580
19600
|
if (!artworkUrl) return null;
|
|
19581
|
-
|
|
19582
|
-
|
|
19583
|
-
}
|
|
19584
|
-
|
|
19585
|
-
|
|
19586
|
-
|
|
19587
|
-
|
|
19588
|
-
|
|
19601
|
+
var containerStyle = {
|
|
19602
|
+
width: isArtworkOnly ? '100%' : '30%'
|
|
19603
|
+
};
|
|
19604
|
+
return (
|
|
19605
|
+
/*#__PURE__*/
|
|
19606
|
+
// @ts-ignore: We are using percentage values for width, which is valid in React Native but TypeScript expects a number.
|
|
19607
|
+
React$1.createElement(View$2, {
|
|
19608
|
+
style: [styles.mediaContainer, containerStyle]
|
|
19609
|
+
}, /*#__PURE__*/React$1.createElement(ProgressiveImage, {
|
|
19610
|
+
source: {
|
|
19611
|
+
uri: artworkUrl
|
|
19612
|
+
},
|
|
19613
|
+
style: styles.media
|
|
19614
|
+
}))
|
|
19615
|
+
);
|
|
19589
19616
|
};
|
|
19617
|
+
|
|
19590
19618
|
var BannerTileTitle = function () {
|
|
19591
19619
|
var styles = useBannerTileStyles();
|
|
19592
19620
|
var configuration = useBannerContext().configuration;
|
|
19593
19621
|
var title = configuration.title;
|
|
19594
19622
|
if (!title) return null;
|
|
19595
|
-
return /*#__PURE__*/
|
|
19623
|
+
return /*#__PURE__*/React$1.createElement(Text, {
|
|
19596
19624
|
variant: "title",
|
|
19597
19625
|
style: styles.title
|
|
19598
19626
|
}, title);
|
|
19599
19627
|
};
|
|
19600
|
-
|
|
19628
|
+
|
|
19629
|
+
var BannerTile = function (_a) {
|
|
19630
|
+
var tile = _a.tile;
|
|
19601
19631
|
var styles = useBannerTileStyles();
|
|
19602
|
-
var configuration =
|
|
19603
|
-
var
|
|
19604
|
-
|
|
19605
|
-
|
|
19606
|
-
|
|
19607
|
-
|
|
19608
|
-
|
|
19609
|
-
|
|
19610
|
-
},
|
|
19611
|
-
};
|
|
19612
|
-
var BannerTileCTA = function () {
|
|
19613
|
-
var configuration = useBannerContext().configuration;
|
|
19614
|
-
var _a = configuration,
|
|
19615
|
-
ctaText = _a.ctaText,
|
|
19616
|
-
ctaLink = _a.ctaLink,
|
|
19617
|
-
ctaLinkTarget = _a.ctaLinkTarget;
|
|
19618
|
-
var handlePress = useHandleTilePress(ctaLink, ctaLinkTarget);
|
|
19619
|
-
if (!ctaText) return null;
|
|
19620
|
-
return /*#__PURE__*/React__namespace.createElement(Button, {
|
|
19621
|
-
title: ctaText,
|
|
19622
|
-
variant: "accent",
|
|
19623
|
-
onPress: handlePress
|
|
19624
|
-
});
|
|
19632
|
+
var configuration = tile.configuration;
|
|
19633
|
+
var isArtworkOnly = !configuration.title && !configuration.description && !configuration.ctaText;
|
|
19634
|
+
return /*#__PURE__*/React__namespace.createElement(BaseBanner, {
|
|
19635
|
+
tile: tile
|
|
19636
|
+
}, /*#__PURE__*/React__namespace.createElement(BannerTile.Media, {
|
|
19637
|
+
isArtworkOnly: isArtworkOnly
|
|
19638
|
+
}), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
19639
|
+
style: styles.slideContent
|
|
19640
|
+
}, /*#__PURE__*/React__namespace.createElement(BannerTile.Title, null), /*#__PURE__*/React__namespace.createElement(BannerTile.Description, null), /*#__PURE__*/React__namespace.createElement(BannerTile.CTA, null)));
|
|
19625
19641
|
};
|
|
19626
19642
|
BannerTile.Media = BannerTileMedia;
|
|
19627
19643
|
BannerTile.Title = BannerTileTitle;
|
|
19628
19644
|
BannerTile.Description = BannerTileDescription;
|
|
19629
19645
|
BannerTile.CTA = BannerTileCTA;
|
|
19630
19646
|
|
|
19647
|
+
var ContentTileBody = function () {
|
|
19648
|
+
return /*#__PURE__*/React$1.createElement(BaseTile.Body, null);
|
|
19649
|
+
};
|
|
19650
|
+
|
|
19631
19651
|
var useContentTileStyles = function () {
|
|
19632
19652
|
var theme = useWllSdk().theme;
|
|
19633
19653
|
var _a = useResponsive$1(),
|
|
@@ -19645,39 +19665,40 @@ var useContentTileStyles = function () {
|
|
|
19645
19665
|
});
|
|
19646
19666
|
};
|
|
19647
19667
|
|
|
19648
|
-
var ContentTileInner = function (_a) {
|
|
19649
|
-
var tile = _a.tile;
|
|
19650
|
-
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
19651
|
-
tile: tile
|
|
19652
|
-
}, /*#__PURE__*/React__namespace.createElement(ContentTile.Root, null, /*#__PURE__*/React__namespace.createElement(ContentTile.Media, null), /*#__PURE__*/React__namespace.createElement(ContentTile.Content, null, /*#__PURE__*/React__namespace.createElement(ContentTile.Header, null), /*#__PURE__*/React__namespace.createElement(ContentTile.Body, null))));
|
|
19653
|
-
};
|
|
19654
|
-
var ContentTileRoot = function (_a) {
|
|
19655
|
-
var children = _a.children;
|
|
19656
|
-
return /*#__PURE__*/React__namespace.createElement(BaseTile.Root, null, children);
|
|
19657
|
-
};
|
|
19658
|
-
var ContentTileMedia = function () {
|
|
19659
|
-
var styles = useContentTileStyles();
|
|
19660
|
-
return /*#__PURE__*/React__namespace.createElement(BaseTile.Media, {
|
|
19661
|
-
style: styles.media
|
|
19662
|
-
});
|
|
19663
|
-
};
|
|
19664
19668
|
var ContentTileContent = function (_a) {
|
|
19665
19669
|
var children = _a.children;
|
|
19666
19670
|
var styles = useContentTileStyles();
|
|
19667
|
-
return /*#__PURE__*/
|
|
19671
|
+
return /*#__PURE__*/React$1.createElement(BaseTile.Content, null, /*#__PURE__*/React$1.createElement(View$2, {
|
|
19668
19672
|
style: styles.content
|
|
19669
19673
|
}, children));
|
|
19670
19674
|
};
|
|
19675
|
+
|
|
19671
19676
|
var ContentTileHeader = function () {
|
|
19672
19677
|
var tile = useTileContext();
|
|
19673
19678
|
var title = tile.configuration.title;
|
|
19674
19679
|
if (!title) return null;
|
|
19675
|
-
return /*#__PURE__*/
|
|
19680
|
+
return /*#__PURE__*/React$1.createElement(BaseTile.Header, null, /*#__PURE__*/React$1.createElement(BaseTile.Title, null));
|
|
19676
19681
|
};
|
|
19677
|
-
|
|
19678
|
-
|
|
19682
|
+
|
|
19683
|
+
var ContentTileMedia = function () {
|
|
19684
|
+
var styles = useContentTileStyles();
|
|
19685
|
+
return /*#__PURE__*/React$1.createElement(BaseTile.Media, {
|
|
19686
|
+
style: styles.media
|
|
19687
|
+
});
|
|
19679
19688
|
};
|
|
19680
|
-
|
|
19689
|
+
|
|
19690
|
+
var ContentTileRoot = function (_a) {
|
|
19691
|
+
var children = _a.children;
|
|
19692
|
+
return /*#__PURE__*/React$1.createElement(BaseTile.Root, null, children);
|
|
19693
|
+
};
|
|
19694
|
+
|
|
19695
|
+
var ContentTileMain = function (_a) {
|
|
19696
|
+
var tile = _a.tile;
|
|
19697
|
+
return /*#__PURE__*/React$1.createElement(BaseTile, {
|
|
19698
|
+
tile: tile
|
|
19699
|
+
}, /*#__PURE__*/React$1.createElement(ContentTile.Root, null, /*#__PURE__*/React$1.createElement(ContentTile.Media, null), /*#__PURE__*/React$1.createElement(ContentTile.Content, null, /*#__PURE__*/React$1.createElement(ContentTile.Header, null), /*#__PURE__*/React$1.createElement(ContentTile.Body, null))));
|
|
19700
|
+
};
|
|
19701
|
+
var ContentTile = ContentTileMain;
|
|
19681
19702
|
ContentTile.Root = ContentTileRoot;
|
|
19682
19703
|
ContentTile.Media = ContentTileMedia;
|
|
19683
19704
|
ContentTile.Content = ContentTileContent;
|
|
@@ -19706,6 +19727,39 @@ exports.SectionType = void 0;
|
|
|
19706
19727
|
SectionType["Banner"] = "BANNER";
|
|
19707
19728
|
})(exports.SectionType || (exports.SectionType = {}));
|
|
19708
19729
|
|
|
19730
|
+
/**
|
|
19731
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
19732
|
+
*
|
|
19733
|
+
* This source code is licensed under the MIT license found in the
|
|
19734
|
+
* LICENSE file in the root directory of this source tree.
|
|
19735
|
+
*
|
|
19736
|
+
* @format
|
|
19737
|
+
*
|
|
19738
|
+
*/
|
|
19739
|
+
|
|
19740
|
+
function useWindowDimensions() {
|
|
19741
|
+
var _useState = React$1.useState(() => Dimensions.get('window')),
|
|
19742
|
+
dims = _useState[0],
|
|
19743
|
+
setDims = _useState[1];
|
|
19744
|
+
React$1.useEffect(() => {
|
|
19745
|
+
function handleChange(_ref) {
|
|
19746
|
+
var window = _ref.window;
|
|
19747
|
+
if (window != null) {
|
|
19748
|
+
setDims(window);
|
|
19749
|
+
}
|
|
19750
|
+
}
|
|
19751
|
+
Dimensions.addEventListener('change', handleChange);
|
|
19752
|
+
// We might have missed an update between calling `get` in render and
|
|
19753
|
+
// `addEventListener` in this handler, so we set it here. If there was
|
|
19754
|
+
// no change, React will filter out this update as a no-op.
|
|
19755
|
+
setDims(Dimensions.get('window'));
|
|
19756
|
+
return () => {
|
|
19757
|
+
Dimensions.removeEventListener('change', handleChange);
|
|
19758
|
+
};
|
|
19759
|
+
}, []);
|
|
19760
|
+
return dims;
|
|
19761
|
+
}
|
|
19762
|
+
|
|
19709
19763
|
var useSectionHeaderStyles = function () {
|
|
19710
19764
|
var _a = useResponsive$1(),
|
|
19711
19765
|
isDesktop = _a.isDesktop,
|
|
@@ -19750,7 +19804,7 @@ var SectionHeader = function (_a) {
|
|
|
19750
19804
|
}, description));
|
|
19751
19805
|
};
|
|
19752
19806
|
|
|
19753
|
-
var useCarouselStyles = function (buttonSize
|
|
19807
|
+
var useCarouselStyles = function (buttonSize) {
|
|
19754
19808
|
if (buttonSize === void 0) {
|
|
19755
19809
|
buttonSize = 42;
|
|
19756
19810
|
}
|
|
@@ -19760,8 +19814,8 @@ var useCarouselStyles = function (buttonSize, slideWidth) {
|
|
|
19760
19814
|
var theme = useWllSdk().theme;
|
|
19761
19815
|
return StyleSheet$1.create({
|
|
19762
19816
|
container: {
|
|
19763
|
-
|
|
19764
|
-
|
|
19817
|
+
width: '100%',
|
|
19818
|
+
flex: 1
|
|
19765
19819
|
},
|
|
19766
19820
|
sectionTitle: {
|
|
19767
19821
|
fontSize: 31,
|
|
@@ -19777,13 +19831,18 @@ var useCarouselStyles = function (buttonSize, slideWidth) {
|
|
|
19777
19831
|
marginBottom: 20
|
|
19778
19832
|
},
|
|
19779
19833
|
carouselContainer: {
|
|
19834
|
+
width: '100%',
|
|
19780
19835
|
flexDirection: 'row',
|
|
19781
19836
|
alignItems: 'center',
|
|
19782
|
-
justifyContent: 'center'
|
|
19837
|
+
justifyContent: 'center',
|
|
19838
|
+
position: 'relative'
|
|
19783
19839
|
},
|
|
19784
19840
|
carouselContent: {
|
|
19785
|
-
|
|
19786
|
-
|
|
19841
|
+
width: '100%',
|
|
19842
|
+
overflow: 'hidden'
|
|
19843
|
+
},
|
|
19844
|
+
slideContainer: {
|
|
19845
|
+
width: '100%'
|
|
19787
19846
|
},
|
|
19788
19847
|
navButton: {
|
|
19789
19848
|
position: 'absolute',
|
|
@@ -19806,9 +19865,6 @@ var useCarouselStyles = function (buttonSize, slideWidth) {
|
|
|
19806
19865
|
right: -buttonSize / 2,
|
|
19807
19866
|
backgroundColor: theme.surface
|
|
19808
19867
|
},
|
|
19809
|
-
slideContainer: {
|
|
19810
|
-
width: slideWidth
|
|
19811
|
-
},
|
|
19812
19868
|
indicators: {
|
|
19813
19869
|
flexDirection: 'row',
|
|
19814
19870
|
justifyContent: 'center',
|
|
@@ -19829,36 +19885,41 @@ var useCarouselStyles = function (buttonSize, slideWidth) {
|
|
|
19829
19885
|
|
|
19830
19886
|
var Carousel = function (_a) {
|
|
19831
19887
|
var section = _a.section;
|
|
19832
|
-
var
|
|
19888
|
+
var windowWidth = useWindowDimensions().width;
|
|
19889
|
+
var containerRef = React$1.useRef(null);
|
|
19890
|
+
var _b = React$1.useState(windowWidth),
|
|
19891
|
+
containerWidth = _b[0],
|
|
19892
|
+
setContainerWidth = _b[1];
|
|
19893
|
+
var styles = useCarouselStyles(BUTTON_SIZE);
|
|
19833
19894
|
var animatedIndex = React$1.useRef(new Animated$1.Value(0)).current;
|
|
19834
19895
|
var theme = useWllSdk().theme;
|
|
19835
|
-
var
|
|
19836
|
-
isDesktop =
|
|
19837
|
-
isTablet =
|
|
19896
|
+
var _c = useResponsive(),
|
|
19897
|
+
isDesktop = _c.isDesktop,
|
|
19898
|
+
isTablet = _c.isTablet;
|
|
19838
19899
|
var scrollViewRef = React$1.useRef(null);
|
|
19839
|
-
var
|
|
19840
|
-
currentIndex =
|
|
19841
|
-
setCurrentIndex =
|
|
19900
|
+
var _d = React$1.useState(0),
|
|
19901
|
+
currentIndex = _d[0],
|
|
19902
|
+
setCurrentIndex = _d[1];
|
|
19842
19903
|
var bannerTiles = section.tiles.filter(function (tile) {
|
|
19843
19904
|
return tile.type === exports.TileType.Banner;
|
|
19844
19905
|
});
|
|
19845
19906
|
var sortedTiles = sortByPriority(bannerTiles);
|
|
19846
19907
|
var handleScroll = React$1.useCallback(function (event) {
|
|
19847
19908
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
19848
|
-
var newIndex = contentOffsetX /
|
|
19909
|
+
var newIndex = contentOffsetX / containerWidth;
|
|
19849
19910
|
animatedIndex.setValue(newIndex);
|
|
19850
|
-
}, [
|
|
19911
|
+
}, [containerWidth, animatedIndex]);
|
|
19851
19912
|
var handleScrollEnd = React$1.useCallback(function (event) {
|
|
19852
19913
|
var contentOffsetX = event.nativeEvent.contentOffset.x;
|
|
19853
|
-
var newIndex = Math.round(contentOffsetX /
|
|
19914
|
+
var newIndex = Math.round(contentOffsetX / containerWidth);
|
|
19854
19915
|
setCurrentIndex(newIndex);
|
|
19855
|
-
}, [
|
|
19916
|
+
}, [containerWidth]);
|
|
19856
19917
|
var handlePrev = function () {
|
|
19857
19918
|
var _a;
|
|
19858
19919
|
var newIndex = Math.max(0, currentIndex - 1);
|
|
19859
19920
|
setCurrentIndex(newIndex);
|
|
19860
19921
|
(_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
19861
|
-
x: newIndex *
|
|
19922
|
+
x: newIndex * containerWidth,
|
|
19862
19923
|
animated: true
|
|
19863
19924
|
});
|
|
19864
19925
|
};
|
|
@@ -19867,7 +19928,7 @@ var Carousel = function (_a) {
|
|
|
19867
19928
|
var newIndex = Math.min(sortedTiles.length - 1, currentIndex + 1);
|
|
19868
19929
|
setCurrentIndex(newIndex);
|
|
19869
19930
|
(_a = scrollViewRef.current) === null || _a === void 0 ? void 0 : _a.scrollTo({
|
|
19870
|
-
x: newIndex *
|
|
19931
|
+
x: newIndex * containerWidth,
|
|
19871
19932
|
animated: true
|
|
19872
19933
|
});
|
|
19873
19934
|
};
|
|
@@ -19883,7 +19944,12 @@ var Carousel = function (_a) {
|
|
|
19883
19944
|
title: section.title,
|
|
19884
19945
|
description: section.description
|
|
19885
19946
|
}), /*#__PURE__*/React$1.createElement(View$2, {
|
|
19886
|
-
|
|
19947
|
+
ref: containerRef,
|
|
19948
|
+
style: styles.container,
|
|
19949
|
+
onLayout: function (event) {
|
|
19950
|
+
var width = event.nativeEvent.layout.width;
|
|
19951
|
+
setContainerWidth(width);
|
|
19952
|
+
}
|
|
19887
19953
|
}, /*#__PURE__*/React$1.createElement(View$2, {
|
|
19888
19954
|
style: styles.carouselContainer
|
|
19889
19955
|
}, displayControls && /*#__PURE__*/React$1.createElement(TouchableOpacity$1, {
|
|
@@ -19903,20 +19969,18 @@ var Carousel = function (_a) {
|
|
|
19903
19969
|
onScroll: handleScroll,
|
|
19904
19970
|
onMomentumScrollEnd: handleScrollEnd,
|
|
19905
19971
|
scrollEventThrottle: 16,
|
|
19906
|
-
style: [styles.carouselContent,
|
|
19907
|
-
width: SLIDE_WIDTH
|
|
19908
|
-
}],
|
|
19972
|
+
style: [styles.carouselContent],
|
|
19909
19973
|
contentContainerStyle: {
|
|
19910
|
-
width:
|
|
19974
|
+
width: containerWidth * sortedTiles.length
|
|
19911
19975
|
},
|
|
19912
19976
|
decelerationRate: "fast",
|
|
19913
|
-
snapToInterval:
|
|
19977
|
+
snapToInterval: containerWidth,
|
|
19914
19978
|
snapToAlignment: "start"
|
|
19915
19979
|
}, sortedTiles.map(function (tile, index) {
|
|
19916
19980
|
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
19917
19981
|
key: index,
|
|
19918
|
-
style: [{
|
|
19919
|
-
width:
|
|
19982
|
+
style: [styles.slideContainer, {
|
|
19983
|
+
width: containerWidth
|
|
19920
19984
|
}]
|
|
19921
19985
|
}, /*#__PURE__*/React$1.createElement(BannerTile, {
|
|
19922
19986
|
tile: tile
|
|
@@ -20246,30 +20310,7 @@ var usePointsTileStyles = function (isFullSize) {
|
|
|
20246
20310
|
});
|
|
20247
20311
|
};
|
|
20248
20312
|
|
|
20249
|
-
var
|
|
20250
|
-
var tile = _a.tile;
|
|
20251
|
-
var isFullSize = useTileSize(tile).isFullSize;
|
|
20252
|
-
var styles = usePointsTileStyles(isFullSize);
|
|
20253
|
-
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20254
|
-
tile: tile
|
|
20255
|
-
}, isFullSize && /*#__PURE__*/React__namespace.createElement(PointsTile.Image, {
|
|
20256
|
-
isFullSize: isFullSize
|
|
20257
|
-
}), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
20258
|
-
style: styles.container
|
|
20259
|
-
}, !isFullSize && /*#__PURE__*/React__namespace.createElement(PointsTile.Image, {
|
|
20260
|
-
isFullSize: isFullSize
|
|
20261
|
-
}), /*#__PURE__*/React__namespace.createElement(View$2, {
|
|
20262
|
-
style: styles.contentContainer
|
|
20263
|
-
}, /*#__PURE__*/React__namespace.createElement(PointsTile.Title, null), /*#__PURE__*/React__namespace.createElement(PointsTile.Points, null))));
|
|
20264
|
-
};
|
|
20265
|
-
var PointsTileTitle = function () {
|
|
20266
|
-
var configuration = useTileContext().configuration;
|
|
20267
|
-
var title = configuration.title;
|
|
20268
|
-
return /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20269
|
-
variant: "eyebrow"
|
|
20270
|
-
}, title);
|
|
20271
|
-
};
|
|
20272
|
-
var PointsTilePoints = function () {
|
|
20313
|
+
var PointsTileFormattedPoints = function () {
|
|
20273
20314
|
var styles = usePointsTileStyles();
|
|
20274
20315
|
var configuration = useTileContext().configuration;
|
|
20275
20316
|
var _a = configuration,
|
|
@@ -20281,21 +20322,28 @@ var PointsTilePoints = function () {
|
|
|
20281
20322
|
if (calculatedPoints === null) return null;
|
|
20282
20323
|
return /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20283
20324
|
variant: "caption"
|
|
20284
|
-
}, prefix !== null && prefix !== void 0 ? prefix : '', /*#__PURE__*/React__namespace.createElement(
|
|
20285
|
-
style: styles.pointsWithSuffix
|
|
20286
|
-
}, calculatedPoints, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20325
|
+
}, prefix !== null && prefix !== void 0 ? prefix : '', /*#__PURE__*/React__namespace.createElement(Row, null, calculatedPoints, /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20287
20326
|
style: styles.suffix
|
|
20288
20327
|
}, suffix !== null && suffix !== void 0 ? suffix : 'pts')));
|
|
20289
20328
|
};
|
|
20290
|
-
|
|
20329
|
+
|
|
20330
|
+
var PointsTileTitle = function () {
|
|
20331
|
+
var configuration = useTileContext().configuration;
|
|
20332
|
+
var title = configuration.title;
|
|
20333
|
+
return /*#__PURE__*/React$1.createElement(Text, {
|
|
20334
|
+
variant: "eyebrow"
|
|
20335
|
+
}, title);
|
|
20336
|
+
};
|
|
20337
|
+
|
|
20338
|
+
var PointsTileMedia = function (_a) {
|
|
20291
20339
|
var isFullSize = _a.isFullSize;
|
|
20292
20340
|
var configuration = useTileContext().configuration;
|
|
20293
20341
|
var artworkUrl = configuration.artworkUrl;
|
|
20294
20342
|
var styles = usePointsTileStyles(isFullSize);
|
|
20295
20343
|
if (!artworkUrl) return null;
|
|
20296
|
-
return /*#__PURE__*/
|
|
20344
|
+
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
20297
20345
|
style: styles.imageContainer
|
|
20298
|
-
}, /*#__PURE__*/
|
|
20346
|
+
}, /*#__PURE__*/React$1.createElement(Image$2, {
|
|
20299
20347
|
source: {
|
|
20300
20348
|
uri: artworkUrl
|
|
20301
20349
|
},
|
|
@@ -20303,9 +20351,26 @@ var PointsTileImage = function (_a) {
|
|
|
20303
20351
|
resizeMode: "contain"
|
|
20304
20352
|
}));
|
|
20305
20353
|
};
|
|
20354
|
+
|
|
20355
|
+
var PointsTile = function (_a) {
|
|
20356
|
+
var tile = _a.tile;
|
|
20357
|
+
var isFullSize = useTileSize(tile).isFullSize;
|
|
20358
|
+
var styles = usePointsTileStyles(isFullSize);
|
|
20359
|
+
return /*#__PURE__*/React$1.createElement(BaseTile, {
|
|
20360
|
+
tile: tile
|
|
20361
|
+
}, isFullSize && /*#__PURE__*/React$1.createElement(PointsTile.Media, {
|
|
20362
|
+
isFullSize: isFullSize
|
|
20363
|
+
}), /*#__PURE__*/React$1.createElement(View$2, {
|
|
20364
|
+
style: styles.container
|
|
20365
|
+
}, !isFullSize && /*#__PURE__*/React$1.createElement(PointsTile.Media, {
|
|
20366
|
+
isFullSize: isFullSize
|
|
20367
|
+
}), /*#__PURE__*/React$1.createElement(View$2, {
|
|
20368
|
+
style: styles.contentContainer
|
|
20369
|
+
}, /*#__PURE__*/React$1.createElement(PointsTile.Title, null), /*#__PURE__*/React$1.createElement(PointsTile.Points, null))));
|
|
20370
|
+
};
|
|
20306
20371
|
PointsTile.Title = PointsTileTitle;
|
|
20307
|
-
PointsTile.Points =
|
|
20308
|
-
PointsTile.
|
|
20372
|
+
PointsTile.Points = PointsTileFormattedPoints;
|
|
20373
|
+
PointsTile.Media = PointsTileMedia;
|
|
20309
20374
|
|
|
20310
20375
|
var useRewardCategoryTileStyles = function () {
|
|
20311
20376
|
var _a = useResponsive$1(),
|
|
@@ -20338,13 +20403,6 @@ var useRewardCategoryTileStyles = function () {
|
|
|
20338
20403
|
});
|
|
20339
20404
|
};
|
|
20340
20405
|
|
|
20341
|
-
var RewardCategoryTile = function (_a) {
|
|
20342
|
-
var tile = _a.tile;
|
|
20343
|
-
if (!tile) return null;
|
|
20344
|
-
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20345
|
-
tile: tile
|
|
20346
|
-
}, /*#__PURE__*/React__namespace.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React__namespace.createElement(RewardCategoryTile.Background, null));
|
|
20347
|
-
};
|
|
20348
20406
|
var RewardCategoryHeader = function () {
|
|
20349
20407
|
var styles = useRewardCategoryTileStyles();
|
|
20350
20408
|
var theme = useWllSdk().theme;
|
|
@@ -20353,11 +20411,11 @@ var RewardCategoryHeader = function () {
|
|
|
20353
20411
|
showName = _a.showName,
|
|
20354
20412
|
name = _a.name;
|
|
20355
20413
|
if (!showName || !name) return null;
|
|
20356
|
-
return /*#__PURE__*/
|
|
20414
|
+
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
20357
20415
|
style: [styles.header, {
|
|
20358
20416
|
backgroundColor: theme.primary
|
|
20359
20417
|
}]
|
|
20360
|
-
}, /*#__PURE__*/
|
|
20418
|
+
}, /*#__PURE__*/React$1.createElement(Text, {
|
|
20361
20419
|
style: [styles.headerText, {
|
|
20362
20420
|
color: theme.primaryText
|
|
20363
20421
|
}],
|
|
@@ -20365,20 +20423,46 @@ var RewardCategoryHeader = function () {
|
|
|
20365
20423
|
numberOfLines: 1
|
|
20366
20424
|
}, name));
|
|
20367
20425
|
};
|
|
20368
|
-
|
|
20426
|
+
|
|
20427
|
+
var RewardCategoryMedia = function () {
|
|
20369
20428
|
var styles = useRewardCategoryTileStyles();
|
|
20370
20429
|
var configuration = useTileContext().configuration;
|
|
20371
20430
|
var artworkUrl = configuration.artworkUrl;
|
|
20372
20431
|
if (!artworkUrl) return null;
|
|
20373
|
-
return /*#__PURE__*/
|
|
20432
|
+
return /*#__PURE__*/React$1.createElement(ProgressiveImage, {
|
|
20374
20433
|
source: {
|
|
20375
20434
|
uri: artworkUrl
|
|
20376
20435
|
},
|
|
20377
20436
|
style: styles.background
|
|
20378
20437
|
});
|
|
20379
20438
|
};
|
|
20439
|
+
|
|
20440
|
+
var RewardCategoryTile = function (_a) {
|
|
20441
|
+
var tile = _a.tile;
|
|
20442
|
+
if (!tile) return null;
|
|
20443
|
+
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20444
|
+
tile: tile
|
|
20445
|
+
}, /*#__PURE__*/React__namespace.createElement(RewardCategoryTile.Header, null), /*#__PURE__*/React__namespace.createElement(RewardCategoryTile.Media, null));
|
|
20446
|
+
};
|
|
20380
20447
|
RewardCategoryTile.Header = RewardCategoryHeader;
|
|
20381
|
-
RewardCategoryTile.
|
|
20448
|
+
RewardCategoryTile.Media = RewardCategoryMedia;
|
|
20449
|
+
|
|
20450
|
+
var RewardTileChevron = function () {
|
|
20451
|
+
var theme = useWllSdk().theme;
|
|
20452
|
+
return /*#__PURE__*/React$1.createElement(Icon, {
|
|
20453
|
+
name: "ChevronRight",
|
|
20454
|
+
color: theme.derivedSurfaceText[20]
|
|
20455
|
+
});
|
|
20456
|
+
};
|
|
20457
|
+
|
|
20458
|
+
var RewardTileSummary = function () {
|
|
20459
|
+
var configuration = useTileContext().configuration;
|
|
20460
|
+
var summary = configuration.summary;
|
|
20461
|
+
if (!summary) return null;
|
|
20462
|
+
return /*#__PURE__*/React$1.createElement(Text, {
|
|
20463
|
+
variant: "body"
|
|
20464
|
+
}, summary);
|
|
20465
|
+
};
|
|
20382
20466
|
|
|
20383
20467
|
var useRewardTileStyles = function () {
|
|
20384
20468
|
var _a = useResponsive$1(),
|
|
@@ -20388,7 +20472,6 @@ var useRewardTileStyles = function () {
|
|
|
20388
20472
|
return StyleSheet$1.create({
|
|
20389
20473
|
imageContainer: {
|
|
20390
20474
|
width: '100%',
|
|
20391
|
-
flexBasis: '50%',
|
|
20392
20475
|
marginBottom: useResponsiveValue(theme.sizes.sm, theme.sizes.xxs, isDesktop, isTablet)
|
|
20393
20476
|
},
|
|
20394
20477
|
image: {
|
|
@@ -20414,89 +20497,88 @@ var useRewardTileStyles = function () {
|
|
|
20414
20497
|
justifyContent: 'center'
|
|
20415
20498
|
},
|
|
20416
20499
|
suffix: {
|
|
20500
|
+
color: theme.primary,
|
|
20417
20501
|
fontSize: useResponsiveValue(theme.sizes.xl, theme.sizes.md, isDesktop, isTablet)
|
|
20418
20502
|
}
|
|
20419
20503
|
});
|
|
20420
20504
|
};
|
|
20421
20505
|
|
|
20422
|
-
var
|
|
20423
|
-
var
|
|
20424
|
-
return /*#__PURE__*/React__namespace.createElement(BaseTile, {
|
|
20425
|
-
tile: tile
|
|
20426
|
-
}, /*#__PURE__*/React__namespace.createElement(RewardTile.Media, null), /*#__PURE__*/React__namespace.createElement(RewardTile.Content, null, /*#__PURE__*/React__namespace.createElement(RowHeader, null, /*#__PURE__*/React__namespace.createElement(RewardTile.Title, null), /*#__PURE__*/React__namespace.createElement(RewardTile.Chevron, null)), /*#__PURE__*/React__namespace.createElement(RewardTile.Description, null), /*#__PURE__*/React__namespace.createElement(RewardTile.Points, null)));
|
|
20427
|
-
};
|
|
20428
|
-
var RewardTileMedia = function () {
|
|
20506
|
+
var RewardTileMedia = function (_a) {
|
|
20507
|
+
var isArtworkOnly = _a.isArtworkOnly;
|
|
20429
20508
|
var styles = useRewardTileStyles();
|
|
20430
20509
|
var configuration = useTileContext().configuration;
|
|
20431
|
-
var
|
|
20432
|
-
|
|
20433
|
-
|
|
20434
|
-
|
|
20435
|
-
|
|
20436
|
-
|
|
20437
|
-
|
|
20438
|
-
|
|
20439
|
-
|
|
20440
|
-
|
|
20441
|
-
|
|
20442
|
-
|
|
20443
|
-
|
|
20444
|
-
|
|
20445
|
-
|
|
20446
|
-
|
|
20447
|
-
|
|
20448
|
-
|
|
20449
|
-
|
|
20450
|
-
|
|
20451
|
-
};
|
|
20452
|
-
var RewardTileDescription = function () {
|
|
20453
|
-
var configuration = useTileContext().configuration;
|
|
20454
|
-
var reward = configuration;
|
|
20455
|
-
if (!(reward === null || reward === void 0 ? void 0 : reward.summary)) return null;
|
|
20456
|
-
return /*#__PURE__*/React__namespace.createElement(Text, {
|
|
20457
|
-
variant: "body"
|
|
20458
|
-
}, reward.summary);
|
|
20510
|
+
var _b = configuration,
|
|
20511
|
+
artworkUrl = _b.artworkUrl,
|
|
20512
|
+
_c = _b.showArtwork,
|
|
20513
|
+
showArtwork = _c === void 0 ? true : _c;
|
|
20514
|
+
if (!artworkUrl || !showArtwork) return null;
|
|
20515
|
+
var containerStyle = {
|
|
20516
|
+
flexBasis: isArtworkOnly ? '100%' : '50%'
|
|
20517
|
+
};
|
|
20518
|
+
return (
|
|
20519
|
+
/*#__PURE__*/
|
|
20520
|
+
// @ts-ignore: We are using percentage values for flexBasis, which is valid in React Native but TypeScript expects a number.
|
|
20521
|
+
React$1.createElement(View$2, {
|
|
20522
|
+
style: [styles.imageContainer, containerStyle]
|
|
20523
|
+
}, /*#__PURE__*/React$1.createElement(ProgressiveImage, {
|
|
20524
|
+
source: {
|
|
20525
|
+
uri: artworkUrl
|
|
20526
|
+
},
|
|
20527
|
+
style: styles.image
|
|
20528
|
+
}))
|
|
20529
|
+
);
|
|
20459
20530
|
};
|
|
20531
|
+
|
|
20460
20532
|
var RewardTilePoints = function () {
|
|
20461
20533
|
var styles = useRewardTileStyles();
|
|
20462
20534
|
var configuration = useTileContext().configuration;
|
|
20463
|
-
var
|
|
20464
|
-
|
|
20465
|
-
|
|
20466
|
-
|
|
20467
|
-
|
|
20468
|
-
|
|
20469
|
-
|
|
20535
|
+
var _a = configuration,
|
|
20536
|
+
showPrice = _a.showPrice,
|
|
20537
|
+
price = _a.price,
|
|
20538
|
+
pointsMultiplier = _a.pointsMultiplier,
|
|
20539
|
+
pointsPrefix = _a.pointsPrefix,
|
|
20540
|
+
pointsSuffix = _a.pointsSuffix;
|
|
20541
|
+
var calculatedPoints = price !== undefined ? price * (Number(pointsMultiplier) || 1) : null;
|
|
20542
|
+
if (!showPrice || calculatedPoints === null) return null;
|
|
20543
|
+
return /*#__PURE__*/React$1.createElement(Text, {
|
|
20470
20544
|
variant: "caption",
|
|
20471
20545
|
style: styles.footer
|
|
20472
|
-
},
|
|
20546
|
+
}, pointsPrefix, /*#__PURE__*/React$1.createElement(View$2, {
|
|
20473
20547
|
style: styles.pointsContainer
|
|
20474
|
-
}, calculatedPoints, /*#__PURE__*/
|
|
20475
|
-
style:
|
|
20476
|
-
|
|
20477
|
-
}]
|
|
20478
|
-
}, reward.pointsSuffix)));
|
|
20548
|
+
}, calculatedPoints, /*#__PURE__*/React$1.createElement(Text, {
|
|
20549
|
+
style: styles.suffix
|
|
20550
|
+
}, pointsSuffix)));
|
|
20479
20551
|
};
|
|
20480
|
-
|
|
20481
|
-
|
|
20482
|
-
var
|
|
20483
|
-
|
|
20484
|
-
|
|
20485
|
-
|
|
20552
|
+
|
|
20553
|
+
var RewardTileTitle = function () {
|
|
20554
|
+
var configuration = useTileContext().configuration;
|
|
20555
|
+
var name = configuration.name;
|
|
20556
|
+
if (!name) return null;
|
|
20557
|
+
return /*#__PURE__*/React$1.createElement(Text, {
|
|
20558
|
+
variant: "title",
|
|
20559
|
+
ellipsizeMode: "tail",
|
|
20560
|
+
numberOfLines: 1
|
|
20561
|
+
}, name);
|
|
20486
20562
|
};
|
|
20487
|
-
|
|
20488
|
-
|
|
20489
|
-
|
|
20490
|
-
|
|
20491
|
-
|
|
20492
|
-
|
|
20563
|
+
|
|
20564
|
+
var RewardTile = function (_a) {
|
|
20565
|
+
var tile = _a.tile;
|
|
20566
|
+
var configuration = tile.configuration;
|
|
20567
|
+
var showDetails = configuration.showDetails;
|
|
20568
|
+
return /*#__PURE__*/React$1.createElement(BaseTile, {
|
|
20569
|
+
tile: tile
|
|
20570
|
+
}, /*#__PURE__*/React$1.createElement(RewardTile.Media, {
|
|
20571
|
+
isArtworkOnly: !showDetails
|
|
20572
|
+
}), /*#__PURE__*/React$1.createElement(Column, null, /*#__PURE__*/React$1.createElement(Row, {
|
|
20573
|
+
justify: "between",
|
|
20574
|
+
align: "center"
|
|
20575
|
+
}, /*#__PURE__*/React$1.createElement(RewardTile.Title, null), /*#__PURE__*/React$1.createElement(RewardTile.Chevron, null)), /*#__PURE__*/React$1.createElement(RewardTile.Summary, null), /*#__PURE__*/React$1.createElement(RewardTile.Points, null)));
|
|
20493
20576
|
};
|
|
20494
20577
|
RewardTile.Media = RewardTileMedia;
|
|
20495
20578
|
RewardTile.Title = RewardTileTitle;
|
|
20496
|
-
RewardTile.
|
|
20579
|
+
RewardTile.Summary = RewardTileSummary;
|
|
20497
20580
|
RewardTile.Points = RewardTilePoints;
|
|
20498
20581
|
RewardTile.Chevron = RewardTileChevron;
|
|
20499
|
-
RewardTile.Content = RewardTileContent;
|
|
20500
20582
|
|
|
20501
20583
|
var useTierTileStyles = function () {
|
|
20502
20584
|
var _a = useResponsive$1(),
|
|
@@ -20756,7 +20838,7 @@ var Column = function (_a) {
|
|
|
20756
20838
|
isDesktop = _d.isDesktop,
|
|
20757
20839
|
isTablet = _d.isTablet;
|
|
20758
20840
|
var theme = useWllSdk().theme;
|
|
20759
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
20841
|
+
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
20760
20842
|
style: [{
|
|
20761
20843
|
flex: 1,
|
|
20762
20844
|
flexDirection: 'column',
|
|
@@ -20777,7 +20859,7 @@ var Row = function (_a) {
|
|
|
20777
20859
|
_d = _a.direction,
|
|
20778
20860
|
direction = _d === void 0 ? 'row' : _d,
|
|
20779
20861
|
style = _a.style;
|
|
20780
|
-
return /*#__PURE__*/React.createElement(View$2, {
|
|
20862
|
+
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
20781
20863
|
style: [{
|
|
20782
20864
|
flexDirection: direction,
|
|
20783
20865
|
justifyContent: justifyMap[justify],
|
|
@@ -20786,6 +20868,15 @@ var Row = function (_a) {
|
|
|
20786
20868
|
}, children);
|
|
20787
20869
|
};
|
|
20788
20870
|
|
|
20871
|
+
var FlexBox = function (_a) {
|
|
20872
|
+
var children = _a.children;
|
|
20873
|
+
return /*#__PURE__*/React$1.createElement(View$2, {
|
|
20874
|
+
style: {
|
|
20875
|
+
flex: 1
|
|
20876
|
+
}
|
|
20877
|
+
}, children);
|
|
20878
|
+
};
|
|
20879
|
+
|
|
20789
20880
|
var Stack = function (_a) {
|
|
20790
20881
|
var children = _a.children,
|
|
20791
20882
|
_b = _a.justify,
|
|
@@ -20816,7 +20907,8 @@ var alignMap = {
|
|
|
20816
20907
|
start: 'flex-start',
|
|
20817
20908
|
end: 'flex-end',
|
|
20818
20909
|
center: 'center',
|
|
20819
|
-
stretch: 'stretch'
|
|
20910
|
+
stretch: 'stretch',
|
|
20911
|
+
baseline: 'baseline'
|
|
20820
20912
|
};
|
|
20821
20913
|
|
|
20822
20914
|
var Reward = /** @class */function () {
|
|
@@ -20824,8 +20916,8 @@ var Reward = /** @class */function () {
|
|
|
20824
20916
|
return Reward;
|
|
20825
20917
|
}();
|
|
20826
20918
|
|
|
20919
|
+
exports.BadgeTile = BadgeTile;
|
|
20827
20920
|
exports.BadgeTileConfig = BadgeTileConfig;
|
|
20828
|
-
exports.BadgeTileUpdated = BadgeTile;
|
|
20829
20921
|
exports.BannerTile = BannerTile;
|
|
20830
20922
|
exports.BannerTileConfig = BannerTileConfig;
|
|
20831
20923
|
exports.BaseBanner = BaseBanner;
|
|
@@ -20836,6 +20928,7 @@ exports.Column = Column;
|
|
|
20836
20928
|
exports.Content = Column$1;
|
|
20837
20929
|
exports.ContentTile = ContentTile;
|
|
20838
20930
|
exports.ContentTileConfig = ContentTileConfig;
|
|
20931
|
+
exports.FlexBox = FlexBox;
|
|
20839
20932
|
exports.Grid = Grid;
|
|
20840
20933
|
exports.Group = Group;
|
|
20841
20934
|
exports.Icon = Icon;
|