@capillarytech/creatives-library 7.17.186 → 7.17.188

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "7.17.186",
4
+ "version": "7.17.188",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -1012,4 +1012,7 @@
1012
1012
  -webkit-box-orient: vertical;
1013
1013
  overflow: hidden;
1014
1014
  color: $CAP_WHITE;
1015
+ }
1016
+ .viber-image-preview {
1017
+ width: 9.75rem;
1015
1018
  }
@@ -917,6 +917,7 @@ export class TemplatePreview extends React.Component { // eslint-disable-line re
917
917
  {imageURL && (
918
918
  <CapImage
919
919
  src={imageURL}
920
+ className="viber-image-preview"
920
921
  alt="brand-name"
921
922
  rest={{
922
923
  style: {
@@ -144,7 +144,9 @@ export const Viber = (props) => {
144
144
  updateButtonUrl(url);
145
145
  setIsCtaSaved(true);
146
146
  setButtonType(button?.text ? VIBER_BUTTON_TYPES.CTA : NONE);
147
- setCtadata({ buttonText: button?.text, buttonURL: button?.url });
147
+ if (!isEmpty(button)) {
148
+ setCtadata({ buttonText: button?.text, buttonURL: button?.url });
149
+ }
148
150
  if (!isEmpty(image)) {
149
151
  setTemplateMediaType(VIBER_MEDIA_TYPES.IMAGE);
150
152
  updateImageSrc(image?.url);
@@ -543,10 +545,16 @@ export const Viber = (props) => {
543
545
  <CapLabel type="label3">{formatMessage(messages.btnDesc)}</CapLabel>
544
546
  }
545
547
  />
548
+ {templateMediaType === VIBER_MEDIA_TYPES.VIDEO && (
549
+ <CapLabel type="label3">
550
+ {formatMessage(messages.videoButtonDisabled)}
551
+ </CapLabel>
552
+ )}
546
553
  <CapRadioGroup
547
554
  options={buttonRadioOptions}
548
555
  value={buttonType}
549
556
  onChange={onChangeButtonType}
557
+ disabled={templateMediaType === VIBER_MEDIA_TYPES.VIDEO}
550
558
  className="viber-btn-radio-group"
551
559
  />
552
560
  {isBtnTypeCta && ButtonViber}
@@ -571,6 +579,7 @@ export const Viber = (props) => {
571
579
  messageData.video.thumbnailUrl = viberVideoPreviewImg;
572
580
  messageData.video.duration = duration; // integer value in seconds
573
581
  }
582
+
574
583
  if (!isEmpty(ctaData)) {
575
584
  messageData.button = {};
576
585
  messageData.button.text = ctaData?.buttonText;
@@ -190,6 +190,10 @@ export default defineMessages({
190
190
  id: `${scope}.ctaDesc`,
191
191
  defaultMessage: 'Create a button that lets customers respond to your messages or take action',
192
192
  },
193
+ videoButtonDisabled: {
194
+ id: `${scope}.videoButtonDisabled`,
195
+ defaultMessage: 'Not supported for video media type',
196
+ },
193
197
  buttonTextTooltip: {
194
198
  id: `${scope}.buttonTextTooltip`,
195
199
  defaultMessage: 'Use this to name the button. We would recommend not to use special characters here',