@capillarytech/creatives-library 7.12.79 → 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
|
@@ -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,
|
|
@@ -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,
|
|
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
|
`;
|