@capillarytech/creatives-library 8.0.125-alpha.6 → 8.0.126
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/config/app.js +6 -0
- package/containers/App/constants.js +0 -1
- package/containers/Email/index.js +5 -5
- package/containers/WeChat/RichmediaTemplates/Create/index.js +1 -1
- package/initialReducer.js +2 -0
- package/package.json +1 -1
- package/services/api.js +94 -1
- package/services/tests/api.test.js +191 -0
- package/tests/integration/TemplateCreation/TemplateCreation.integration.test.js +3 -8
- package/tests/integration/TemplateCreation/api-response.js +0 -5
- package/tests/integration/TemplateCreation/msw-handler.js +63 -42
- package/utils/common.js +0 -7
- package/utils/commonUtils.js +6 -2
- package/v2Components/CapImageUpload/index.js +45 -51
- package/v2Components/CapInAppCTA/index.js +0 -1
- package/v2Components/CapTagList/index.js +120 -177
- package/v2Components/CapVideoUpload/constants.js +0 -3
- package/v2Components/CapVideoUpload/index.js +110 -167
- package/v2Components/CapVideoUpload/messages.js +0 -16
- package/v2Components/Carousel/index.js +13 -15
- package/v2Components/CustomerSearchSection/_customerSearch.scss +309 -0
- package/v2Components/CustomerSearchSection/constants.js +5 -0
- package/v2Components/CustomerSearchSection/index.js +362 -0
- package/v2Components/CustomerSearchSection/messages.js +20 -0
- package/v2Components/CustomerSearchSection/tests/utils.test.js +334 -0
- package/v2Components/CustomerSearchSection/utils.js +49 -0
- package/v2Components/ErrorInfoNote/style.scss +0 -1
- package/v2Components/MobilePushPreviewV2/index.js +5 -37
- package/v2Components/TemplatePreview/_templatePreview.scss +72 -114
- package/v2Components/TemplatePreview/index.js +50 -178
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Components/TestAndPreviewSlidebox/_testAndPreviewSlidebox.scss +543 -0
- package/v2Components/TestAndPreviewSlidebox/actions.js +67 -0
- package/v2Components/TestAndPreviewSlidebox/constants.js +67 -0
- package/v2Components/TestAndPreviewSlidebox/index.js +771 -0
- package/v2Components/TestAndPreviewSlidebox/messages.js +147 -0
- package/v2Components/TestAndPreviewSlidebox/reducer.js +233 -0
- package/v2Components/TestAndPreviewSlidebox/sagas.js +258 -0
- package/v2Components/TestAndPreviewSlidebox/selectors.js +142 -0
- package/v2Components/TestAndPreviewSlidebox/tests/actions.test.js +80 -0
- package/v2Components/TestAndPreviewSlidebox/tests/reducer.test.js +367 -0
- package/v2Components/TestAndPreviewSlidebox/tests/saga.rtl.test.js +192 -0
- package/v2Components/TestAndPreviewSlidebox/tests/saga.test.js +652 -0
- package/v2Components/TestAndPreviewSlidebox/tests/selector.test.js +182 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +21 -9
- package/v2Containers/CreativesContainer/SlideBoxFooter.js +23 -2
- package/v2Containers/CreativesContainer/index.js +160 -195
- package/v2Containers/CreativesContainer/messages.js +4 -0
- package/v2Containers/CreativesContainer/tests/__snapshots__/index.test.js.snap +21 -0
- package/v2Containers/Email/index.js +18 -6
- package/v2Containers/EmailWrapper/hooks/useEmailWrapper.js +10 -0
- package/v2Containers/EmailWrapper/index.js +6 -0
- package/v2Containers/InApp/constants.js +0 -1
- package/v2Containers/InApp/index.js +13 -13
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/content.test.js.snap +3 -0
- package/v2Containers/Line/Container/ImageCarousel/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/Wrapper/tests/__snapshots__/index.test.js.snap +2 -0
- package/v2Containers/Line/Container/tests/__snapshots__/index.test.js.snap +9 -0
- package/v2Containers/MobilePush/Create/index.js +0 -1
- package/v2Containers/MobilePush/commonMethods.js +14 -7
- package/v2Containers/Rcs/tests/__snapshots__/index.test.js.snap +23 -5
- package/v2Containers/SmsTrai/Edit/tests/__snapshots__/index.test.js.snap +4 -0
- package/v2Containers/TagList/index.js +10 -56
- package/v2Containers/Templates/_templates.scss +1 -101
- package/v2Containers/Templates/index.js +35 -147
- package/v2Containers/Templates/messages.js +0 -8
- package/v2Containers/Templates/sagas.js +0 -2
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +1 -1
- package/v2Containers/Whatsapp/constants.js +0 -1
- package/v2Containers/Whatsapp/tests/__snapshots__/index.test.js.snap +35 -0
- package/utils/createPayload.js +0 -270
- package/utils/tests/createPayload.test.js +0 -761
- package/v2Components/CapMpushCTA/constants.js +0 -25
- package/v2Components/CapMpushCTA/index.js +0 -332
- package/v2Components/CapMpushCTA/index.scss +0 -95
- package/v2Components/CapMpushCTA/messages.js +0 -89
- package/v2Components/TemplatePreview/assets/images/Android _ With date and time.svg +0 -29
- package/v2Components/TemplatePreview/assets/images/android.svg +0 -9
- package/v2Components/TemplatePreview/assets/images/iOS _ With date and time.svg +0 -26
- package/v2Components/TemplatePreview/assets/images/ios.svg +0 -9
- package/v2Containers/Email/tests/index.test.js +0 -35
- package/v2Containers/MobilePushNew/actions.js +0 -116
- package/v2Containers/MobilePushNew/components/CtaButtons.js +0 -170
- package/v2Containers/MobilePushNew/components/MediaUploaders.js +0 -686
- package/v2Containers/MobilePushNew/components/PlatformContentFields.js +0 -279
- package/v2Containers/MobilePushNew/components/index.js +0 -5
- package/v2Containers/MobilePushNew/components/tests/CtaButtons.test.js +0 -779
- package/v2Containers/MobilePushNew/components/tests/MediaUploaders.test.js +0 -2114
- package/v2Containers/MobilePushNew/components/tests/PlatformContentFields.test.js +0 -343
- package/v2Containers/MobilePushNew/constants.js +0 -115
- package/v2Containers/MobilePushNew/hooks/tests/usePlatformSync.test.js +0 -1299
- package/v2Containers/MobilePushNew/hooks/tests/useUpload.test.js +0 -1223
- package/v2Containers/MobilePushNew/hooks/usePlatformSync.js +0 -246
- package/v2Containers/MobilePushNew/hooks/useUpload.js +0 -709
- package/v2Containers/MobilePushNew/index.js +0 -2170
- package/v2Containers/MobilePushNew/index.scss +0 -308
- package/v2Containers/MobilePushNew/messages.js +0 -226
- package/v2Containers/MobilePushNew/reducer.js +0 -160
- package/v2Containers/MobilePushNew/sagas.js +0 -198
- package/v2Containers/MobilePushNew/selectors.js +0 -55
- package/v2Containers/MobilePushNew/tests/reducer.test.js +0 -741
- package/v2Containers/MobilePushNew/tests/sagas.test.js +0 -863
- package/v2Containers/MobilePushNew/tests/selectors.test.js +0 -425
- package/v2Containers/MobilePushNew/tests/utils.test.js +0 -322
- package/v2Containers/MobilePushNew/utils.js +0 -33
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
width: 450px;
|
|
10
10
|
|
|
11
11
|
.preview-image {
|
|
12
|
-
width:
|
|
12
|
+
width: 51%;
|
|
13
13
|
&.sms {
|
|
14
14
|
width: 45%;
|
|
15
15
|
}
|
|
16
|
-
&.mobilepush
|
|
17
16
|
|
|
18
17
|
.inapp-message-container-POPUP-ANDROID {
|
|
19
18
|
position: absolute;
|
|
@@ -576,9 +575,9 @@
|
|
|
576
575
|
}
|
|
577
576
|
.android-push-message-Container, .iphone-push-message-Container{
|
|
578
577
|
position: absolute;
|
|
579
|
-
top:
|
|
580
|
-
left:
|
|
581
|
-
width:
|
|
578
|
+
top: 11%;
|
|
579
|
+
left: 28.8%;
|
|
580
|
+
width: 42%;
|
|
582
581
|
height: 336px;
|
|
583
582
|
overflow: auto;
|
|
584
583
|
display: -webkit-box;
|
|
@@ -606,130 +605,98 @@
|
|
|
606
605
|
}
|
|
607
606
|
}
|
|
608
607
|
}
|
|
609
|
-
.mobile-push-carousel-card {
|
|
610
|
-
position: relative;
|
|
611
|
-
min-width: 258px;
|
|
612
|
-
margin-right: 12px;
|
|
613
|
-
background: #fff;
|
|
614
|
-
color: #091e42;
|
|
615
|
-
border-radius: 8px;
|
|
616
|
-
display: flex;
|
|
617
|
-
flex-direction: column;
|
|
618
|
-
align-items: flex-start;
|
|
619
|
-
padding: 0;
|
|
620
|
-
box-shadow: 0px 0px 10px 0px rgba(0,0,0,0.08);
|
|
621
|
-
|
|
622
|
-
.carousel-image {
|
|
623
|
-
width: 100%;
|
|
624
|
-
height: 180px;
|
|
625
|
-
object-fit: contain;
|
|
626
|
-
border-radius: 8px 8px 0 0;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
.carousel-video-preview {
|
|
630
|
-
width: 100%;
|
|
631
|
-
height: 180px;
|
|
632
|
-
object-fit: contain;
|
|
633
|
-
border-radius: 8px 8px 0 0;
|
|
634
|
-
opacity: 0.7;
|
|
635
|
-
}
|
|
636
|
-
|
|
637
|
-
.carousel-content {
|
|
638
|
-
padding: 10px 12px;
|
|
639
|
-
width: 100%;
|
|
640
|
-
|
|
641
|
-
.carousel-title {
|
|
642
|
-
font-weight: 600;
|
|
643
|
-
font-size: 14px;
|
|
644
|
-
margin-bottom: 4px;
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
.carousel-message {
|
|
648
|
-
font-size: 13px;
|
|
649
|
-
color: #555;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
.carousel-link {
|
|
653
|
-
margin-top: 8px;
|
|
654
|
-
|
|
655
|
-
a {
|
|
656
|
-
color: #2466ea;
|
|
657
|
-
font-size: 12px;
|
|
658
|
-
text-decoration: underline;
|
|
659
|
-
}
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
608
|
}
|
|
664
|
-
.android-push-message-Container
|
|
665
|
-
.title, .body-text, .body-image, .app-
|
|
609
|
+
.android-push-message-Container{
|
|
610
|
+
.title, .body-text, .body-image, .app-name{
|
|
666
611
|
background-color: #FFFFFF;
|
|
667
612
|
color: #333333;
|
|
668
613
|
}
|
|
669
|
-
.app-
|
|
614
|
+
.app-name{
|
|
670
615
|
color: #5D5D5D;
|
|
671
616
|
font-weight: 600;
|
|
672
|
-
padding:
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
.app-icon{
|
|
677
|
-
width: $CAP_SPACE_12;
|
|
678
|
-
height: $CAP_SPACE_12;
|
|
679
|
-
border-radius: 50%;
|
|
680
|
-
background-color: #737070;
|
|
681
|
-
}
|
|
617
|
+
padding: 8px 8px 4px 8px;
|
|
618
|
+
}
|
|
619
|
+
.title, .body-image{
|
|
620
|
+
padding: 0 8px 0 8px;
|
|
682
621
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
622
|
+
}
|
|
623
|
+
.body-text{
|
|
624
|
+
padding: 0 8px 4px 8px;
|
|
625
|
+
color: #5a5959;
|
|
626
|
+
}
|
|
627
|
+
.title{
|
|
628
|
+
overflow: hidden;
|
|
629
|
+
white-space: nowrap;
|
|
630
|
+
text-overflow: ellipsis;
|
|
631
|
+
}
|
|
632
|
+
.actions{
|
|
633
|
+
background-color: #EEEEEE;
|
|
634
|
+
height: 32px;
|
|
635
|
+
padding: 4px;
|
|
636
|
+
.action{
|
|
637
|
+
line-height: 24px;
|
|
690
638
|
font-size: 10px;
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
639
|
+
font-weight: 600;
|
|
640
|
+
color: #1970DA;
|
|
641
|
+
height: 12px;
|
|
642
|
+
margin-left: 8px;
|
|
694
643
|
}
|
|
695
644
|
}
|
|
696
|
-
|
|
697
|
-
|
|
645
|
+
}
|
|
646
|
+
.iphone-push-message-Container{
|
|
647
|
+
top: 8%;
|
|
648
|
+
.message-pop{
|
|
649
|
+
border-radius: 4px;
|
|
650
|
+
word-wrap: break-word;
|
|
651
|
+
}
|
|
652
|
+
.title, .body-text, .body-image, .app-name{
|
|
653
|
+
background-color: #FFFFFF;
|
|
654
|
+
color: #333333;
|
|
698
655
|
}
|
|
699
656
|
.body-image{
|
|
700
|
-
padding:
|
|
701
|
-
|
|
702
|
-
|
|
657
|
+
padding-top: 8px;
|
|
658
|
+
}
|
|
659
|
+
.title{
|
|
660
|
+
overflow: hidden;
|
|
661
|
+
white-space: nowrap;
|
|
662
|
+
text-overflow: ellipsis;
|
|
663
|
+
}
|
|
664
|
+
.app-name{
|
|
665
|
+
padding: 8px;
|
|
666
|
+
color: #5D5D5D;
|
|
667
|
+
border-bottom: solid 1px #D6D6D6;
|
|
668
|
+
.material-icons{
|
|
669
|
+
font-size: 12px;
|
|
670
|
+
float: right;
|
|
703
671
|
}
|
|
704
672
|
}
|
|
705
|
-
.body-text{
|
|
706
|
-
padding:
|
|
707
|
-
padding-left: $CAP_SPACE_32;
|
|
708
|
-
font-size: $FONT_SIZE_S;
|
|
673
|
+
.title, .body-text{
|
|
674
|
+
padding: 4px;
|
|
709
675
|
}
|
|
710
676
|
.title{
|
|
711
|
-
font-size: $FONT_SIZE_S;
|
|
712
677
|
overflow: hidden;
|
|
713
678
|
white-space: nowrap;
|
|
714
679
|
text-overflow: ellipsis;
|
|
715
|
-
|
|
716
|
-
|
|
680
|
+
}
|
|
681
|
+
.body-text{
|
|
682
|
+
border-bottom-left-radius: 4px;
|
|
683
|
+
border-bottom-right-radius: 4px;
|
|
717
684
|
}
|
|
718
685
|
.actions{
|
|
719
|
-
background-color: #
|
|
720
|
-
|
|
721
|
-
|
|
686
|
+
background-color: #FFFFFF;
|
|
687
|
+
opacity: 0.8;
|
|
688
|
+
height: 32px;
|
|
689
|
+
line-height: 26px;
|
|
690
|
+
margin-top: 4px;
|
|
691
|
+
border-radius: 6px;
|
|
722
692
|
text-align: center;
|
|
723
|
-
|
|
724
|
-
flex-direction: column;
|
|
725
|
-
align-items: center;
|
|
726
|
-
justify-content: center;
|
|
727
|
-
gap: $CAP_SPACE_08;
|
|
693
|
+
padding: 4px;
|
|
728
694
|
.action{
|
|
729
|
-
font-size:
|
|
695
|
+
font-size: 12px;
|
|
730
696
|
font-weight: 600;
|
|
731
|
-
color: #
|
|
732
|
-
|
|
697
|
+
color: #000000;
|
|
698
|
+
text-align: center;
|
|
699
|
+
margin-left: 8px;
|
|
733
700
|
}
|
|
734
701
|
}
|
|
735
702
|
}
|
|
@@ -800,15 +767,6 @@
|
|
|
800
767
|
}
|
|
801
768
|
}
|
|
802
769
|
}
|
|
803
|
-
|
|
804
|
-
.mobile-push-scroll-container {
|
|
805
|
-
position: relative;
|
|
806
|
-
}
|
|
807
|
-
// Mobile Push Carousel Styles
|
|
808
|
-
.mobile-push-carousel-container {
|
|
809
|
-
background-color: #fff;
|
|
810
|
-
padding-left: 22px;
|
|
811
|
-
}
|
|
812
770
|
}
|
|
813
771
|
|
|
814
772
|
.align-center {
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
RCS,
|
|
33
33
|
ZALO,
|
|
34
34
|
INAPP,
|
|
35
|
-
MOBILE_PUSH
|
|
36
35
|
} from '../../v2Containers/CreativesContainer/constants';
|
|
37
36
|
import Carousel from '../Carousel';
|
|
38
37
|
import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
|
|
@@ -67,8 +66,8 @@ const viberMobileAndroid = require('./assets/images/viberMobile.svg');
|
|
|
67
66
|
const lineImgPlaceholder = require('../../assets/line-image-placeholder.svg');
|
|
68
67
|
const lineStickerPlaceholder = require('../../assets/smiley-placeholder.svg');
|
|
69
68
|
const lineVideoPlaceholder = require('../../assets/rich-video-placeholder.svg');
|
|
70
|
-
const androidPushMessagePhone = require('./assets/images/
|
|
71
|
-
const iPhonePushMessagePhone = require('./assets/images/
|
|
69
|
+
const androidPushMessagePhone = require('./assets/images/androidPushMessage.svg');
|
|
70
|
+
const iPhonePushMessagePhone = require('./assets/images/iPhonePushMessage.svg');
|
|
72
71
|
|
|
73
72
|
export class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
74
73
|
onPreviewContentClicked = (channel) => {
|
|
@@ -168,53 +167,6 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
168
167
|
this.props.onTestContentClicked(params);
|
|
169
168
|
};
|
|
170
169
|
|
|
171
|
-
renderMobilePushCarousel = (content) => {
|
|
172
|
-
if (!content?.carouselData || content.carouselData.length === 0) {
|
|
173
|
-
return null;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
return (
|
|
177
|
-
<div className="msg-container-carousel mobile-push-carousel-container">
|
|
178
|
-
<div className="scroll-container mobile-push-scroll-container">
|
|
179
|
-
{content.carouselData.map((item, idx) => (
|
|
180
|
-
<div
|
|
181
|
-
key={`carousel-card-${idx}`}
|
|
182
|
-
className="mobile-push-carousel-card message-pop align-left message-pop-carousel"
|
|
183
|
-
>
|
|
184
|
-
{item.mediaType === "image" && item.imageUrl && (
|
|
185
|
-
<CapImage
|
|
186
|
-
src={item.imageUrl}
|
|
187
|
-
alt="carousel-img"
|
|
188
|
-
className="carousel-image"
|
|
189
|
-
/>
|
|
190
|
-
)}
|
|
191
|
-
{item.mediaType === "video" && item.videoPreviewImg && (
|
|
192
|
-
<div className="video-preview">
|
|
193
|
-
<CapImage
|
|
194
|
-
src={item.videoPreviewImg}
|
|
195
|
-
alt="carousel-video-preview"
|
|
196
|
-
className="carousel-video-preview"
|
|
197
|
-
/>
|
|
198
|
-
<div className="icon-position">
|
|
199
|
-
<CapImage className="video-icon" src={videoPlay} />
|
|
200
|
-
</div>
|
|
201
|
-
</div>
|
|
202
|
-
)}
|
|
203
|
-
<div className="carousel-content">
|
|
204
|
-
<div className="carousel-title">
|
|
205
|
-
{item.title || item.header || ""}
|
|
206
|
-
</div>
|
|
207
|
-
<div className="carousel-message">
|
|
208
|
-
{item.message || item.bodyText || ""}
|
|
209
|
-
</div>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
))}
|
|
213
|
-
</div>
|
|
214
|
-
</div>
|
|
215
|
-
);
|
|
216
|
-
};
|
|
217
|
-
|
|
218
170
|
render() {
|
|
219
171
|
const {
|
|
220
172
|
channel,
|
|
@@ -261,7 +213,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
261
213
|
const type = this.props.location && this.props.location.query.type ? this.props.location.query.type : '';
|
|
262
214
|
let iosActions = [];
|
|
263
215
|
if ((channel || '').toLowerCase() === "mobilepush") {
|
|
264
|
-
iosActions = _.map(content.actions
|
|
216
|
+
iosActions = _.map(content.actions, (action) => {
|
|
265
217
|
if (action.label) {
|
|
266
218
|
return (<div className="actions" key={`action-${action.label}`}>
|
|
267
219
|
<span className="action">{action.label.toUpperCase()}</span>
|
|
@@ -458,32 +410,31 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
458
410
|
handlePreviewInNewTab(templatePreviewUrl);
|
|
459
411
|
};
|
|
460
412
|
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
413
|
+
const getPreviewImage = () => {
|
|
414
|
+
if (this.props.device === ANDROID) {
|
|
415
|
+
switch (templateLayoutType) {
|
|
416
|
+
case INAPP_MESSAGE_LAYOUT_TYPES.MODAL:
|
|
417
|
+
return inAppMobileAndroidModal;
|
|
418
|
+
case INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER:
|
|
419
|
+
return inAppMobileAndroidTop;
|
|
420
|
+
case INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER:
|
|
421
|
+
return inAppMobileAndroidBottom;
|
|
422
|
+
default:
|
|
423
|
+
return inAppMobileAndroidFull;
|
|
424
|
+
}
|
|
425
|
+
} else {
|
|
426
|
+
switch (templateLayoutType) {
|
|
427
|
+
case INAPP_MESSAGE_LAYOUT_TYPES.MODAL:
|
|
428
|
+
return inAppMobileIOSModal;
|
|
429
|
+
case INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER:
|
|
430
|
+
return inAppMobileIOSTop;
|
|
431
|
+
case INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER:
|
|
432
|
+
return inAppMobileIOSBottom;
|
|
433
|
+
default:
|
|
434
|
+
return inAppMobileIOSFull;
|
|
435
|
+
}
|
|
483
436
|
}
|
|
484
|
-
}
|
|
485
|
-
};
|
|
486
|
-
|
|
437
|
+
};
|
|
487
438
|
const whatsappUpdatedAccountName = whatsappAccountName || templateData?.versions?.base?.content?.whatsapp?.accountName || '';
|
|
488
439
|
const whatsappUpdatedLen = whatsappContentLen !== undefined ? whatsappContentLen : content?.charCount;
|
|
489
440
|
return (
|
|
@@ -655,7 +606,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
655
606
|
) : (
|
|
656
607
|
""
|
|
657
608
|
)}
|
|
658
|
-
{channel && channel.
|
|
609
|
+
{channel && channel.toLowerCase() === "mobilepush" && (
|
|
659
610
|
<div className="shell-v2 align-center" id="mobilepush-preview">
|
|
660
611
|
<CapImage
|
|
661
612
|
className="preview-image"
|
|
@@ -668,7 +619,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
668
619
|
/>
|
|
669
620
|
{(!!content.header ||
|
|
670
621
|
!!content.bodyText ||
|
|
671
|
-
!!content.bodyImage
|
|
622
|
+
!!content.bodyImage) && (
|
|
672
623
|
<div
|
|
673
624
|
className={`${
|
|
674
625
|
this.props.device === "ios" ? "iphone" : this.props.device
|
|
@@ -676,54 +627,22 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
676
627
|
>
|
|
677
628
|
{this.props.device === "android" ? (
|
|
678
629
|
<div className="message-pop align-left">
|
|
679
|
-
<div className="app-
|
|
680
|
-
<
|
|
681
|
-
|
|
682
|
-
<div className="title">{content.header}</div>
|
|
683
|
-
</div>
|
|
684
|
-
<div className="app-header-right">
|
|
685
|
-
<span>2:29 PM</span>
|
|
686
|
-
<CapIcon type="chevron-down" size="sm" />
|
|
687
|
-
</div>
|
|
630
|
+
<div className="app-name">
|
|
631
|
+
<span className="app-icon"></span>{" "}
|
|
632
|
+
{content.appName ? content.appName : "App name"}
|
|
688
633
|
</div>
|
|
634
|
+
<div className="title">{content.header}</div>
|
|
689
635
|
<div className="body-text">{content.bodyText}</div>
|
|
690
|
-
{
|
|
636
|
+
{content.bodyImage && (
|
|
691
637
|
<div className="body-image">
|
|
692
|
-
{
|
|
693
|
-
if (content?.bodyVideo?.videoSrc && !content.bodyImage && !content.bodyGif) {
|
|
694
|
-
return (
|
|
695
|
-
<video
|
|
696
|
-
key={`android-video-${content.bodyVideo.videoSrc}`}
|
|
697
|
-
controls
|
|
698
|
-
style={{ maxWidth: '100%', maxHeight: '120px' }}
|
|
699
|
-
poster={content?.bodyVideo?.videoPreview || undefined}
|
|
700
|
-
>
|
|
701
|
-
<source src={content.bodyVideo.videoSrc} type="video/mp4" />
|
|
702
|
-
{formatMessage(messages.videoNotSupported)}
|
|
703
|
-
</video>
|
|
704
|
-
);
|
|
705
|
-
} else if (content.bodyGif) {
|
|
706
|
-
return (
|
|
707
|
-
<img
|
|
708
|
-
src={content.bodyGif}
|
|
709
|
-
alt="GIF preview"
|
|
710
|
-
style={{ maxWidth: '100%', maxHeight: '120px' }}
|
|
711
|
-
key={`android-gif-${content.bodyGif}`}
|
|
712
|
-
/>
|
|
713
|
-
);
|
|
714
|
-
} else {
|
|
715
|
-
return (
|
|
716
|
-
<CapImage src={content.bodyImage || content?.bodyVideo?.videoPreview} alt="" />
|
|
717
|
-
);
|
|
718
|
-
}
|
|
719
|
-
})()}
|
|
638
|
+
<CapImage src={content.bodyImage} alt="" />
|
|
720
639
|
</div>
|
|
721
640
|
)}
|
|
722
|
-
{
|
|
641
|
+
{content.actions.filter((action) => action.label)
|
|
723
642
|
.length ? (
|
|
724
643
|
<div className="actions">
|
|
725
644
|
{_.map(
|
|
726
|
-
content.actions
|
|
645
|
+
content.actions,
|
|
727
646
|
(action) =>
|
|
728
647
|
!!action.label && (
|
|
729
648
|
<span
|
|
@@ -738,73 +657,26 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
738
657
|
) : (
|
|
739
658
|
""
|
|
740
659
|
)}
|
|
741
|
-
{channel && channel.toLowerCase() === "mobilepush" && this.renderMobilePushCarousel(content)}
|
|
742
660
|
</div>
|
|
743
661
|
) : (
|
|
744
662
|
<div className="message-pop align-left">
|
|
745
|
-
<div className="app-
|
|
746
|
-
<
|
|
747
|
-
|
|
748
|
-
<
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
<span>2:29 PM</span>
|
|
752
|
-
<CapIcon type="chevron-down" size="sm" />
|
|
753
|
-
</div>
|
|
663
|
+
<div className="app-name">
|
|
664
|
+
<span className="app-icon"></span>
|
|
665
|
+
{content.appName ? content.appName : "App name"}{" "}
|
|
666
|
+
<i className="material-icons">
|
|
667
|
+
{this.props.intl.formatMessage(messages.close)}
|
|
668
|
+
</i>
|
|
754
669
|
</div>
|
|
755
|
-
|
|
756
|
-
{(content.bodyImage || content?.bodyVideo?.videoSrc || content.bodyGif) && (
|
|
670
|
+
{content.bodyImage && (
|
|
757
671
|
<div className="body-image">
|
|
758
|
-
{
|
|
759
|
-
if (content?.bodyVideo?.videoSrc && !content.bodyImage && !content.bodyGif) {
|
|
760
|
-
return (
|
|
761
|
-
<video
|
|
762
|
-
key={`ios-video-${content.bodyVideo.videoSrc}`}
|
|
763
|
-
controls
|
|
764
|
-
style={{ maxWidth: '100%', maxHeight: '120px' }}
|
|
765
|
-
poster={content?.bodyVideo?.videoPreview || undefined}
|
|
766
|
-
>
|
|
767
|
-
<source src={content.bodyVideo.videoSrc} type="video/mp4" />
|
|
768
|
-
{formatMessage(messages.videoNotSupported)}
|
|
769
|
-
</video>
|
|
770
|
-
);
|
|
771
|
-
} else if (content.bodyGif) {
|
|
772
|
-
return (
|
|
773
|
-
<img
|
|
774
|
-
src={content.bodyGif}
|
|
775
|
-
alt="GIF preview"
|
|
776
|
-
style={{ maxWidth: '100%', maxHeight: '120px' }}
|
|
777
|
-
key={`ios-gif-${content.bodyGif}`}
|
|
778
|
-
/>
|
|
779
|
-
);
|
|
780
|
-
} else {
|
|
781
|
-
return (
|
|
782
|
-
<CapImage src={content.bodyImage || content?.bodyVideo?.videoPreview} alt="" />
|
|
783
|
-
);
|
|
784
|
-
}
|
|
785
|
-
})()}
|
|
672
|
+
<CapImage src={content.bodyImage} alt="" />
|
|
786
673
|
</div>
|
|
787
674
|
)}
|
|
788
|
-
{
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
(action) =>
|
|
794
|
-
!!action.label && (
|
|
795
|
-
<span
|
|
796
|
-
className="action"
|
|
797
|
-
key={`action-${action.label}`}
|
|
798
|
-
>
|
|
799
|
-
{action.label && action.label.toUpperCase()}
|
|
800
|
-
</span>
|
|
801
|
-
)
|
|
802
|
-
)}
|
|
803
|
-
</div>
|
|
804
|
-
) : (
|
|
805
|
-
""
|
|
806
|
-
)}
|
|
807
|
-
{channel && channel.toLowerCase() === "mobilepush" && this.renderMobilePushCarousel(content)}
|
|
675
|
+
<div className="title">{content.header}</div>
|
|
676
|
+
<div className="body-text">{content.bodyText}</div>
|
|
677
|
+
{content.actions.filter((action) => action.label).length
|
|
678
|
+
? iosActions
|
|
679
|
+
: ""}
|
|
808
680
|
</div>
|
|
809
681
|
)}
|
|
810
682
|
</div>
|
|
@@ -90,8 +90,4 @@ export default defineMessages({
|
|
|
90
90
|
id: `creatives.componentsV2.TemplatePreview.addToCart`,
|
|
91
91
|
defaultMessage: 'Add to cart',
|
|
92
92
|
},
|
|
93
|
-
videoNotSupported: {
|
|
94
|
-
id: 'creatives.componentsV2.TemplatePreview.videoNotSupported',
|
|
95
|
-
defaultMessage: 'Your browser does not support the video tag.',
|
|
96
|
-
},
|
|
97
93
|
});
|