@capillarytech/creatives-library 7.17.92 → 7.17.93
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/containers/Ebill/index.js +0 -1
- package/containers/MobilePush/Edit/index.js +0 -1
- package/index.js +0 -6
- package/package.json +1 -1
- package/routes.js +0 -5
- package/services/api.js +0 -5
- package/v2Components/CapImageUpload/index.js +3 -10
- package/v2Components/CapImageUpload/messages.js +0 -4
- package/v2Components/FormBuilder/index.js +4 -3
- package/v2Components/MobilePushPreviewV2/index.js +23 -81
- package/v2Components/TemplatePreview/_templatePreview.scss +0 -448
- package/v2Components/TemplatePreview/index.js +375 -660
- package/v2Components/TemplatePreview/messages.js +0 -4
- package/v2Containers/App/constants.js +0 -1
- package/v2Containers/CreativesContainer/SlideBoxContent.js +0 -43
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +1 -4
- package/v2Containers/CreativesContainer/constants.js +0 -1
- package/v2Containers/CreativesContainer/index.js +27 -94
- package/v2Containers/CreativesContainer/messages.js +0 -4
- package/v2Containers/MobilePush/Edit/index.js +1 -3
- package/v2Containers/Templates/_templates.scss +0 -10
- package/v2Containers/Templates/index.js +23 -103
- package/v2Containers/Templates/messages.js +0 -20
- package/v2Containers/TemplatesV2/index.js +2 -8
- package/v2Containers/TemplatesV2/messages.js +0 -4
- package/v2Components/CapDeviceContent/index.js +0 -338
- package/v2Components/CapDeviceContent/index.scss +0 -115
- package/v2Components/CapDeviceContent/messages.js +0 -107
- package/v2Components/CapDeviceContent/tests/index.test.js +0 -75
- package/v2Components/CapInAppCTA/constants.js +0 -25
- package/v2Components/CapInAppCTA/index.js +0 -281
- package/v2Components/CapInAppCTA/index.scss +0 -93
- package/v2Components/CapInAppCTA/messages.js +0 -85
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_bottom.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_full.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_modal.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_top.svg +0 -11
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_bottom.svg +0 -6
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_full.svg +0 -18
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_modal.svg +0 -7
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_top.svg +0 -13
- package/v2Containers/InApp/actions.js +0 -64
- package/v2Containers/InApp/constants.js +0 -95
- package/v2Containers/InApp/index.js +0 -745
- package/v2Containers/InApp/index.scss +0 -47
- package/v2Containers/InApp/messages.js +0 -86
- package/v2Containers/InApp/reducer.js +0 -109
- package/v2Containers/InApp/sagas.js +0 -143
- package/v2Containers/InApp/selectors.js +0 -12
- package/v2Containers/InApp/tests/action.test.js +0 -53
- package/v2Containers/InApp/tests/index.test.js +0 -152
- package/v2Containers/InApp/tests/mockData.js +0 -897
- package/v2Containers/InApp/tests/reducer.test.js +0 -177
- package/v2Containers/InApp/tests/sagas.test.js +0 -391
|
@@ -19,20 +19,11 @@ import {
|
|
|
19
19
|
WECHAT,
|
|
20
20
|
WHATSAPP,
|
|
21
21
|
RCS,
|
|
22
|
-
ZALO
|
|
23
|
-
INAPP,
|
|
22
|
+
ZALO
|
|
24
23
|
} from '../../v2Containers/CreativesContainer/constants';
|
|
25
24
|
import Carousel from '../Carousel';
|
|
26
25
|
import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
|
|
27
26
|
import whatsappMobileAndroid from './assets/images/whatsapp_mobile_android.svg';
|
|
28
|
-
import inAppMobileAndroidModal from './assets/images/inapp_mobile_android_modal.svg';
|
|
29
|
-
import inAppMobileAndroidTop from './assets/images/inapp_mobile_android_top.svg';
|
|
30
|
-
import inAppMobileAndroidBottom from './assets/images/inapp_mobile_android_bottom.svg';
|
|
31
|
-
import inAppMobileAndroidFull from './assets/images/inapp_mobile_android_full.svg';
|
|
32
|
-
import inAppMobileIOSModal from './assets/images/inapp_mobile_ios_modal.svg';
|
|
33
|
-
import inAppMobileIOSTop from './assets/images/inapp_mobile_ios_top.svg';
|
|
34
|
-
import inAppMobileIOSBottom from './assets/images/inapp_mobile_ios_bottom.svg';
|
|
35
|
-
import inAppMobileIOSFull from './assets/images/inapp_mobile_ios_full.svg';
|
|
36
27
|
import videoPlay from '../../assets/videoPlay.svg';
|
|
37
28
|
import zaloMessage from '../../v2Containers/Zalo/messages';
|
|
38
29
|
import { handlePreviewInNewTab } from '../../utils/common';
|
|
@@ -58,13 +49,13 @@ import {
|
|
|
58
49
|
CAP_PURPLE01,
|
|
59
50
|
CAP_G16,
|
|
60
51
|
CAP_SPACE_08,
|
|
52
|
+
CAP_SPACE_16,
|
|
61
53
|
} from '@capillarytech/cap-ui-library/styled/variables';
|
|
62
54
|
import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
|
|
63
55
|
import CapFacebookPreview from '../../v2Containers/CapFacebookPreview';
|
|
64
56
|
import WhatsappStatusContainer from '../WhatsappStatusContainer';
|
|
65
57
|
import { getWhatsappQuickReply } from '../../v2Containers/Whatsapp/utils';
|
|
66
58
|
import { QUICK_REPLY } from '../../v2Containers/Whatsapp/constants';
|
|
67
|
-
import { ANDROID, INAPP_MESSAGE_LAYOUT_TYPES } from '../../v2Containers/InApp/constants';
|
|
68
59
|
|
|
69
60
|
export class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
70
61
|
onPreviewContentClicked = (channel) => {
|
|
@@ -173,20 +164,17 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
173
164
|
viberAccountName,
|
|
174
165
|
whatsappAccountName,
|
|
175
166
|
whatsappContentLen,
|
|
176
|
-
inAppAccountName,
|
|
177
167
|
intl,
|
|
178
168
|
templateData,
|
|
179
169
|
rcsIosPreview,
|
|
180
170
|
hideTestAndPreviewBtn,
|
|
181
171
|
hasJPLocaleHideFeatureEnabled,
|
|
182
|
-
templateLayoutType,
|
|
183
|
-
device,
|
|
184
172
|
} = this.props;
|
|
185
173
|
let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
|
|
174
|
+
|
|
186
175
|
const { formatMessage } = intl;
|
|
187
|
-
const { buttonText, imageURL, rcsPreviewContent,
|
|
176
|
+
const { buttonText, imageURL, rcsPreviewContent, messageContent: viberMessageContent } = content || {};
|
|
188
177
|
const { rcsImageSrc, rcsTitle, rcsDesc, buttonText: rcsButtonText } = rcsPreviewContent || {};
|
|
189
|
-
const {mediaPreview = {}, templateTitle = "", templateMsg = "", ctaData} = inAppPreviewContent || {};
|
|
190
178
|
let smsDetails = {};
|
|
191
179
|
// let smsText = '';
|
|
192
180
|
if (this.props.content && this.props.charCounterEnabled) {
|
|
@@ -392,316 +380,183 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
392
380
|
handlePreviewInNewTab(templatePreviewUrl);
|
|
393
381
|
};
|
|
394
382
|
|
|
395
|
-
const getPreviewImage = () => {
|
|
396
|
-
if (this.props.device === ANDROID) {
|
|
397
|
-
switch (templateLayoutType) {
|
|
398
|
-
case INAPP_MESSAGE_LAYOUT_TYPES.MODAL:
|
|
399
|
-
return inAppMobileAndroidModal;
|
|
400
|
-
case INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER:
|
|
401
|
-
return inAppMobileAndroidTop;
|
|
402
|
-
case INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER:
|
|
403
|
-
return inAppMobileAndroidBottom;
|
|
404
|
-
default:
|
|
405
|
-
return inAppMobileAndroidFull;
|
|
406
|
-
}
|
|
407
|
-
} else {
|
|
408
|
-
switch (templateLayoutType) {
|
|
409
|
-
case INAPP_MESSAGE_LAYOUT_TYPES.MODAL:
|
|
410
|
-
return inAppMobileIOSModal;
|
|
411
|
-
case INAPP_MESSAGE_LAYOUT_TYPES.TOPBANNER:
|
|
412
|
-
return inAppMobileIOSTop;
|
|
413
|
-
case INAPP_MESSAGE_LAYOUT_TYPES.BOTTOMBANNER:
|
|
414
|
-
return inAppMobileIOSBottom;
|
|
415
|
-
default:
|
|
416
|
-
return inAppMobileIOSFull;
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
};
|
|
420
383
|
const whatsappUpdatedAccountName = whatsappAccountName || templateData?.versions?.base?.content?.whatsapp?.accountName || '';
|
|
421
384
|
const whatsappUpdatedLen = whatsappContentLen !== undefined ? whatsappContentLen : content?.charCount;
|
|
385
|
+
|
|
422
386
|
return (
|
|
423
387
|
<CapRow>
|
|
424
|
-
{this.props.showCount &&
|
|
425
|
-
channel &&
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
{
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
values={{ optoutUrlLength: smsDetails.optouturlLength }}
|
|
447
|
-
/>
|
|
448
|
-
</CapHeading>
|
|
449
|
-
)}
|
|
450
|
-
{channel?.toLowerCase() === WHATSAPP.toLowerCase() ? (
|
|
451
|
-
<>
|
|
452
|
-
<WhatsappStatusContainer template={templateData} />
|
|
453
|
-
<CapHeading type="h3" className="margin-t-12">
|
|
454
|
-
<FormattedMessage
|
|
455
|
-
{...messages.whatsappMessageLength}
|
|
456
|
-
values={{ length: whatsappUpdatedLen }}
|
|
457
|
-
/>
|
|
458
|
-
</CapHeading>
|
|
459
|
-
</>
|
|
460
|
-
) : null}
|
|
461
|
-
</CapColumn>
|
|
462
|
-
)}
|
|
388
|
+
{this.props.showCount && (channel && channel.toLowerCase() !== FACEBOOK) && <CapColumn span={16}>
|
|
389
|
+
{channel && channel.toLowerCase() === 'sms' && <CapHeading type="h3">
|
|
390
|
+
<FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.chars_used}}/>
|
|
391
|
+
{smsDetails.unicode &&
|
|
392
|
+
<FormattedMessage {...messages.smsFormatType}/>
|
|
393
|
+
}
|
|
394
|
+
</CapHeading>}
|
|
395
|
+
{smsDetails.optoutUrlPresent && <CapHeading type="h6">
|
|
396
|
+
<FormattedMessage {...messages.optoutCharactersTotal} values={{optoutUrlLength: smsDetails.optouturlLength}} />
|
|
397
|
+
</CapHeading>}
|
|
398
|
+
{channel?.toLowerCase() === WHATSAPP.toLowerCase() ? (
|
|
399
|
+
<>
|
|
400
|
+
<WhatsappStatusContainer template={templateData} />
|
|
401
|
+
<CapHeading type="h3" className="margin-t-12">
|
|
402
|
+
<FormattedMessage
|
|
403
|
+
{...messages.whatsappMessageLength}
|
|
404
|
+
values={{ length: whatsappUpdatedLen }}
|
|
405
|
+
/>
|
|
406
|
+
</CapHeading>
|
|
407
|
+
</>
|
|
408
|
+
) : null}
|
|
409
|
+
</CapColumn>}
|
|
463
410
|
<CapColumn span={this.props.showCount ? 8 : 24}>
|
|
464
411
|
{showTestAndPreview && (
|
|
465
412
|
<div className="test-and-preview-container">
|
|
466
413
|
<CapButton
|
|
467
414
|
style={{
|
|
468
|
-
color:
|
|
469
|
-
display:
|
|
470
|
-
padding:
|
|
471
|
-
marginTop:
|
|
415
|
+
color: '#2466ea',
|
|
416
|
+
display: 'inline-block',
|
|
417
|
+
padding: '0 6px',
|
|
418
|
+
marginTop: '12px',
|
|
472
419
|
}}
|
|
473
420
|
type="flat"
|
|
474
421
|
onClick={() => this.onPreviewContentClicked(this.props.channel)}
|
|
475
422
|
disabled={disablePreviewAndTest}
|
|
476
423
|
>
|
|
477
|
-
<CapIcon type="eye" />
|
|
478
|
-
<FormattedMessage {...messages.preview} />
|
|
424
|
+
<CapIcon type="eye"/><FormattedMessage {...messages.preview} />
|
|
479
425
|
</CapButton>
|
|
480
426
|
<CapButton
|
|
481
427
|
style={{
|
|
482
|
-
color:
|
|
483
|
-
display:
|
|
484
|
-
padding:
|
|
485
|
-
marginTop:
|
|
428
|
+
color: '#2466ea',
|
|
429
|
+
display: 'inline-block',
|
|
430
|
+
padding: '0 6px',
|
|
431
|
+
marginTop: '12px',
|
|
486
432
|
}}
|
|
487
433
|
type="flat"
|
|
488
434
|
onClick={() => this.onTestContentClicked(this.props.channel)}
|
|
489
435
|
disabled={disablePreviewAndTest}
|
|
490
436
|
>
|
|
491
|
-
<CapIcon type="lab" />
|
|
492
|
-
<FormattedMessage {...messages.testMessage} />
|
|
437
|
+
<CapIcon type="lab"/><FormattedMessage {...messages.testMessage} />
|
|
493
438
|
</CapButton>
|
|
494
439
|
</div>
|
|
495
440
|
)}
|
|
496
|
-
<div
|
|
497
|
-
|
|
498
|
-
type === "embedded" ? "embedded-preview" : ""
|
|
499
|
-
}`}
|
|
500
|
-
>
|
|
501
|
-
{channel && channel.toLowerCase() === "sms" && (
|
|
441
|
+
<div className={`preview-container ${type === 'embedded' ? 'embedded-preview' : ''}`}>
|
|
442
|
+
{ channel && channel.toLowerCase() === 'sms' &&
|
|
502
443
|
<div>
|
|
503
444
|
<div className="shell-v2 align-center" id="sms-preview">
|
|
504
|
-
<CapImage
|
|
505
|
-
className="preview-image sms"
|
|
506
|
-
src={smsMobileAndroid}
|
|
507
|
-
alt="Preview is being generated"
|
|
508
|
-
/>
|
|
445
|
+
<CapImage className="preview-image sms" src={smsMobileAndroid} alt="Preview is being generated"/>
|
|
509
446
|
<div className="msg-container sms">
|
|
510
447
|
<div className={"message-pop sms"}>
|
|
511
|
-
{content &&
|
|
512
|
-
content
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
className="message-pop-item align-left"
|
|
517
|
-
style={{ background: "#FFFFFF", color: "#091e42" }}
|
|
518
|
-
>
|
|
519
|
-
{msg}
|
|
520
|
-
</CapColumn>
|
|
521
|
-
))}
|
|
448
|
+
{content && content.length && content.map((msg, index) =>
|
|
449
|
+
<CapColumn key={`"message-pop-content-${index}`} className="message-pop-item align-left" style={{ background: '#FFFFFF', color: '#091e42'}}>
|
|
450
|
+
{msg}
|
|
451
|
+
</CapColumn>)
|
|
452
|
+
}
|
|
522
453
|
</div>
|
|
523
454
|
</div>
|
|
524
455
|
</div>
|
|
525
|
-
{!this.props.showCount &&
|
|
526
|
-
<
|
|
527
|
-
<
|
|
528
|
-
{
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
<FormattedMessage {...messages.smsFormatType} />
|
|
539
|
-
)}
|
|
540
|
-
</CapHeading>
|
|
541
|
-
)}
|
|
542
|
-
{smsDetails.optoutUrlPresent && (
|
|
543
|
-
<CapHeading type="h6" className="optout-tag-heading">
|
|
544
|
-
<FormattedMessage
|
|
545
|
-
{...messages.optoutCharactersTotal}
|
|
546
|
-
values={{
|
|
547
|
-
optoutUrlLength: smsDetails.optouturlLength,
|
|
548
|
-
}}
|
|
549
|
-
/>
|
|
550
|
-
</CapHeading>
|
|
551
|
-
)}
|
|
552
|
-
</CapColumn>
|
|
553
|
-
</div>
|
|
554
|
-
)}
|
|
456
|
+
{!this.props.showCount && <div>
|
|
457
|
+
<CapColumn className="character-count-col" span={22}>
|
|
458
|
+
{(channel || '').toLowerCase() === 'sms' && <CapHeading type="h3">
|
|
459
|
+
<FormattedMessage {...messages.charactersTotal} values={{smsCount: smsDetails.parts, charCount: smsDetails.chars_used}}/>
|
|
460
|
+
{smsDetails.unicode &&
|
|
461
|
+
<FormattedMessage {...messages.smsFormatType}/>
|
|
462
|
+
}
|
|
463
|
+
</CapHeading>}
|
|
464
|
+
{smsDetails.optoutUrlPresent && <CapHeading type="h6" className="optout-tag-heading">
|
|
465
|
+
<FormattedMessage {...messages.optoutCharactersTotal} values={{optoutUrlLength: smsDetails.optouturlLength}} />
|
|
466
|
+
</CapHeading>}
|
|
467
|
+
</CapColumn>
|
|
468
|
+
</div>}
|
|
555
469
|
</div>
|
|
556
|
-
|
|
557
|
-
{channel && channel.toLowerCase() ===
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
(channel || "").toLowerCase() === "wechat"
|
|
563
|
-
? wechatBodyNew
|
|
564
|
-
: smsMobileAndroid
|
|
565
|
-
}
|
|
566
|
-
alt="Preview is being generated"
|
|
567
|
-
/>
|
|
568
|
-
<div className="msg-container wechat">
|
|
569
|
-
<div
|
|
570
|
-
className="message-pop align-left"
|
|
571
|
-
style={{
|
|
572
|
-
background: `${
|
|
573
|
-
this.props.channel.toLowerCase() === "wechat"
|
|
574
|
-
? "#ffffff"
|
|
575
|
-
: "#3F51B5"
|
|
576
|
-
}`,
|
|
577
|
-
color: `${
|
|
578
|
-
this.props.channel.toLowerCase() === "wechat"
|
|
579
|
-
? "#333333"
|
|
580
|
-
: "#ffffff"
|
|
581
|
-
}`,
|
|
582
|
-
}}
|
|
583
|
-
>
|
|
584
|
-
{content}
|
|
585
|
-
</div>
|
|
470
|
+
}
|
|
471
|
+
{channel && channel.toLowerCase() === 'wechat' ?
|
|
472
|
+
( <div className="shell-v2 align-center" id="sms-preview">
|
|
473
|
+
<CapImage className="preview-image" src={(channel || '').toLowerCase() === 'wechat' ? wechatBodyNew : smsMobileAndroid} alt="Preview is being generated"/>
|
|
474
|
+
<div className="msg-container wechat">
|
|
475
|
+
<div className="message-pop align-left" style={{ background: `${this.props.channel.toLowerCase() === 'wechat' ? '#ffffff' : '#3F51B5'}`, color: `${this.props.channel.toLowerCase() === 'wechat' ? '#333333' : '#ffffff'}`}}>{content}
|
|
586
476
|
</div>
|
|
587
477
|
</div>
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
{channel && channel.toLowerCase() ===
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
alt={this.props.intl.formatMessage(messages.previewGenerated)}
|
|
601
|
-
/>
|
|
602
|
-
{(!!content.header ||
|
|
603
|
-
!!content.bodyText ||
|
|
604
|
-
!!content.bodyImage) && (
|
|
605
|
-
<div
|
|
606
|
-
className={`${
|
|
607
|
-
this.props.device === "ios" ? "iphone" : this.props.device
|
|
608
|
-
}-push-message-Container`}
|
|
609
|
-
>
|
|
610
|
-
{this.props.device === "android" ? (
|
|
611
|
-
<div className="message-pop align-left">
|
|
612
|
-
<div className="app-name">
|
|
613
|
-
<span className="app-icon"></span>{" "}
|
|
614
|
-
{content.appName ? content.appName : "App name"}
|
|
615
|
-
</div>
|
|
616
|
-
<div className="title">{content.header}</div>
|
|
617
|
-
<div className="body-text">{content.bodyText}</div>
|
|
618
|
-
{content.bodyImage && (
|
|
619
|
-
<div className="body-image">
|
|
620
|
-
<CapImage src={content.bodyImage} alt="" />
|
|
621
|
-
</div>
|
|
622
|
-
)}
|
|
623
|
-
{content.actions.filter((action) => action.label)
|
|
624
|
-
.length ? (
|
|
625
|
-
<div className="actions">
|
|
626
|
-
{_.map(
|
|
627
|
-
content.actions,
|
|
628
|
-
(action) =>
|
|
629
|
-
!!action.label && (
|
|
630
|
-
<span
|
|
631
|
-
className="action"
|
|
632
|
-
key={`action-${action.label}`}
|
|
633
|
-
>
|
|
634
|
-
{action.label && action.label.toUpperCase()}
|
|
635
|
-
</span>
|
|
636
|
-
)
|
|
637
|
-
)}
|
|
638
|
-
</div>
|
|
639
|
-
) : (
|
|
640
|
-
""
|
|
641
|
-
)}
|
|
478
|
+
</div>
|
|
479
|
+
) : ''
|
|
480
|
+
}
|
|
481
|
+
{ channel && (channel.toLowerCase() === 'mobilepush') &&
|
|
482
|
+
(<div className="shell-v2 align-center" id="mobilepush-preview">
|
|
483
|
+
<CapImage className="preview-image" src={this.props.device === "android" ? androidPushMessagePhone : iPhonePushMessagePhone} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
|
|
484
|
+
{(!!content.header || !!content.bodyText || !!content.bodyImage) &&
|
|
485
|
+
<div className={`${this.props.device === 'ios' ? 'iphone' : this.props.device}-push-message-Container`}>
|
|
486
|
+
{this.props.device === "android" ?
|
|
487
|
+
<div className="message-pop align-left">
|
|
488
|
+
<div className="app-name">
|
|
489
|
+
<span className="app-icon"></span> {content.appName ? content.appName : "App name"}
|
|
642
490
|
</div>
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
<div className="app-name">
|
|
646
|
-
<span className="app-icon"></span>
|
|
647
|
-
{content.appName ? content.appName : "App name"}{" "}
|
|
648
|
-
<i className="material-icons">
|
|
649
|
-
{this.props.intl.formatMessage(messages.close)}
|
|
650
|
-
</i>
|
|
651
|
-
</div>
|
|
652
|
-
{content.bodyImage && (
|
|
653
|
-
<div className="body-image">
|
|
654
|
-
<CapImage src={content.bodyImage} alt="" />
|
|
655
|
-
</div>
|
|
656
|
-
)}
|
|
657
|
-
<div className="title">{content.header}</div>
|
|
658
|
-
<div className="body-text">{content.bodyText}</div>
|
|
659
|
-
{content.actions.filter((action) => action.label).length
|
|
660
|
-
? iosActions
|
|
661
|
-
: ""}
|
|
491
|
+
<div className="title">
|
|
492
|
+
{content.header}
|
|
662
493
|
</div>
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
494
|
+
<div className="body-text">
|
|
495
|
+
{content.bodyText}
|
|
496
|
+
</div>
|
|
497
|
+
{content.bodyImage && <div className="body-image">
|
|
498
|
+
<CapImage src={content.bodyImage} alt="" />
|
|
499
|
+
</div>}
|
|
500
|
+
{content.actions.filter((action) => action.label).length ?
|
|
501
|
+
<div className="actions">
|
|
502
|
+
{_.map(content.actions, (action) => !!action.label &&
|
|
503
|
+
<span className="action" key={`action-${action.label}`}>{action.label && action.label.toUpperCase()}</span>)}
|
|
504
|
+
</div> : ''
|
|
505
|
+
}
|
|
506
|
+
</div>
|
|
507
|
+
:
|
|
508
|
+
<div className="message-pop align-left">
|
|
509
|
+
<div className="app-name">
|
|
510
|
+
<span className="app-icon"></span>{content.appName ? content.appName : "App name"} <i className="material-icons">{this.props.intl.formatMessage(messages.close)}</i>
|
|
511
|
+
</div>
|
|
512
|
+
{content.bodyImage && <div className="body-image">
|
|
513
|
+
<CapImage src={content.bodyImage} alt=""/>
|
|
514
|
+
</div>}
|
|
515
|
+
<div className="title">
|
|
516
|
+
{content.header}
|
|
517
|
+
</div>
|
|
518
|
+
<div className="body-text">
|
|
519
|
+
{content.bodyText}
|
|
520
|
+
</div>
|
|
521
|
+
{content.actions.filter((action) => action.label).length ? iosActions : ''}
|
|
522
|
+
</div>
|
|
676
523
|
}
|
|
677
|
-
|
|
678
|
-
|
|
524
|
+
</div>
|
|
525
|
+
}
|
|
526
|
+
</div>
|
|
527
|
+
)
|
|
528
|
+
}
|
|
529
|
+
{
|
|
530
|
+
channel && channel.toLowerCase() === 'line' ? (
|
|
531
|
+
<div className="shell-v2 align-center" id="sms-preview">
|
|
532
|
+
<CapImage className="preview-image" src={hasJPLocaleHideFeatureEnabled ? lineMobileAndroidJapaneseImg : lineMobileAndroidDefaultImg} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
|
|
533
|
+
<div
|
|
534
|
+
className="msg-container line-preview"
|
|
535
|
+
style={{
|
|
536
|
+
maxHeight: 330,
|
|
537
|
+
overflow: 'auto',
|
|
538
|
+
flexDirection: 'column',
|
|
539
|
+
marginLeft: 40,
|
|
540
|
+
left: !this.props.showCount && '200px',
|
|
541
|
+
}}
|
|
542
|
+
>
|
|
679
543
|
<div
|
|
680
|
-
className="
|
|
544
|
+
className="sms-icon"
|
|
681
545
|
style={{
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
546
|
+
left: 0,
|
|
547
|
+
top: 8,
|
|
548
|
+
borderRadius: '50%',
|
|
549
|
+
width: 20,
|
|
550
|
+
height: 20,
|
|
551
|
+
background: CAP_COLOR_03,
|
|
552
|
+
paddingRight: 5,
|
|
687
553
|
}}
|
|
688
554
|
>
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
borderRadius: "50%",
|
|
695
|
-
width: 20,
|
|
696
|
-
height: 20,
|
|
697
|
-
background: CAP_COLOR_03,
|
|
698
|
-
paddingRight: 5,
|
|
699
|
-
}}
|
|
700
|
-
>
|
|
701
|
-
{this.props.LineAccountName}
|
|
702
|
-
</div>
|
|
703
|
-
<>
|
|
704
|
-
{content.map((item) => {
|
|
555
|
+
{this.props.LineAccountName}
|
|
556
|
+
</div>
|
|
557
|
+
<>
|
|
558
|
+
{
|
|
559
|
+
content.map((item) => {
|
|
705
560
|
const {
|
|
706
561
|
type,
|
|
707
562
|
messageContent,
|
|
@@ -718,12 +573,12 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
718
573
|
background: CAP_WHITE,
|
|
719
574
|
color: FONT_COLOR_01,
|
|
720
575
|
borderRadius: 8,
|
|
721
|
-
position:
|
|
722
|
-
margin:
|
|
723
|
-
height:
|
|
724
|
-
minHeight:
|
|
725
|
-
overflow:
|
|
726
|
-
maxHeight:
|
|
576
|
+
position: 'static',
|
|
577
|
+
margin: '6px 0 20px 28px',
|
|
578
|
+
height: 'auto',
|
|
579
|
+
minHeight: 'auto',
|
|
580
|
+
overflow: 'initial',
|
|
581
|
+
maxHeight: 'initial',
|
|
727
582
|
};
|
|
728
583
|
if (type === TEXT) {
|
|
729
584
|
return (
|
|
@@ -731,22 +586,20 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
731
586
|
className="message-pop align-left"
|
|
732
587
|
style={sectionStyle}
|
|
733
588
|
>
|
|
734
|
-
<p style={{ marginBottom: 5 }}>
|
|
735
|
-
{messageContent || ""}
|
|
736
|
-
</p>
|
|
589
|
+
<p style={{ marginBottom: 5 }}>{messageContent || ''}</p>
|
|
737
590
|
</div>
|
|
738
591
|
);
|
|
739
592
|
}
|
|
740
|
-
if (type === IMAGE && previewImageUrl) {
|
|
593
|
+
if ((type === IMAGE && previewImageUrl)) {
|
|
741
594
|
return (
|
|
742
595
|
<div
|
|
743
596
|
className="message-pop align-left"
|
|
744
597
|
style={{
|
|
745
598
|
...sectionStyle,
|
|
746
599
|
minHeight: 184,
|
|
747
|
-
display:
|
|
748
|
-
justifyContent:
|
|
749
|
-
alignItems:
|
|
600
|
+
display: 'flex',
|
|
601
|
+
justifyContent: 'center',
|
|
602
|
+
alignItems: 'center',
|
|
750
603
|
}}
|
|
751
604
|
>
|
|
752
605
|
<CapImage
|
|
@@ -754,7 +607,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
754
607
|
alt="brand-name"
|
|
755
608
|
rest={{
|
|
756
609
|
style: {
|
|
757
|
-
maxWidth:
|
|
610
|
+
maxWidth: '100%',
|
|
758
611
|
marginBottom: 5,
|
|
759
612
|
},
|
|
760
613
|
}}
|
|
@@ -763,19 +616,11 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
763
616
|
);
|
|
764
617
|
}
|
|
765
618
|
if (type === VIDEO) {
|
|
766
|
-
return getVideoContent({
|
|
767
|
-
video,
|
|
768
|
-
actionUrl,
|
|
769
|
-
sectionStyle,
|
|
770
|
-
});
|
|
619
|
+
return getVideoContent({ video, actionUrl, sectionStyle });
|
|
771
620
|
}
|
|
772
|
-
if (type === IMAGE_MAP && baseUrl) {
|
|
621
|
+
if ((type === IMAGE_MAP && baseUrl)) {
|
|
773
622
|
if (video) {
|
|
774
|
-
return getVideoContent({
|
|
775
|
-
video,
|
|
776
|
-
actionUrl,
|
|
777
|
-
sectionStyle,
|
|
778
|
-
});
|
|
623
|
+
return getVideoContent({ video, actionUrl, sectionStyle });
|
|
779
624
|
}
|
|
780
625
|
return (
|
|
781
626
|
<div
|
|
@@ -783,19 +628,17 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
783
628
|
style={{
|
|
784
629
|
...sectionStyle,
|
|
785
630
|
minHeight: 184,
|
|
786
|
-
display:
|
|
787
|
-
justifyContent:
|
|
788
|
-
alignItems:
|
|
631
|
+
display: 'flex',
|
|
632
|
+
justifyContent: 'center',
|
|
633
|
+
alignItems: 'center',
|
|
789
634
|
}}
|
|
790
635
|
>
|
|
791
636
|
<CapImage
|
|
792
|
-
src={
|
|
793
|
-
baseUrl ? `${baseUrl}/1040` : lineImgPlaceholder
|
|
794
|
-
}
|
|
637
|
+
src={baseUrl ? `${baseUrl}/1040` : lineImgPlaceholder}
|
|
795
638
|
alt="brand-name"
|
|
796
639
|
rest={{
|
|
797
640
|
style: {
|
|
798
|
-
maxWidth:
|
|
641
|
+
maxWidth: '100%',
|
|
799
642
|
marginBottom: 5,
|
|
800
643
|
},
|
|
801
644
|
}}
|
|
@@ -809,311 +652,265 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
809
652
|
className="message-pop align-left"
|
|
810
653
|
style={{
|
|
811
654
|
...sectionStyle,
|
|
812
|
-
background:
|
|
813
|
-
display:
|
|
814
|
-
justifyContent:
|
|
815
|
-
alignItems:
|
|
655
|
+
background: 'transparent',
|
|
656
|
+
display: 'flex',
|
|
657
|
+
justifyContent: 'center',
|
|
658
|
+
alignItems: 'center',
|
|
816
659
|
}}
|
|
817
660
|
>
|
|
818
661
|
<CapImage
|
|
819
662
|
src={selectedSticker.stickerUrl}
|
|
820
|
-
style={{
|
|
663
|
+
style={{maxWidth: '100%', marginBottom: 5 }}
|
|
821
664
|
rest={{
|
|
822
665
|
style: {
|
|
823
|
-
maxWidth:
|
|
666
|
+
maxWidth: '100%',
|
|
824
667
|
marginBottom: 5,
|
|
825
668
|
},
|
|
826
669
|
height: 70,
|
|
827
|
-
onMouseOut: (e) =>
|
|
828
|
-
|
|
829
|
-
selectedSticker.stickerUrl),
|
|
830
|
-
onMouseOver: (e) =>
|
|
831
|
-
(e.currentTarget.src =
|
|
832
|
-
selectedSticker.animatedStickerUrl ||
|
|
833
|
-
selectedSticker.stickerUrl),
|
|
670
|
+
onMouseOut: (e) => (e.currentTarget.src = selectedSticker.stickerUrl),
|
|
671
|
+
onMouseOver: (e) => (e.currentTarget.src = selectedSticker.animatedStickerUrl || selectedSticker.stickerUrl),
|
|
834
672
|
}}
|
|
835
673
|
/>
|
|
836
674
|
</div>
|
|
837
675
|
);
|
|
838
676
|
}
|
|
839
|
-
if (
|
|
840
|
-
(type === IMAGE_CAROUSEL ||
|
|
841
|
-
type === TEMPLATE ||
|
|
842
|
-
type === "template") &&
|
|
843
|
-
imageCarousel
|
|
844
|
-
) {
|
|
677
|
+
if ((type === IMAGE_CAROUSEL || type === TEMPLATE || type === 'template') && imageCarousel) {
|
|
845
678
|
return (
|
|
846
679
|
<div
|
|
847
680
|
style={{
|
|
848
|
-
margin:
|
|
681
|
+
margin: '6px 0 20px 28px',
|
|
849
682
|
}}
|
|
850
683
|
>
|
|
851
|
-
<Carousel imageCarousel={imageCarousel}
|
|
684
|
+
<Carousel imageCarousel={imageCarousel}/>
|
|
852
685
|
</div>
|
|
853
686
|
);
|
|
854
687
|
}
|
|
855
688
|
return null;
|
|
856
|
-
})
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
{renderLineMultiText(content)}
|
|
689
|
+
})
|
|
690
|
+
}
|
|
691
|
+
</>
|
|
860
692
|
</div>
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
693
|
+
{renderLineMultiText(content)}
|
|
694
|
+
</div>
|
|
695
|
+
) : ''
|
|
696
|
+
}
|
|
697
|
+
{
|
|
698
|
+
channel && channel.toLowerCase() === VIBER ? (
|
|
699
|
+
<div className="shell-v2 align-center" id="sms-preview">
|
|
700
|
+
<CapImage className="preview-image" src={viberMobileAndroid} alt={this.props.intl.formatMessage(messages.previewGenerated)}/>
|
|
701
|
+
<div style={{ position: 'absolute', top: '12%', left: '36%'}}>{viberBrandName}</div>
|
|
702
|
+
<div
|
|
703
|
+
className="msg-container viber-preview"
|
|
704
|
+
style={{
|
|
705
|
+
maxHeight: 292,
|
|
706
|
+
marginLeft: 28,
|
|
707
|
+
}}
|
|
708
|
+
>
|
|
874
709
|
<div
|
|
875
|
-
className="
|
|
710
|
+
className="sms-icon"
|
|
876
711
|
style={{
|
|
877
|
-
|
|
878
|
-
|
|
712
|
+
"width": 20,
|
|
713
|
+
"height": 20,
|
|
714
|
+
"margin": '0 4px 277px 0',
|
|
715
|
+
'border-radius': '4px',
|
|
716
|
+
'background-color': CAP_PURPLE01,
|
|
717
|
+
'font-size': '12px',
|
|
718
|
+
'font-weight': 900,
|
|
719
|
+
"color": CAP_WHITE,
|
|
879
720
|
}}
|
|
880
721
|
>
|
|
881
|
-
|
|
882
|
-
|
|
722
|
+
{viberAccountName}
|
|
723
|
+
</div>
|
|
724
|
+
<div
|
|
725
|
+
className="message-pop align-left"
|
|
726
|
+
style={viberSectionStyle}>
|
|
727
|
+
{/* Text Viber preview */}
|
|
728
|
+
<p
|
|
883
729
|
style={{
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
margin:
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
730
|
+
'font-size': '10px',
|
|
731
|
+
"color": CAP_G16,
|
|
732
|
+
"margin": '1.5px 6px 1px 7px',
|
|
733
|
+
}}>{viberMessageContent || ''}
|
|
734
|
+
</p>
|
|
735
|
+
{/* Image Viber preview */}
|
|
736
|
+
{imageURL && <CapImage
|
|
737
|
+
src={imageURL}
|
|
738
|
+
alt="brand-name"
|
|
739
|
+
rest={{
|
|
740
|
+
style: {
|
|
741
|
+
maxWidth: '100%',
|
|
742
|
+
marginBottom: 5,
|
|
743
|
+
},
|
|
892
744
|
}}
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
<div
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
745
|
+
/>
|
|
746
|
+
}
|
|
747
|
+
{/* button viber preview */}
|
|
748
|
+
{buttonText && <div
|
|
749
|
+
style={{
|
|
750
|
+
'border-radius': '16px',
|
|
751
|
+
'background-color': CAP_PURPLE01,
|
|
752
|
+
"margin-top": '14px',
|
|
753
|
+
'text-align': 'center',
|
|
754
|
+
"width": '140px',
|
|
755
|
+
"height": '20px',
|
|
756
|
+
"margin-left": "8px",
|
|
757
|
+
}}>
|
|
901
758
|
<p
|
|
902
|
-
style={{
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
</p>
|
|
910
|
-
{/* Image Viber preview */}
|
|
911
|
-
{imageURL && (
|
|
912
|
-
<CapImage
|
|
913
|
-
src={imageURL}
|
|
914
|
-
alt="brand-name"
|
|
915
|
-
rest={{
|
|
916
|
-
style: {
|
|
917
|
-
maxWidth: "100%",
|
|
918
|
-
marginBottom: 5,
|
|
919
|
-
},
|
|
920
|
-
}}
|
|
921
|
-
/>
|
|
922
|
-
)}
|
|
923
|
-
{/* button viber preview */}
|
|
924
|
-
{buttonText && (
|
|
925
|
-
<div
|
|
926
|
-
style={{
|
|
927
|
-
"border-radius": "16px",
|
|
928
|
-
"background-color": CAP_PURPLE01,
|
|
929
|
-
"margin-top": "14px",
|
|
930
|
-
"text-align": "center",
|
|
931
|
-
width: "140px",
|
|
932
|
-
height: "20px",
|
|
933
|
-
"margin-left": "8px",
|
|
934
|
-
}}
|
|
759
|
+
style={{ 'font-size': '12px',
|
|
760
|
+
'font-weight': '500',
|
|
761
|
+
"display": '-webkit-box',
|
|
762
|
+
'-webkit-line-clamp': '1',
|
|
763
|
+
'-webkit-box-orient': 'vertical',
|
|
764
|
+
'overflow': 'hidden',
|
|
765
|
+
"color": CAP_WHITE }}
|
|
935
766
|
>
|
|
936
|
-
|
|
937
|
-
style={{
|
|
938
|
-
"font-size": "12px",
|
|
939
|
-
"font-weight": "500",
|
|
940
|
-
display: "-webkit-box",
|
|
941
|
-
"-webkit-line-clamp": "1",
|
|
942
|
-
"-webkit-box-orient": "vertical",
|
|
943
|
-
overflow: "hidden",
|
|
944
|
-
color: CAP_WHITE,
|
|
945
|
-
}}
|
|
946
|
-
>
|
|
947
|
-
{buttonText || ""}
|
|
948
|
-
</p>
|
|
949
|
-
</div>
|
|
950
|
-
)}
|
|
951
|
-
<div style={{ paddingBottom: 32 }}></div>
|
|
767
|
+
{buttonText || ''}</p>
|
|
952
768
|
</div>
|
|
769
|
+
}
|
|
770
|
+
<div style={{ paddingBottom: 32}}></div>
|
|
953
771
|
</div>
|
|
772
|
+
|
|
954
773
|
</div>
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
{
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
<
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
<div
|
|
971
|
-
className="message-pop align-left"
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
<div className="video-preview">
|
|
989
|
-
<CapImage
|
|
990
|
-
src={content.whatsappVideoPreviewImg}
|
|
991
|
-
className="whatsapp-image"
|
|
992
|
-
alt={formatMessage(messages.previewGenerated)}
|
|
993
|
-
/>
|
|
994
|
-
<div className="icon-position">
|
|
774
|
+
</div>
|
|
775
|
+
) : ''
|
|
776
|
+
}
|
|
777
|
+
{
|
|
778
|
+
channel?.toUpperCase() === WHATSAPP ? (
|
|
779
|
+
<>
|
|
780
|
+
<div className="shell-v2 align-center">
|
|
781
|
+
<CapImage
|
|
782
|
+
className="preview-image"
|
|
783
|
+
src={whatsappMobileAndroid}
|
|
784
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
785
|
+
/>
|
|
786
|
+
<CapLabel className="whatsapp-brand-name">
|
|
787
|
+
{whatsappUpdatedAccountName || ''}
|
|
788
|
+
</CapLabel>
|
|
789
|
+
<div className="msg-container whatsapp-message-container">
|
|
790
|
+
<div className="message-pop align-left" style={whatsappSectionStyle}>
|
|
791
|
+
<div className="whatsapp-content">
|
|
792
|
+
{content?.showUrlPreview && (
|
|
793
|
+
renderUrlPreview(content?.metaTagsDetails)
|
|
794
|
+
)}
|
|
795
|
+
{content?.whatsappImageSrc && (
|
|
796
|
+
<CapImage
|
|
797
|
+
src={content.whatsappImageSrc}
|
|
798
|
+
className="whatsapp-image"
|
|
799
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
800
|
+
/>
|
|
801
|
+
)}
|
|
802
|
+
{content?.whatsappVideoPreviewImg && (
|
|
803
|
+
<CapTooltip
|
|
804
|
+
title={formatMessage(messages.videoPreviewTooltip)}
|
|
805
|
+
>
|
|
806
|
+
<div className="video-preview">
|
|
995
807
|
<CapImage
|
|
996
|
-
|
|
997
|
-
|
|
808
|
+
src={content.whatsappVideoPreviewImg}
|
|
809
|
+
className="whatsapp-image"
|
|
810
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
998
811
|
/>
|
|
812
|
+
<div className="icon-position">
|
|
813
|
+
<CapImage className="video-icon" src={videoPlay} />
|
|
814
|
+
</div>
|
|
999
815
|
</div>
|
|
816
|
+
</CapTooltip>
|
|
817
|
+
)}
|
|
818
|
+
{content?.docPreview && (
|
|
819
|
+
<div className="whatsapp-image">
|
|
820
|
+
{content?.docPreview}
|
|
1000
821
|
</div>
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
{content?.templateHeaderPreview || ""}
|
|
1009
|
-
{content?.templateMsg || ""}
|
|
1010
|
-
{content?.templateFooterPreview || ""}
|
|
1011
|
-
{renderWhatsappCtaPreview()}
|
|
1012
|
-
{renderQuickReplyPreview()}
|
|
822
|
+
)}
|
|
823
|
+
{content?.templateHeaderPreview || ''}
|
|
824
|
+
{content?.templateMsg || ''}
|
|
825
|
+
{content?.templateFooterPreview || ''}
|
|
826
|
+
{renderWhatsappCtaPreview()}
|
|
827
|
+
{renderQuickReplyPreview()}
|
|
828
|
+
</div>
|
|
1013
829
|
</div>
|
|
1014
830
|
</div>
|
|
1015
831
|
</div>
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
className="margin-t-16"
|
|
1021
|
-
>
|
|
1022
|
-
<FormattedMessage
|
|
1023
|
-
{...messages.whatsappMessageLength}
|
|
1024
|
-
values={{ length: whatsappUpdatedLen }}
|
|
1025
|
-
/>
|
|
1026
|
-
</CapHeading>
|
|
1027
|
-
</>
|
|
1028
|
-
) : (
|
|
1029
|
-
""
|
|
1030
|
-
)}
|
|
1031
|
-
{channel?.toUpperCase() === ZALO && (
|
|
1032
|
-
<CapRow
|
|
1033
|
-
className={`zalo-preview-container ${
|
|
1034
|
-
templateData?.fullMode
|
|
1035
|
-
? "zalo-preview-container-creative"
|
|
1036
|
-
: "zalo-preview-container-campaign"
|
|
1037
|
-
}`}
|
|
1038
|
-
>
|
|
1039
|
-
<CapRow>
|
|
1040
|
-
<CapLabel className="preview-head">
|
|
1041
|
-
{formatMessage(zaloMessage.previewHead)}
|
|
1042
|
-
</CapLabel>
|
|
1043
|
-
</CapRow>
|
|
1044
|
-
<CapRow>
|
|
1045
|
-
<CapLabel className="preview-text">
|
|
1046
|
-
{formatMessage(zaloMessage.previewText)}
|
|
1047
|
-
</CapLabel>
|
|
1048
|
-
</CapRow>
|
|
1049
|
-
<CapRow>
|
|
1050
|
-
<CapLabel
|
|
1051
|
-
data-testid="preview-link-button"
|
|
1052
|
-
onClick={handlePreview}
|
|
1053
|
-
className="preview-link"
|
|
832
|
+
<CapHeading
|
|
833
|
+
type="h3"
|
|
834
|
+
style={{ textAlign: 'center' }}
|
|
835
|
+
className="margin-t-16"
|
|
1054
836
|
>
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
837
|
+
<FormattedMessage
|
|
838
|
+
{...messages.whatsappMessageLength}
|
|
839
|
+
values={{ length: whatsappUpdatedLen }}
|
|
840
|
+
/>
|
|
841
|
+
</CapHeading>
|
|
842
|
+
</>
|
|
843
|
+
) : (
|
|
844
|
+
''
|
|
845
|
+
)
|
|
846
|
+
}
|
|
847
|
+
{
|
|
848
|
+
channel?.toUpperCase() === ZALO && (
|
|
849
|
+
<CapRow className={`zalo-preview-container ${templateData?.fullMode ? 'zalo-preview-container-creative' : 'zalo-preview-container-campaign'}`}>
|
|
850
|
+
<CapRow>
|
|
851
|
+
<CapLabel className="preview-head">
|
|
852
|
+
{formatMessage(zaloMessage.previewHead)}
|
|
853
|
+
</CapLabel>
|
|
854
|
+
</CapRow>
|
|
855
|
+
<CapRow>
|
|
856
|
+
<CapLabel className="preview-text">
|
|
857
|
+
{formatMessage(zaloMessage.previewText)}
|
|
858
|
+
</CapLabel>
|
|
859
|
+
</CapRow>
|
|
860
|
+
<CapRow>
|
|
861
|
+
<CapLabel
|
|
862
|
+
data-testid="preview-link-button"
|
|
863
|
+
onClick={handlePreview}
|
|
864
|
+
className="preview-link"
|
|
865
|
+
>
|
|
866
|
+
{formatMessage(zaloMessage.openPreview)}{' '}
|
|
867
|
+
<CapIcon type="open-in-new-light"></CapIcon>
|
|
868
|
+
</CapLabel>
|
|
869
|
+
</CapRow>
|
|
1058
870
|
</CapRow>
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
{
|
|
1062
|
-
|
|
1063
|
-
<
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
<div className="
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
)}
|
|
1077
|
-
{rcsTitle && (
|
|
1078
|
-
<CapLabel
|
|
1079
|
-
type="label5"
|
|
1080
|
-
className="message-pop-item align-left rcs-content"
|
|
1081
|
-
fontWeight="bold"
|
|
1082
|
-
>
|
|
1083
|
-
{rcsTitle}
|
|
1084
|
-
</CapLabel>
|
|
1085
|
-
)}
|
|
1086
|
-
{rcsDesc && (
|
|
1087
|
-
<CapLabel
|
|
1088
|
-
type="label5"
|
|
1089
|
-
className="message-pop-item align-left rcs-content rcs-desc"
|
|
1090
|
-
>
|
|
1091
|
-
{rcsDesc}
|
|
1092
|
-
</CapLabel>
|
|
1093
|
-
)}
|
|
1094
|
-
{rcsButtonText && (
|
|
1095
|
-
<CapLabel
|
|
1096
|
-
className="message-pop-item align-center rcs-content rcs-button-text"
|
|
1097
|
-
type="label21"
|
|
1098
|
-
>
|
|
1099
|
-
<CapIcon
|
|
1100
|
-
type="earth"
|
|
1101
|
-
size="xs"
|
|
1102
|
-
className="rcs-icon"
|
|
1103
|
-
svgProps={{ style: { marginRight: "4px" } }}
|
|
871
|
+
)
|
|
872
|
+
}
|
|
873
|
+
{
|
|
874
|
+
channel?.toUpperCase() === RCS && (
|
|
875
|
+
<div className="shell-v2 align-center">
|
|
876
|
+
<CapImage
|
|
877
|
+
className="preview-image"
|
|
878
|
+
src={rcsIosPreview ? smsMobileIos : smsMobileAndroid}
|
|
879
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
880
|
+
/>
|
|
881
|
+
<div className="msg-container sms">
|
|
882
|
+
<div className="message-pop sms">
|
|
883
|
+
{rcsImageSrc && (
|
|
884
|
+
<CapImage
|
|
885
|
+
src={rcsImageSrc}
|
|
886
|
+
className="rcs-image"
|
|
887
|
+
alt={formatMessage(messages.previewGenerated)}
|
|
1104
888
|
/>
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
889
|
+
)}
|
|
890
|
+
{rcsTitle && (
|
|
891
|
+
<CapLabel
|
|
892
|
+
type="label5"
|
|
893
|
+
className="message-pop-item align-left rcs-content"
|
|
894
|
+
fontWeight="bold"
|
|
895
|
+
>
|
|
896
|
+
{rcsTitle}
|
|
897
|
+
</CapLabel>
|
|
898
|
+
)}
|
|
899
|
+
{rcsDesc && (
|
|
900
|
+
<CapLabel type="label5" className="message-pop-item align-left rcs-content rcs-desc">
|
|
901
|
+
{rcsDesc}
|
|
902
|
+
</CapLabel>
|
|
903
|
+
)}
|
|
904
|
+
{rcsButtonText && (<CapLabel className="message-pop-item align-center rcs-content rcs-button-text" type="label21">
|
|
905
|
+
<CapIcon type="earth" size="xs" className="rcs-icon" svgProps={{style: {marginRight: "4px"}}}/>{rcsButtonText}
|
|
906
|
+
</CapLabel>)}
|
|
907
|
+
</div>
|
|
1108
908
|
</div>
|
|
1109
909
|
</div>
|
|
1110
|
-
|
|
1111
|
-
|
|
910
|
+
)
|
|
911
|
+
}
|
|
1112
912
|
{channel && channel.toLowerCase() === FACEBOOK && (
|
|
1113
|
-
<div
|
|
1114
|
-
style={{ position: "absolute", left: "80%" }}
|
|
1115
|
-
id="facebook-preview"
|
|
1116
|
-
>
|
|
913
|
+
<div style={{position: 'absolute', left: '80%'}} id="facebook-preview">
|
|
1117
914
|
<CapFacebookPreview
|
|
1118
915
|
disablePreviewButton={false}
|
|
1119
916
|
selectedAd={content.selectedAd}
|
|
@@ -1121,98 +918,16 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
|
|
|
1121
918
|
primaryText={content.primaryText}
|
|
1122
919
|
callToAction={content.callToAction}
|
|
1123
920
|
displayLink={content.displayLink}
|
|
1124
|
-
orgUnitFacebookPageSettingsMap={{
|
|
1125
|
-
|
|
1126
|
-
pageId: content.pageId,
|
|
1127
|
-
}}
|
|
921
|
+
orgUnitFacebookPageSettingsMap={{pageAccessToken: content.pageAccessToken,
|
|
922
|
+
pageId: content.pageId}}
|
|
1128
923
|
accountId={content.accountId}
|
|
1129
924
|
accessToken={content.accessToken}
|
|
1130
925
|
defaultGeneratePreview
|
|
1131
|
-
|
|
1132
|
-
</div>
|
|
1133
|
-
)}
|
|
1134
|
-
{channel?.toUpperCase() === INAPP && (
|
|
1135
|
-
<div className="shell-v2 align-center">
|
|
1136
|
-
<CapImage
|
|
1137
|
-
className="preview-image"
|
|
1138
|
-
src={getPreviewImage()}
|
|
1139
|
-
alt={formatMessage(messages.previewGenerated)}
|
|
1140
|
-
/>
|
|
1141
|
-
<div className="preview-image">
|
|
1142
|
-
<div
|
|
1143
|
-
className={`inapp-message-container-${templateLayoutType}-${device} sms`}
|
|
1144
|
-
>
|
|
1145
|
-
<div className="preview-inapp-screen">
|
|
1146
|
-
{
|
|
1147
|
-
<CapLabel
|
|
1148
|
-
type="label15"
|
|
1149
|
-
className={`align-center inapp-title-${templateLayoutType}-${device} ${
|
|
1150
|
-
mediaPreview?.inAppImageSrcAndroid
|
|
1151
|
-
? ""
|
|
1152
|
-
: `without-image-title-${templateLayoutType}-android`
|
|
1153
|
-
} ${
|
|
1154
|
-
mediaPreview?.inAppImageSrcIos
|
|
1155
|
-
? ""
|
|
1156
|
-
: `without-image-title-${templateLayoutType}-ios`
|
|
1157
|
-
}`}
|
|
1158
|
-
>
|
|
1159
|
-
{templateTitle ? templateTitle : " "}
|
|
1160
|
-
{/* this ternary is required here for preview */}
|
|
1161
|
-
</CapLabel>
|
|
1162
|
-
}
|
|
1163
|
-
{mediaPreview && (
|
|
1164
|
-
<CapImage
|
|
1165
|
-
src={
|
|
1166
|
-
device === ANDROID
|
|
1167
|
-
? mediaPreview?.inAppImageSrcAndroid
|
|
1168
|
-
: mediaPreview?.inAppImageSrcIos
|
|
1169
|
-
}
|
|
1170
|
-
className={`inapp-image-${templateLayoutType}-${device}`}
|
|
1171
|
-
alt={formatMessage(messages.previewGenerated)}
|
|
1172
|
-
style={{ width: "100%", height: "100%" }}
|
|
1173
|
-
/>
|
|
1174
|
-
)}
|
|
1175
|
-
{
|
|
1176
|
-
<CapLabel
|
|
1177
|
-
type="label5"
|
|
1178
|
-
className={`align-left inapp-content-${templateLayoutType}-${device} ${
|
|
1179
|
-
mediaPreview?.inAppImageSrcAndroid
|
|
1180
|
-
? ""
|
|
1181
|
-
: `without-image-content-${templateLayoutType}-android`
|
|
1182
|
-
} ${
|
|
1183
|
-
mediaPreview?.inAppImageSrcIos
|
|
1184
|
-
? ""
|
|
1185
|
-
: `without-image-content-${templateLayoutType}-ios`
|
|
1186
|
-
}`}
|
|
1187
|
-
>
|
|
1188
|
-
{templateMsg ? templateMsg : " "}
|
|
1189
|
-
{/* this ternary is required here for preview */}
|
|
1190
|
-
</CapLabel>
|
|
1191
|
-
}
|
|
1192
|
-
{ctaData &&
|
|
1193
|
-
!isEmpty(ctaData) &&
|
|
1194
|
-
ctaData[0]?.text !== "" && (
|
|
1195
|
-
<CapButton
|
|
1196
|
-
type="primary"
|
|
1197
|
-
className={`inapp-button-${templateLayoutType}-${device} ${
|
|
1198
|
-
mediaPreview?.inAppImageSrcAndroid
|
|
1199
|
-
? ""
|
|
1200
|
-
: `without-image-button-${templateLayoutType}-android`
|
|
1201
|
-
} ${
|
|
1202
|
-
mediaPreview?.inAppImageSrcIos
|
|
1203
|
-
? ""
|
|
1204
|
-
: `without-image-button-${templateLayoutType}-ios`
|
|
1205
|
-
}`}
|
|
1206
|
-
>
|
|
1207
|
-
{ctaData[0]?.text}
|
|
1208
|
-
</CapButton>
|
|
1209
|
-
)}
|
|
1210
|
-
</div>
|
|
1211
|
-
</div>
|
|
1212
|
-
</div>
|
|
926
|
+
/>
|
|
1213
927
|
</div>
|
|
1214
|
-
|
|
928
|
+
)}
|
|
1215
929
|
</div>
|
|
930
|
+
|
|
1216
931
|
</CapColumn>
|
|
1217
932
|
</CapRow>
|
|
1218
933
|
);
|