@capillarytech/creatives-library 7.13.5 → 7.13.7

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.
@@ -53,9 +53,12 @@ import { GA } from '@capillarytech/cap-ui-utils';
53
53
  import { CREATE, EDIT, TRACK_CREATE_VIBER, TRACK_EDIT_VIBER } from '../App/constants';
54
54
  import { gtmPush } from '../../utils/gtmTrackers';
55
55
  import { VIBER } from '../CreativesContainer/constants';
56
+ import { getCdnUrl } from '../../utils/cdnTransformation';
57
+
56
58
  const { CapHeadingSpan } = CapHeading;
57
59
  const { TextArea } = CapInput;
58
60
 
61
+
59
62
  const Viber = (props) => {
60
63
  const {
61
64
  intl,
@@ -78,7 +81,7 @@ const Viber = (props) => {
78
81
  const { formatMessage } = intl;
79
82
  const [isImageError, updateImageErrorMessage] = useState(false);
80
83
  const [isImage, updateImageStatus] = useState(false);
81
- const [imageSrc, updateImageSrc] = useState();
84
+ const [imageSrc, setImageSrc] = useState();
82
85
  const [isDrawerRequired, updateDrawerRequirement] = useState(false);
83
86
  const [messageContent, updateTextMessageContent] = useState('');
84
87
  const [buttonText, updateButtonText] = useState('');
@@ -92,6 +95,12 @@ const Viber = (props) => {
92
95
  const [buttonURLErrorMessage, updateButtonURLErrorMessage] = useState(false);
93
96
  const [accountName, updateAccountName] = useState("");
94
97
 
98
+
99
+ const updateImageSrc = React.useCallback((url)=>{
100
+ const newUrl = getCdnUrl({url, channelName: 'VIBER'});
101
+ setImageSrc(newUrl);
102
+ },[]);
103
+
95
104
  const StyledHeader = styled(CapHeader)`
96
105
  margin-bottom: 14px;
97
106
  `;
@@ -741,4 +750,4 @@ export default withCreatives({
741
750
  mapStateToProps,
742
751
  mapDispatchToProps,
743
752
  userAuth: true,
744
- });
753
+ });
@@ -32,6 +32,8 @@ import { GA } from '@capillarytech/cap-ui-utils';
32
32
  import { CREATE, EDIT, TRACK_CREATE_WECHAT, TRACK_EDIT_WECHAT } from '../../../App/constants';
33
33
  import { gtmPush } from '../../../../utils/gtmTrackers';
34
34
  import { WECHAT } from '../../../CreativesContainer/constants';
35
+ import { getCdnUrl } from '../../../../utils/cdnTransformation';
36
+
35
37
  export class Create extends React.Component { // eslint-disable-line react/prefer-stateless-function
36
38
  constructor(props) {
37
39
  super(props);
@@ -478,7 +480,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
478
480
  need_open_comment: postCommentsData.need_open_comment,
479
481
  only_fans_can_comment: postCommentsData.only_fans_can_comment,
480
482
  thumb_media_id: contentData.mediaId,
481
- image_url: contentData.imageUrl,
483
+ image_url: getCdnUrl({url: contentData.imageUrl, channelName: 'WECHAT'}),
482
484
  };
483
485
  mediaList.push(filteredContent);
484
486
  });
@@ -74,6 +74,8 @@ import {
74
74
  PHONE_NUMBER,
75
75
  WEBSITE,
76
76
  } from '../../v2Components/CapWhatsappCTA/constants';
77
+ import { getCdnUrl } from '../../utils/cdnTransformation';
78
+
77
79
  let varMap = {};
78
80
  let editContent = {};
79
81
  let tagValidationResponse = {};
@@ -855,7 +857,7 @@ export const Whatsapp = (props) => {
855
857
  }),
856
858
  mediaType: templateMediaType,
857
859
  ...(isMediaTypeImage && {
858
- imageUrl: whatsappImageSrc,
860
+ imageUrl: getCdnUrl({url: whatsappImageSrc, channelName: 'WHATSAPP',}),
859
861
  karixFileHandle,
860
862
  }),
861
863
  varMapped: !isFullMode ? varMap : {},
@@ -1439,4 +1441,4 @@ export default withCreatives({
1439
1441
  mapStateToProps,
1440
1442
  mapDispatchToProps,
1441
1443
  userAuth: true,
1442
- });
1444
+ });