@capillarytech/creatives-library 7.17.91 → 7.17.92

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.
Files changed (50) hide show
  1. package/index.js +6 -0
  2. package/package.json +1 -1
  3. package/routes.js +5 -0
  4. package/services/api.js +5 -0
  5. package/v2Components/CapDeviceContent/index.js +338 -0
  6. package/v2Components/CapDeviceContent/index.scss +115 -0
  7. package/v2Components/CapDeviceContent/messages.js +107 -0
  8. package/v2Components/CapDeviceContent/tests/index.test.js +75 -0
  9. package/v2Components/CapImageUpload/index.js +10 -3
  10. package/v2Components/CapImageUpload/messages.js +4 -0
  11. package/v2Components/CapInAppCTA/constants.js +25 -0
  12. package/v2Components/CapInAppCTA/index.js +281 -0
  13. package/v2Components/CapInAppCTA/index.scss +93 -0
  14. package/v2Components/CapInAppCTA/messages.js +85 -0
  15. package/v2Components/MobilePushPreviewV2/index.js +81 -23
  16. package/v2Components/TemplatePreview/_templatePreview.scss +448 -0
  17. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_bottom.svg +11 -0
  18. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_full.svg +11 -0
  19. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_modal.svg +11 -0
  20. package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_top.svg +11 -0
  21. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_bottom.svg +6 -0
  22. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_full.svg +18 -0
  23. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_modal.svg +7 -0
  24. package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_top.svg +13 -0
  25. package/v2Components/TemplatePreview/index.js +660 -375
  26. package/v2Components/TemplatePreview/messages.js +4 -0
  27. package/v2Containers/App/constants.js +1 -0
  28. package/v2Containers/CreativesContainer/SlideBoxContent.js +43 -0
  29. package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -1
  30. package/v2Containers/CreativesContainer/constants.js +1 -0
  31. package/v2Containers/CreativesContainer/index.js +94 -27
  32. package/v2Containers/CreativesContainer/messages.js +4 -0
  33. package/v2Containers/InApp/actions.js +64 -0
  34. package/v2Containers/InApp/constants.js +95 -0
  35. package/v2Containers/InApp/index.js +745 -0
  36. package/v2Containers/InApp/index.scss +47 -0
  37. package/v2Containers/InApp/messages.js +86 -0
  38. package/v2Containers/InApp/reducer.js +109 -0
  39. package/v2Containers/InApp/sagas.js +143 -0
  40. package/v2Containers/InApp/selectors.js +12 -0
  41. package/v2Containers/InApp/tests/action.test.js +53 -0
  42. package/v2Containers/InApp/tests/index.test.js +152 -0
  43. package/v2Containers/InApp/tests/mockData.js +897 -0
  44. package/v2Containers/InApp/tests/reducer.test.js +177 -0
  45. package/v2Containers/InApp/tests/sagas.test.js +391 -0
  46. package/v2Containers/Templates/_templates.scss +7 -0
  47. package/v2Containers/Templates/index.js +103 -23
  48. package/v2Containers/Templates/messages.js +20 -0
  49. package/v2Containers/TemplatesV2/index.js +8 -2
  50. package/v2Containers/TemplatesV2/messages.js +4 -0
@@ -19,11 +19,20 @@ import {
19
19
  WECHAT,
20
20
  WHATSAPP,
21
21
  RCS,
22
- ZALO
22
+ ZALO,
23
+ INAPP,
23
24
  } from '../../v2Containers/CreativesContainer/constants';
24
25
  import Carousel from '../Carousel';
25
26
  import { VIBER, FACEBOOK } from '../../v2Containers/App/constants';
26
27
  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';
27
36
  import videoPlay from '../../assets/videoPlay.svg';
28
37
  import zaloMessage from '../../v2Containers/Zalo/messages';
29
38
  import { handlePreviewInNewTab } from '../../utils/common';
@@ -49,13 +58,13 @@ import {
49
58
  CAP_PURPLE01,
50
59
  CAP_G16,
51
60
  CAP_SPACE_08,
52
- CAP_SPACE_16,
53
61
  } from '@capillarytech/cap-ui-library/styled/variables';
54
62
  import { TEMPLATE, IMAGE_CAROUSEL, IMAGE, STICKER, TEXT, IMAGE_MAP, VIDEO } from '../../v2Containers/Line/Container/constants';
55
63
  import CapFacebookPreview from '../../v2Containers/CapFacebookPreview';
56
64
  import WhatsappStatusContainer from '../WhatsappStatusContainer';
57
65
  import { getWhatsappQuickReply } from '../../v2Containers/Whatsapp/utils';
58
66
  import { QUICK_REPLY } from '../../v2Containers/Whatsapp/constants';
67
+ import { ANDROID, INAPP_MESSAGE_LAYOUT_TYPES } from '../../v2Containers/InApp/constants';
59
68
 
60
69
  export class TemplatePreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
61
70
  onPreviewContentClicked = (channel) => {
@@ -164,17 +173,20 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
164
173
  viberAccountName,
165
174
  whatsappAccountName,
166
175
  whatsappContentLen,
176
+ inAppAccountName,
167
177
  intl,
168
178
  templateData,
169
179
  rcsIosPreview,
170
180
  hideTestAndPreviewBtn,
171
181
  hasJPLocaleHideFeatureEnabled,
182
+ templateLayoutType,
183
+ device,
172
184
  } = this.props;
173
185
  let content = channel && channel.toLowerCase() === 'sms' ? [this.props.content] : this.props.content;
174
-
175
186
  const { formatMessage } = intl;
176
- const { buttonText, imageURL, rcsPreviewContent, messageContent: viberMessageContent } = content || {};
187
+ const { buttonText, imageURL, rcsPreviewContent, inAppPreviewContent, messageContent: viberMessageContent } = content || {};
177
188
  const { rcsImageSrc, rcsTitle, rcsDesc, buttonText: rcsButtonText } = rcsPreviewContent || {};
189
+ const {mediaPreview = {}, templateTitle = "", templateMsg = "", ctaData} = inAppPreviewContent || {};
178
190
  let smsDetails = {};
179
191
  // let smsText = '';
180
192
  if (this.props.content && this.props.charCounterEnabled) {
@@ -380,183 +392,316 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
380
392
  handlePreviewInNewTab(templatePreviewUrl);
381
393
  };
382
394
 
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
+ };
383
420
  const whatsappUpdatedAccountName = whatsappAccountName || templateData?.versions?.base?.content?.whatsapp?.accountName || '';
384
421
  const whatsappUpdatedLen = whatsappContentLen !== undefined ? whatsappContentLen : content?.charCount;
385
-
386
422
  return (
387
423
  <CapRow>
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>}
424
+ {this.props.showCount &&
425
+ channel &&
426
+ channel.toLowerCase() !== FACEBOOK && (
427
+ <CapColumn span={16}>
428
+ {channel && channel.toLowerCase() === "sms" && (
429
+ <CapHeading type="h3">
430
+ <FormattedMessage
431
+ {...messages.charactersTotal}
432
+ values={{
433
+ smsCount: smsDetails.parts,
434
+ charCount: smsDetails.chars_used,
435
+ }}
436
+ />
437
+ {smsDetails.unicode && (
438
+ <FormattedMessage {...messages.smsFormatType} />
439
+ )}
440
+ </CapHeading>
441
+ )}
442
+ {smsDetails.optoutUrlPresent && (
443
+ <CapHeading type="h6">
444
+ <FormattedMessage
445
+ {...messages.optoutCharactersTotal}
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
+ )}
410
463
  <CapColumn span={this.props.showCount ? 8 : 24}>
411
464
  {showTestAndPreview && (
412
465
  <div className="test-and-preview-container">
413
466
  <CapButton
414
467
  style={{
415
- color: '#2466ea',
416
- display: 'inline-block',
417
- padding: '0 6px',
418
- marginTop: '12px',
468
+ color: "#2466ea",
469
+ display: "inline-block",
470
+ padding: "0 6px",
471
+ marginTop: "12px",
419
472
  }}
420
473
  type="flat"
421
474
  onClick={() => this.onPreviewContentClicked(this.props.channel)}
422
475
  disabled={disablePreviewAndTest}
423
476
  >
424
- <CapIcon type="eye"/><FormattedMessage {...messages.preview} />
477
+ <CapIcon type="eye" />
478
+ <FormattedMessage {...messages.preview} />
425
479
  </CapButton>
426
480
  <CapButton
427
481
  style={{
428
- color: '#2466ea',
429
- display: 'inline-block',
430
- padding: '0 6px',
431
- marginTop: '12px',
482
+ color: "#2466ea",
483
+ display: "inline-block",
484
+ padding: "0 6px",
485
+ marginTop: "12px",
432
486
  }}
433
487
  type="flat"
434
488
  onClick={() => this.onTestContentClicked(this.props.channel)}
435
489
  disabled={disablePreviewAndTest}
436
490
  >
437
- <CapIcon type="lab"/><FormattedMessage {...messages.testMessage} />
491
+ <CapIcon type="lab" />
492
+ <FormattedMessage {...messages.testMessage} />
438
493
  </CapButton>
439
494
  </div>
440
495
  )}
441
- <div className={`preview-container ${type === 'embedded' ? 'embedded-preview' : ''}`}>
442
- { channel && channel.toLowerCase() === 'sms' &&
496
+ <div
497
+ className={`preview-container ${
498
+ type === "embedded" ? "embedded-preview" : ""
499
+ }`}
500
+ >
501
+ {channel && channel.toLowerCase() === "sms" && (
443
502
  <div>
444
503
  <div className="shell-v2 align-center" id="sms-preview">
445
- <CapImage className="preview-image sms" src={smsMobileAndroid} alt="Preview is being generated"/>
504
+ <CapImage
505
+ className="preview-image sms"
506
+ src={smsMobileAndroid}
507
+ alt="Preview is being generated"
508
+ />
446
509
  <div className="msg-container sms">
447
510
  <div className={"message-pop sms"}>
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
- }
511
+ {content &&
512
+ content.length &&
513
+ content.map((msg, index) => (
514
+ <CapColumn
515
+ key={`"message-pop-content-${index}`}
516
+ className="message-pop-item align-left"
517
+ style={{ background: "#FFFFFF", color: "#091e42" }}
518
+ >
519
+ {msg}
520
+ </CapColumn>
521
+ ))}
453
522
  </div>
454
523
  </div>
455
524
  </div>
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>}
525
+ {!this.props.showCount && (
526
+ <div>
527
+ <CapColumn className="character-count-col" span={22}>
528
+ {(channel || "").toLowerCase() === "sms" && (
529
+ <CapHeading type="h3">
530
+ <FormattedMessage
531
+ {...messages.charactersTotal}
532
+ values={{
533
+ smsCount: smsDetails.parts,
534
+ charCount: smsDetails.chars_used,
535
+ }}
536
+ />
537
+ {smsDetails.unicode && (
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
+ )}
469
555
  </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}
556
+ )}
557
+ {channel && channel.toLowerCase() === "wechat" ? (
558
+ <div className="shell-v2 align-center" id="sms-preview">
559
+ <CapImage
560
+ className="preview-image"
561
+ src={
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>
476
586
  </div>
477
587
  </div>
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"}
490
- </div>
491
- <div className="title">
492
- {content.header}
493
- </div>
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}
588
+ ) : (
589
+ ""
590
+ )}
591
+ {channel && channel.toLowerCase() === "mobilepush" && (
592
+ <div className="shell-v2 align-center" id="mobilepush-preview">
593
+ <CapImage
594
+ className="preview-image"
595
+ src={
596
+ this.props.device === "android"
597
+ ? androidPushMessagePhone
598
+ : iPhonePushMessagePhone
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
+ )}
517
642
  </div>
518
- <div className="body-text">
519
- {content.bodyText}
643
+ ) : (
644
+ <div className="message-pop align-left">
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
+ : ""}
520
662
  </div>
521
- {content.actions.filter((action) => action.label).length ? iosActions : ''}
522
- </div>
663
+ )}
664
+ </div>
665
+ )}
666
+ </div>
667
+ )}
668
+ {channel && channel.toLowerCase() === "line" ? (
669
+ <div className="shell-v2 align-center" id="sms-preview">
670
+ <CapImage
671
+ className="preview-image"
672
+ src={
673
+ hasJPLocaleHideFeatureEnabled
674
+ ? lineMobileAndroidJapaneseImg
675
+ : lineMobileAndroidDefaultImg
523
676
  }
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
- >
677
+ alt={this.props.intl.formatMessage(messages.previewGenerated)}
678
+ />
543
679
  <div
544
- className="sms-icon"
680
+ className="msg-container line-preview"
545
681
  style={{
546
- left: 0,
547
- top: 8,
548
- borderRadius: '50%',
549
- width: 20,
550
- height: 20,
551
- background: CAP_COLOR_03,
552
- paddingRight: 5,
682
+ maxHeight: 330,
683
+ overflow: "auto",
684
+ flexDirection: "column",
685
+ marginLeft: 40,
686
+ left: !this.props.showCount && "200px",
553
687
  }}
554
688
  >
555
- {this.props.LineAccountName}
556
- </div>
557
- <>
558
- {
559
- content.map((item) => {
689
+ <div
690
+ className="sms-icon"
691
+ style={{
692
+ left: 0,
693
+ top: 8,
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) => {
560
705
  const {
561
706
  type,
562
707
  messageContent,
@@ -573,12 +718,12 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
573
718
  background: CAP_WHITE,
574
719
  color: FONT_COLOR_01,
575
720
  borderRadius: 8,
576
- position: 'static',
577
- margin: '6px 0 20px 28px',
578
- height: 'auto',
579
- minHeight: 'auto',
580
- overflow: 'initial',
581
- maxHeight: 'initial',
721
+ position: "static",
722
+ margin: "6px 0 20px 28px",
723
+ height: "auto",
724
+ minHeight: "auto",
725
+ overflow: "initial",
726
+ maxHeight: "initial",
582
727
  };
583
728
  if (type === TEXT) {
584
729
  return (
@@ -586,20 +731,22 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
586
731
  className="message-pop align-left"
587
732
  style={sectionStyle}
588
733
  >
589
- <p style={{ marginBottom: 5 }}>{messageContent || ''}</p>
734
+ <p style={{ marginBottom: 5 }}>
735
+ {messageContent || ""}
736
+ </p>
590
737
  </div>
591
738
  );
592
739
  }
593
- if ((type === IMAGE && previewImageUrl)) {
740
+ if (type === IMAGE && previewImageUrl) {
594
741
  return (
595
742
  <div
596
743
  className="message-pop align-left"
597
744
  style={{
598
745
  ...sectionStyle,
599
746
  minHeight: 184,
600
- display: 'flex',
601
- justifyContent: 'center',
602
- alignItems: 'center',
747
+ display: "flex",
748
+ justifyContent: "center",
749
+ alignItems: "center",
603
750
  }}
604
751
  >
605
752
  <CapImage
@@ -607,7 +754,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
607
754
  alt="brand-name"
608
755
  rest={{
609
756
  style: {
610
- maxWidth: '100%',
757
+ maxWidth: "100%",
611
758
  marginBottom: 5,
612
759
  },
613
760
  }}
@@ -616,11 +763,19 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
616
763
  );
617
764
  }
618
765
  if (type === VIDEO) {
619
- return getVideoContent({ video, actionUrl, sectionStyle });
766
+ return getVideoContent({
767
+ video,
768
+ actionUrl,
769
+ sectionStyle,
770
+ });
620
771
  }
621
- if ((type === IMAGE_MAP && baseUrl)) {
772
+ if (type === IMAGE_MAP && baseUrl) {
622
773
  if (video) {
623
- return getVideoContent({ video, actionUrl, sectionStyle });
774
+ return getVideoContent({
775
+ video,
776
+ actionUrl,
777
+ sectionStyle,
778
+ });
624
779
  }
625
780
  return (
626
781
  <div
@@ -628,17 +783,19 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
628
783
  style={{
629
784
  ...sectionStyle,
630
785
  minHeight: 184,
631
- display: 'flex',
632
- justifyContent: 'center',
633
- alignItems: 'center',
786
+ display: "flex",
787
+ justifyContent: "center",
788
+ alignItems: "center",
634
789
  }}
635
790
  >
636
791
  <CapImage
637
- src={baseUrl ? `${baseUrl}/1040` : lineImgPlaceholder}
792
+ src={
793
+ baseUrl ? `${baseUrl}/1040` : lineImgPlaceholder
794
+ }
638
795
  alt="brand-name"
639
796
  rest={{
640
797
  style: {
641
- maxWidth: '100%',
798
+ maxWidth: "100%",
642
799
  marginBottom: 5,
643
800
  },
644
801
  }}
@@ -652,265 +809,311 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
652
809
  className="message-pop align-left"
653
810
  style={{
654
811
  ...sectionStyle,
655
- background: 'transparent',
656
- display: 'flex',
657
- justifyContent: 'center',
658
- alignItems: 'center',
812
+ background: "transparent",
813
+ display: "flex",
814
+ justifyContent: "center",
815
+ alignItems: "center",
659
816
  }}
660
817
  >
661
818
  <CapImage
662
819
  src={selectedSticker.stickerUrl}
663
- style={{maxWidth: '100%', marginBottom: 5 }}
820
+ style={{ maxWidth: "100%", marginBottom: 5 }}
664
821
  rest={{
665
822
  style: {
666
- maxWidth: '100%',
823
+ maxWidth: "100%",
667
824
  marginBottom: 5,
668
825
  },
669
826
  height: 70,
670
- onMouseOut: (e) => (e.currentTarget.src = selectedSticker.stickerUrl),
671
- onMouseOver: (e) => (e.currentTarget.src = selectedSticker.animatedStickerUrl || selectedSticker.stickerUrl),
827
+ onMouseOut: (e) =>
828
+ (e.currentTarget.src =
829
+ selectedSticker.stickerUrl),
830
+ onMouseOver: (e) =>
831
+ (e.currentTarget.src =
832
+ selectedSticker.animatedStickerUrl ||
833
+ selectedSticker.stickerUrl),
672
834
  }}
673
835
  />
674
836
  </div>
675
837
  );
676
838
  }
677
- if ((type === IMAGE_CAROUSEL || type === TEMPLATE || type === 'template') && imageCarousel) {
839
+ if (
840
+ (type === IMAGE_CAROUSEL ||
841
+ type === TEMPLATE ||
842
+ type === "template") &&
843
+ imageCarousel
844
+ ) {
678
845
  return (
679
846
  <div
680
847
  style={{
681
- margin: '6px 0 20px 28px',
848
+ margin: "6px 0 20px 28px",
682
849
  }}
683
850
  >
684
- <Carousel imageCarousel={imageCarousel}/>
851
+ <Carousel imageCarousel={imageCarousel} />
685
852
  </div>
686
853
  );
687
854
  }
688
855
  return null;
689
- })
690
- }
691
- </>
856
+ })}
857
+ </>
858
+ </div>
859
+ {renderLineMultiText(content)}
692
860
  </div>
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
- >
861
+ ) : (
862
+ ""
863
+ )}
864
+ {channel && channel.toLowerCase() === VIBER ? (
865
+ <div className="shell-v2 align-center" id="sms-preview">
866
+ <CapImage
867
+ className="preview-image"
868
+ src={viberMobileAndroid}
869
+ alt={this.props.intl.formatMessage(messages.previewGenerated)}
870
+ />
871
+ <div style={{ position: "absolute", top: "12%", left: "36%" }}>
872
+ {viberBrandName}
873
+ </div>
709
874
  <div
710
- className="sms-icon"
875
+ className="msg-container viber-preview"
711
876
  style={{
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,
877
+ maxHeight: 292,
878
+ marginLeft: 28,
720
879
  }}
721
880
  >
722
- {viberAccountName}
723
- </div>
724
- <div
725
- className="message-pop align-left"
726
- style={viberSectionStyle}>
727
- {/* Text Viber preview */}
728
- <p
881
+ <div
882
+ className="sms-icon"
729
883
  style={{
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
- },
884
+ width: 20,
885
+ height: 20,
886
+ margin: "0 4px 277px 0",
887
+ "border-radius": "4px",
888
+ "background-color": CAP_PURPLE01,
889
+ "font-size": "12px",
890
+ "font-weight": 900,
891
+ color: CAP_WHITE,
744
892
  }}
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
- }}>
893
+ >
894
+ {viberAccountName}
895
+ </div>
896
+ <div
897
+ className="message-pop align-left"
898
+ style={viberSectionStyle}
899
+ >
900
+ {/* Text Viber preview */}
758
901
  <p
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 }}
902
+ style={{
903
+ "font-size": "10px",
904
+ color: CAP_G16,
905
+ margin: "1.5px 6px 1px 7px",
906
+ }}
907
+ >
908
+ {viberMessageContent || ""}
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
+ }}
766
935
  >
767
- {buttonText || ''}</p>
936
+ <p
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>
768
952
  </div>
769
- }
770
- <div style={{ paddingBottom: 32}}></div>
771
953
  </div>
772
-
773
954
  </div>
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">
955
+ ) : (
956
+ ""
957
+ )}
958
+ {channel?.toUpperCase() === WHATSAPP ? (
959
+ <>
960
+ <div className="shell-v2 align-center">
961
+ <CapImage
962
+ className="preview-image"
963
+ src={whatsappMobileAndroid}
964
+ alt={formatMessage(messages.previewGenerated)}
965
+ />
966
+ <CapLabel className="whatsapp-brand-name">
967
+ {whatsappUpdatedAccountName || ""}
968
+ </CapLabel>
969
+ <div className="msg-container whatsapp-message-container">
970
+ <div
971
+ className="message-pop align-left"
972
+ style={whatsappSectionStyle}
973
+ >
974
+ <div className="whatsapp-content">
975
+ {content?.showUrlPreview &&
976
+ renderUrlPreview(content?.metaTagsDetails)}
977
+ {content?.whatsappImageSrc && (
978
+ <CapImage
979
+ src={content.whatsappImageSrc}
980
+ className="whatsapp-image"
981
+ alt={formatMessage(messages.previewGenerated)}
982
+ />
983
+ )}
984
+ {content?.whatsappVideoPreviewImg && (
985
+ <CapTooltip
986
+ title={formatMessage(messages.videoPreviewTooltip)}
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">
807
995
  <CapImage
808
- src={content.whatsappVideoPreviewImg}
809
- className="whatsapp-image"
810
- alt={formatMessage(messages.previewGenerated)}
996
+ className="video-icon"
997
+ src={videoPlay}
811
998
  />
812
- <div className="icon-position">
813
- <CapImage className="video-icon" src={videoPlay} />
814
- </div>
815
999
  </div>
816
- </CapTooltip>
817
- )}
818
- {content?.docPreview && (
819
- <div className="whatsapp-image">
820
- {content?.docPreview}
821
1000
  </div>
822
- )}
823
- {content?.templateHeaderPreview || ''}
824
- {content?.templateMsg || ''}
825
- {content?.templateFooterPreview || ''}
826
- {renderWhatsappCtaPreview()}
827
- {renderQuickReplyPreview()}
828
- </div>
1001
+ </CapTooltip>
1002
+ )}
1003
+ {content?.docPreview && (
1004
+ <div className="whatsapp-image">
1005
+ {content?.docPreview}
1006
+ </div>
1007
+ )}
1008
+ {content?.templateHeaderPreview || ""}
1009
+ {content?.templateMsg || ""}
1010
+ {content?.templateFooterPreview || ""}
1011
+ {renderWhatsappCtaPreview()}
1012
+ {renderQuickReplyPreview()}
829
1013
  </div>
830
1014
  </div>
831
1015
  </div>
832
- <CapHeading
833
- type="h3"
834
- style={{ textAlign: 'center' }}
835
- className="margin-t-16"
1016
+ </div>
1017
+ <CapHeading
1018
+ type="h3"
1019
+ style={{ textAlign: "center" }}
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"
836
1054
  >
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>
1055
+ {formatMessage(zaloMessage.openPreview)}{" "}
1056
+ <CapIcon type="open-in-new-light"></CapIcon>
1057
+ </CapLabel>
870
1058
  </CapRow>
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)}
1059
+ </CapRow>
1060
+ )}
1061
+ {channel?.toUpperCase() === RCS && (
1062
+ <div className="shell-v2 align-center">
1063
+ <CapImage
1064
+ className="preview-image"
1065
+ src={rcsIosPreview ? smsMobileIos : smsMobileAndroid}
1066
+ alt={formatMessage(messages.previewGenerated)}
1067
+ />
1068
+ <div className="msg-container sms">
1069
+ <div className="message-pop sms">
1070
+ {rcsImageSrc && (
1071
+ <CapImage
1072
+ src={rcsImageSrc}
1073
+ className="rcs-image"
1074
+ alt={formatMessage(messages.previewGenerated)}
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" } }}
888
1104
  />
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>
1105
+ {rcsButtonText}
1106
+ </CapLabel>
1107
+ )}
908
1108
  </div>
909
1109
  </div>
910
- )
911
- }
1110
+ </div>
1111
+ )}
912
1112
  {channel && channel.toLowerCase() === FACEBOOK && (
913
- <div style={{position: 'absolute', left: '80%'}} id="facebook-preview">
1113
+ <div
1114
+ style={{ position: "absolute", left: "80%" }}
1115
+ id="facebook-preview"
1116
+ >
914
1117
  <CapFacebookPreview
915
1118
  disablePreviewButton={false}
916
1119
  selectedAd={content.selectedAd}
@@ -918,16 +1121,98 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
918
1121
  primaryText={content.primaryText}
919
1122
  callToAction={content.callToAction}
920
1123
  displayLink={content.displayLink}
921
- orgUnitFacebookPageSettingsMap={{pageAccessToken: content.pageAccessToken,
922
- pageId: content.pageId}}
1124
+ orgUnitFacebookPageSettingsMap={{
1125
+ pageAccessToken: content.pageAccessToken,
1126
+ pageId: content.pageId,
1127
+ }}
923
1128
  accountId={content.accountId}
924
1129
  accessToken={content.accessToken}
925
1130
  defaultGeneratePreview
926
- />
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>
927
1213
  </div>
928
- )}
1214
+ )}
929
1215
  </div>
930
-
931
1216
  </CapColumn>
932
1217
  </CapRow>
933
1218
  );