@capillarytech/creatives-library 7.12.78 → 7.12.80

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.12.78",
4
+ "version": "7.12.80",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -7,7 +7,7 @@ import isEmpty from 'lodash/isEmpty';
7
7
  import { connect } from "react-redux";
8
8
  import { createStructuredSelector } from "reselect";
9
9
  import { selectCurrentOrgDetails } from "../../Cap/selectors";
10
-
10
+ import { getCdnUrl } from '../../../utils/cdnTransformation';
11
11
  import {
12
12
  CapInput,
13
13
  CapRadioCard,
@@ -197,7 +197,7 @@ export const Advertisement = (props) => {
197
197
  };
198
198
  if (obj.subType === IMAGE) {
199
199
  data.imageData = {
200
- imageSrc: obj.imgSrc,
200
+ imageSrc: getCdnUrl({url: obj.imgSrc}),
201
201
  };
202
202
  }
203
203
  if (obj.subType === VIDEO) {
@@ -336,7 +336,7 @@ export const Advertisement = (props) => {
336
336
  };
337
337
  }
338
338
  if (obj.subType === IMAGE) {
339
- data.imgSrc = obj.imageData.imageSrc;
339
+ data.imgSrc = getCdnUrl({url: obj.imageData.imageSrc});
340
340
  } else {
341
341
  const {
342
342
  videoSrc,
@@ -15,6 +15,7 @@ import LineDrawer from '../Drawer';
15
15
  import style from './style';
16
16
  import { CAP_G06, FONT_COLOR_01, FONT_COLOR_02, CAP_SPACE_08, CAP_WHITE, CAP_SPACE_24, CAP_SPACE_04 } from '@capillarytech/cap-ui-library/styled/variables';
17
17
  import withStyles from '../../../../hoc/withStyles';
18
+ import { getCdnUrl } from '../../../../utils/cdnTransformation';
18
19
 
19
20
  import LineImageCarouselContent from './Content';
20
21
 
@@ -39,6 +39,7 @@ import {
39
39
  } from '../constants';
40
40
 
41
41
  const { CapIconAvatar } = CapIcon;
42
+ import { getCdnUrl } from '../../../../utils/cdnTransformation';
42
43
 
43
44
  export const LineImageMap = ({
44
45
  className,
@@ -27,7 +27,7 @@ import {
27
27
  MAX_ACTION_LABEL_LENGTH,
28
28
  } from './constants';
29
29
 
30
- import {getCdnUrl} from '../../../../utils/cdnTransformation';
30
+ import { getCdnUrl } from '../../../../utils/cdnTransformation';
31
31
 
32
32
  export const LineVideo = ({
33
33
  className,
@@ -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});
101
+ setImageSrc(newUrl);
102
+ },[]);
103
+
95
104
  const StyledHeader = styled(CapHeader)`
96
105
  margin-bottom: 14px;
97
106
  `;