@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.
- package/index.js +6 -0
- package/package.json +1 -1
- package/routes.js +5 -0
- package/services/api.js +5 -0
- package/v2Components/CapDeviceContent/index.js +338 -0
- package/v2Components/CapDeviceContent/index.scss +115 -0
- package/v2Components/CapDeviceContent/messages.js +107 -0
- package/v2Components/CapDeviceContent/tests/index.test.js +75 -0
- package/v2Components/CapImageUpload/index.js +10 -3
- package/v2Components/CapImageUpload/messages.js +4 -0
- package/v2Components/CapInAppCTA/constants.js +25 -0
- package/v2Components/CapInAppCTA/index.js +281 -0
- package/v2Components/CapInAppCTA/index.scss +93 -0
- package/v2Components/CapInAppCTA/messages.js +85 -0
- package/v2Components/MobilePushPreviewV2/index.js +81 -23
- package/v2Components/TemplatePreview/_templatePreview.scss +448 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_bottom.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_full.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_modal.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_android_top.svg +11 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_bottom.svg +6 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_full.svg +18 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_modal.svg +7 -0
- package/v2Components/TemplatePreview/assets/images/inapp_mobile_ios_top.svg +13 -0
- package/v2Components/TemplatePreview/index.js +660 -375
- package/v2Components/TemplatePreview/messages.js +4 -0
- package/v2Containers/App/constants.js +1 -0
- package/v2Containers/CreativesContainer/SlideBoxContent.js +43 -0
- package/v2Containers/CreativesContainer/SlideBoxHeader.js +4 -1
- package/v2Containers/CreativesContainer/constants.js +1 -0
- package/v2Containers/CreativesContainer/index.js +94 -27
- package/v2Containers/CreativesContainer/messages.js +4 -0
- package/v2Containers/InApp/actions.js +64 -0
- package/v2Containers/InApp/constants.js +95 -0
- package/v2Containers/InApp/index.js +745 -0
- package/v2Containers/InApp/index.scss +47 -0
- package/v2Containers/InApp/messages.js +86 -0
- package/v2Containers/InApp/reducer.js +109 -0
- package/v2Containers/InApp/sagas.js +143 -0
- package/v2Containers/InApp/selectors.js +12 -0
- package/v2Containers/InApp/tests/action.test.js +53 -0
- package/v2Containers/InApp/tests/index.test.js +152 -0
- package/v2Containers/InApp/tests/mockData.js +897 -0
- package/v2Containers/InApp/tests/reducer.test.js +177 -0
- package/v2Containers/InApp/tests/sagas.test.js +391 -0
- package/v2Containers/Templates/_templates.scss +7 -0
- package/v2Containers/Templates/index.js +103 -23
- package/v2Containers/Templates/messages.js +20 -0
- package/v2Containers/TemplatesV2/index.js +8 -2
- package/v2Containers/TemplatesV2/messages.js +4 -0
package/index.js
CHANGED
|
@@ -95,6 +95,10 @@ import Zalo from './v2Containers/Zalo';
|
|
|
95
95
|
import zaloReducer from './v2Containers/Zalo/reducer';
|
|
96
96
|
import zaloSaga from './v2Containers/Zalo/saga';
|
|
97
97
|
|
|
98
|
+
import InApp from './v2Containers/InApp';
|
|
99
|
+
import inAppReducer from './v2Containers/InApp/reducer';
|
|
100
|
+
import inAppSaga from './v2Containers/InApp/sagas';
|
|
101
|
+
|
|
98
102
|
import Rcs from './v2Containers/Rcs';
|
|
99
103
|
import rcsReducer from './v2Containers/Rcs/reducer';
|
|
100
104
|
import rcsSaga from './v2Containers/Rcs/sagas';
|
|
@@ -126,6 +130,7 @@ const SmsTraiContainer = {SmsTraiCreate, SmsTraiCreateReducer, SmsTraiCreateSaga
|
|
|
126
130
|
const WhatsappContainer = { Whatsapp, whatsappReducer, whatsappSaga };
|
|
127
131
|
const RcsContainer = { Rcs, rcsReducer, rcsSaga };
|
|
128
132
|
const ZaloContainer = { Zalo, zaloReducer, zaloSaga };
|
|
133
|
+
const InAppContainer = { InApp, inAppReducer, inAppSaga };
|
|
129
134
|
|
|
130
135
|
const GalleryContainer = {Gallery, galleryReducer, gallerySagas};
|
|
131
136
|
const FTPContainer = {FTP, FTPReducer, FTPSagas};
|
|
@@ -175,4 +180,5 @@ export { CapContainer,
|
|
|
175
180
|
WhatsappContainer,
|
|
176
181
|
RcsContainer,
|
|
177
182
|
ZaloContainer,
|
|
183
|
+
InAppContainer,
|
|
178
184
|
};
|
package/package.json
CHANGED
package/routes.js
CHANGED
|
@@ -665,6 +665,8 @@ export default function createRoutes(store) {
|
|
|
665
665
|
import('v2Containers/Whatsapp/reducer'),
|
|
666
666
|
import('v2Containers/Zalo/saga'),
|
|
667
667
|
import('v2Containers/Zalo/reducer'),
|
|
668
|
+
import('v2Containers/InApp/sagas'),
|
|
669
|
+
import('v2Containers/InApp/reducer'),
|
|
668
670
|
import('v2Containers/Rcs/sagas'),
|
|
669
671
|
import('v2Containers/Rcs/reducer'),
|
|
670
672
|
]);
|
|
@@ -692,6 +694,7 @@ export default function createRoutes(store) {
|
|
|
692
694
|
smsTraiSagas, smsTraiReducer,
|
|
693
695
|
whatsappSagas, whatsappReducer,
|
|
694
696
|
zaloSagas, zaloReducer,
|
|
697
|
+
inAppSagas, inAppReducer,
|
|
695
698
|
rcsSagas, rcsReducer,
|
|
696
699
|
]) => {
|
|
697
700
|
injectReducer('templates', reducer.default);
|
|
@@ -714,6 +717,7 @@ export default function createRoutes(store) {
|
|
|
714
717
|
injectReducer('smsTrai', smsTraiReducer.default);
|
|
715
718
|
injectReducer('whatsapp', whatsappReducer.default);
|
|
716
719
|
injectReducer('zalo', zaloReducer.default);
|
|
720
|
+
injectReducer('inapp', inAppReducer.default);
|
|
717
721
|
injectReducer('rcs', rcsReducer.default);
|
|
718
722
|
injectSagas(gallerySagas.default);
|
|
719
723
|
injectSagas(sagas.default);
|
|
@@ -735,6 +739,7 @@ export default function createRoutes(store) {
|
|
|
735
739
|
injectSagas(smsTraiSagas.default);
|
|
736
740
|
injectSagas(whatsappSagas.default);
|
|
737
741
|
injectSagas(zaloSagas.default);
|
|
742
|
+
injectSagas(inAppSagas.default);
|
|
738
743
|
injectSagas(rcsSagas.default);
|
|
739
744
|
renderRoute(component);
|
|
740
745
|
});
|
package/services/api.js
CHANGED
|
@@ -237,6 +237,11 @@ export const createMobilePushTemplate = ({template}) => {
|
|
|
237
237
|
return request(url, getAPICallObject('POST', template));
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
+
export const createInAppTemplate = ({payload}) => {
|
|
241
|
+
const url = `${API_ENDPOINT}/templates/INAPP`;
|
|
242
|
+
return request(url, getAPICallObject('POST', payload));
|
|
243
|
+
};
|
|
244
|
+
|
|
240
245
|
export const duplicateTemplate = ({id, channel}) => {
|
|
241
246
|
const url = `${API_ENDPOINT}/templates/duplicate/${id}/${channel}`;
|
|
242
247
|
return request(url, getAPICallObject('GET'));
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import React, { useCallback } from "react";
|
|
2
|
+
import PropTypes from "prop-types";
|
|
3
|
+
import { injectIntl, intlShape } from "react-intl";
|
|
4
|
+
import cloneDeep from "lodash/cloneDeep";
|
|
5
|
+
import isEmpty from "lodash/isEmpty";
|
|
6
|
+
import CapHeading from "@capillarytech/cap-ui-library/CapHeading";
|
|
7
|
+
import CapHeader from "@capillarytech/cap-ui-library/CapHeader";
|
|
8
|
+
import CapInput from "@capillarytech/cap-ui-library/CapInput";
|
|
9
|
+
import CapRadioGroup from "@capillarytech/cap-ui-library/CapRadioGroup";
|
|
10
|
+
import CapRow from "@capillarytech/cap-ui-library/CapRow";
|
|
11
|
+
import CapLabel from "@capillarytech/cap-ui-library/CapLabel";
|
|
12
|
+
import CapLink from "@capillarytech/cap-ui-library/CapLink";
|
|
13
|
+
import CapError from "@capillarytech/cap-ui-library/CapError";
|
|
14
|
+
import CapCheckbox from "@capillarytech/cap-ui-library/CapCheckbox";
|
|
15
|
+
import CapSelect from "@capillarytech/cap-ui-library/CapSelect";
|
|
16
|
+
import TagList from "../../v2Containers/TagList";
|
|
17
|
+
import messages from "./messages";
|
|
18
|
+
import {
|
|
19
|
+
ANDROID,
|
|
20
|
+
INAPP_MEDIA_TYPES,
|
|
21
|
+
INAPP_BUTTON_TYPES,
|
|
22
|
+
ALLOWED_IMAGE_EXTENSIONS_REGEX,
|
|
23
|
+
INAPP_IMG_SIZE,
|
|
24
|
+
INITIAL_CTA_DATA,
|
|
25
|
+
MEDIA_RADIO_OPTIONS,
|
|
26
|
+
} from "../../v2Containers/InApp/constants";
|
|
27
|
+
import { INAPP } from "../../v2Containers/CreativesContainer/constants";
|
|
28
|
+
import CapImageUpload from "../CapImageUpload";
|
|
29
|
+
import CapInAppCTA from "../CapInAppCTA";
|
|
30
|
+
import './index.scss';
|
|
31
|
+
|
|
32
|
+
const CapDeviceContent = (props) => {
|
|
33
|
+
const {
|
|
34
|
+
intl,
|
|
35
|
+
location,
|
|
36
|
+
injectedTags,
|
|
37
|
+
selectedOfferDetails,
|
|
38
|
+
panes,
|
|
39
|
+
actions,
|
|
40
|
+
editData,
|
|
41
|
+
isFullMode,
|
|
42
|
+
inAppImageSrc,
|
|
43
|
+
setInAppImageSrc,
|
|
44
|
+
isEditFlow,
|
|
45
|
+
ctaData,
|
|
46
|
+
setCtaData,
|
|
47
|
+
buttonType,
|
|
48
|
+
setButtonType,
|
|
49
|
+
templateMediaType,
|
|
50
|
+
setTemplateMediaType,
|
|
51
|
+
title,
|
|
52
|
+
setTitle,
|
|
53
|
+
templateMessageError,
|
|
54
|
+
templateMessage,
|
|
55
|
+
setTemplateMessage,
|
|
56
|
+
setTemplateMessageError,
|
|
57
|
+
addActionLink,
|
|
58
|
+
setAddActionLink,
|
|
59
|
+
deepLink,
|
|
60
|
+
deepLinkValue,
|
|
61
|
+
setDeepLinkValue,
|
|
62
|
+
onCopyTitleAndContent,
|
|
63
|
+
tags,
|
|
64
|
+
onTagSelect,
|
|
65
|
+
handleOnTagsContextChange,
|
|
66
|
+
} = props || {};
|
|
67
|
+
const { TextArea } = CapInput;
|
|
68
|
+
const { formatMessage } = intl;
|
|
69
|
+
|
|
70
|
+
const isAndroid = panes === ANDROID;
|
|
71
|
+
const isMediaTypeImage = INAPP_MEDIA_TYPES.IMAGE === templateMediaType;
|
|
72
|
+
const isBtnTypeCta = buttonType === INAPP_BUTTON_TYPES.CTA;
|
|
73
|
+
const onTemplateMessageChange = ({ target: { value } }) => {
|
|
74
|
+
let error = '';
|
|
75
|
+
if (value === '') {
|
|
76
|
+
error = formatMessage(messages.emptyTemplateMessageErrorMessage);
|
|
77
|
+
}
|
|
78
|
+
setTemplateMessage(value);
|
|
79
|
+
setTemplateMessageError(error);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const setUpdateInAppImageSrc = useCallback(
|
|
83
|
+
(filePath) => {
|
|
84
|
+
const templateType = 0;
|
|
85
|
+
setInAppImageSrc(filePath);
|
|
86
|
+
actions.clearInAppAsset(templateType);
|
|
87
|
+
},
|
|
88
|
+
[inAppImageSrc]
|
|
89
|
+
);
|
|
90
|
+
const updateOnInAppImageReUpload = useCallback(() => {
|
|
91
|
+
setInAppImageSrc("");
|
|
92
|
+
}, [inAppImageSrc]);
|
|
93
|
+
|
|
94
|
+
const updateHandler = (ctaDataParam, index) => {
|
|
95
|
+
setCtaData((prevState) => {
|
|
96
|
+
const clonedCta = cloneDeep(prevState);
|
|
97
|
+
clonedCta[index] = ctaDataParam;
|
|
98
|
+
return clonedCta;
|
|
99
|
+
});
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// function to delete CTA button
|
|
103
|
+
const deleteHandler = (index) => {
|
|
104
|
+
setCtaData((prevState) => {
|
|
105
|
+
const clonedCta = cloneDeep(prevState);
|
|
106
|
+
const filteredCta = clonedCta.filter((cta) => cta.index !== index);
|
|
107
|
+
if (filteredCta.length === 1) {
|
|
108
|
+
// updates the index of the cta buttons present in case there's a cta button deleted
|
|
109
|
+
filteredCta[0].index = 0;
|
|
110
|
+
}
|
|
111
|
+
if (isEmpty(filteredCta)) {
|
|
112
|
+
onChangeButtonType({target: { value: INAPP_BUTTON_TYPES.NONE } });
|
|
113
|
+
}
|
|
114
|
+
return filteredCta;
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
const buttonRadioOptions = [
|
|
119
|
+
{
|
|
120
|
+
value: INAPP_BUTTON_TYPES.NONE,
|
|
121
|
+
label: (
|
|
122
|
+
<CapHeading
|
|
123
|
+
type="h4"
|
|
124
|
+
className="inapp-button-none"
|
|
125
|
+
>
|
|
126
|
+
{formatMessage(messages.btnTypeNone)}
|
|
127
|
+
</CapHeading>
|
|
128
|
+
),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
value: INAPP_BUTTON_TYPES.CTA,
|
|
132
|
+
label: (
|
|
133
|
+
<>
|
|
134
|
+
<div
|
|
135
|
+
className="inapp-button-cta"
|
|
136
|
+
>
|
|
137
|
+
<CapHeading type="h4">
|
|
138
|
+
{formatMessage(messages.btnTypeCTA)}
|
|
139
|
+
</CapHeading>
|
|
140
|
+
<CapLabel>{formatMessage(messages.ctaDesc)}</CapLabel>
|
|
141
|
+
</div>
|
|
142
|
+
</>
|
|
143
|
+
),
|
|
144
|
+
},
|
|
145
|
+
];
|
|
146
|
+
|
|
147
|
+
const onTitleChange = ({ target: { value } }) => {
|
|
148
|
+
setTitle(value);
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
const onTemplateMediaTypeChange = ({ target: { value } }) => {
|
|
152
|
+
setTemplateMediaType(value);
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const onChangeButtonType = ({ target: { value } }) => {
|
|
156
|
+
setButtonType(value);
|
|
157
|
+
setCtaData(INITIAL_CTA_DATA);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const uploadInAppAsset = (file, type, fileParams) => {
|
|
161
|
+
actions.uploadInAppAsset(file, type, fileParams, 0);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
const getTagList = (index) => (
|
|
165
|
+
<TagList
|
|
166
|
+
moduleFilterEnabled={
|
|
167
|
+
location && location?.query && location?.query?.type !== "embedded"
|
|
168
|
+
}
|
|
169
|
+
label={formatMessage(messages.addLabel)}
|
|
170
|
+
onTagSelect={(value) => onTagSelect(value, index)}
|
|
171
|
+
onContextChange={handleOnTagsContextChange}
|
|
172
|
+
location={location}
|
|
173
|
+
tags={tags || []}
|
|
174
|
+
injectedTags={injectedTags || {}}
|
|
175
|
+
selectedOfferDetails={selectedOfferDetails}
|
|
176
|
+
/>
|
|
177
|
+
);
|
|
178
|
+
|
|
179
|
+
return (
|
|
180
|
+
<>
|
|
181
|
+
<div className="creatives-device-content">
|
|
182
|
+
<CapLink
|
|
183
|
+
title={isAndroid
|
|
184
|
+
? formatMessage(messages.copyContentFromIOS)
|
|
185
|
+
: formatMessage(messages.copyCotentFromAndroid)}
|
|
186
|
+
className="inapp-copy-content"
|
|
187
|
+
onClick={onCopyTitleAndContent}
|
|
188
|
+
/>
|
|
189
|
+
<div className="creatives-inapp-title">
|
|
190
|
+
<div
|
|
191
|
+
className="inapp-content-main"
|
|
192
|
+
>
|
|
193
|
+
<CapHeading type="h5" className="inapp-title">
|
|
194
|
+
{formatMessage(messages.title)}
|
|
195
|
+
</CapHeading>
|
|
196
|
+
{getTagList(0)} {/* here 0 signifies the tags for template title */}
|
|
197
|
+
</div>
|
|
198
|
+
<CapInput
|
|
199
|
+
id="inapp-title-name-input"
|
|
200
|
+
onChange={onTitleChange}
|
|
201
|
+
placeholder={formatMessage(messages.titlePlaceholder)}
|
|
202
|
+
value={title}
|
|
203
|
+
size="default"
|
|
204
|
+
isRequired
|
|
205
|
+
/>
|
|
206
|
+
</div>
|
|
207
|
+
<div className="creatives-inapp-media">
|
|
208
|
+
<div className="inapp-content-media">
|
|
209
|
+
<CapHeading type="h5" className="inapp-media-header">
|
|
210
|
+
{formatMessage(messages.mediaLabel)}
|
|
211
|
+
</CapHeading>
|
|
212
|
+
<CapRadioGroup
|
|
213
|
+
id="inapp-media-radio"
|
|
214
|
+
options={MEDIA_RADIO_OPTIONS}
|
|
215
|
+
value={templateMediaType}
|
|
216
|
+
onChange={onTemplateMediaTypeChange}
|
|
217
|
+
className="inapp-media-radio"
|
|
218
|
+
/>
|
|
219
|
+
</div>
|
|
220
|
+
</div>
|
|
221
|
+
<div className={`creatives-inapp-message ${!isMediaTypeImage && "message-bottom-margin"}`}>
|
|
222
|
+
<div
|
|
223
|
+
className="inapp-message-header"
|
|
224
|
+
>
|
|
225
|
+
<CapHeading type="h5" className="inapp-message-header-style">
|
|
226
|
+
{formatMessage(messages.message)}
|
|
227
|
+
</CapHeading>
|
|
228
|
+
{getTagList(1)} {/* here 1 signifies the tags for template message */}
|
|
229
|
+
</div>
|
|
230
|
+
<TextArea
|
|
231
|
+
id="inapp-create-template-message-input"
|
|
232
|
+
className="inapp-create-template-message-input"
|
|
233
|
+
placeholder={formatMessage(messages.textAreaInputPlaceholder)}
|
|
234
|
+
onChange={onTemplateMessageChange}
|
|
235
|
+
value={templateMessage || ''}
|
|
236
|
+
autosize={{ minRows: 5, maxRows: 5 }}
|
|
237
|
+
errorMessage={templateMessageError && (
|
|
238
|
+
<CapError className="inapp-template-message-error">
|
|
239
|
+
{templateMessageError}
|
|
240
|
+
</CapError>
|
|
241
|
+
)}
|
|
242
|
+
/>
|
|
243
|
+
{isMediaTypeImage && (
|
|
244
|
+
<>
|
|
245
|
+
<CapHeading type="h4" className="cover-img">
|
|
246
|
+
{formatMessage(messages.coverImage)}
|
|
247
|
+
</CapHeading>
|
|
248
|
+
<CapImageUpload
|
|
249
|
+
allowedExtensionsRegex={ALLOWED_IMAGE_EXTENSIONS_REGEX}
|
|
250
|
+
imgSize={INAPP_IMG_SIZE}
|
|
251
|
+
uploadAsset={uploadInAppAsset}
|
|
252
|
+
isFullMode={isFullMode}
|
|
253
|
+
imageSrc={inAppImageSrc}
|
|
254
|
+
updateImageSrc={setUpdateInAppImageSrc}
|
|
255
|
+
updateOnReUpload={updateOnInAppImageReUpload}
|
|
256
|
+
index={0}
|
|
257
|
+
className="cap-custom-image-upload"
|
|
258
|
+
key="inapp-uploaded-image"
|
|
259
|
+
imageData={editData}
|
|
260
|
+
channel={INAPP}
|
|
261
|
+
channelSpecificStyle={!isFullMode}
|
|
262
|
+
/>
|
|
263
|
+
</>
|
|
264
|
+
)}
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
<div className="inapp-action-link">
|
|
268
|
+
<CapCheckbox onChange={() => setAddActionLink(!addActionLink)} checked={addActionLink} />
|
|
269
|
+
<div className="inapp-render-heading">
|
|
270
|
+
<CapHeader
|
|
271
|
+
title={<CapRow type="flex">
|
|
272
|
+
<CapHeading type="h4">
|
|
273
|
+
{formatMessage(messages.addActionLink)}
|
|
274
|
+
</CapHeading>
|
|
275
|
+
</CapRow>}
|
|
276
|
+
description={<CapLabel type="label3">{formatMessage(messages.addActionLinkDesc)}</CapLabel>}
|
|
277
|
+
/>
|
|
278
|
+
{addActionLink && (
|
|
279
|
+
<div className="inapp-action-deep-link">
|
|
280
|
+
<CapHeading type="h4">
|
|
281
|
+
{formatMessage(messages.actionDeepLink)}
|
|
282
|
+
</CapHeading>
|
|
283
|
+
<CapSelect
|
|
284
|
+
id="inapp-add-action-link-type"
|
|
285
|
+
placeholder={formatMessage(messages.deepLinkOptionsPlaceholder)}
|
|
286
|
+
options={deepLink || []}
|
|
287
|
+
value={deepLinkValue}
|
|
288
|
+
onChange={(value) => { setDeepLinkValue(value); }}
|
|
289
|
+
/>
|
|
290
|
+
</div>
|
|
291
|
+
)}
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
<div className="inapp-cta-button">
|
|
295
|
+
<CapHeader
|
|
296
|
+
className="inapp-render-heading-cta-button"
|
|
297
|
+
title={<CapRow type="flex">
|
|
298
|
+
<CapHeading type="h4">
|
|
299
|
+
{formatMessage(messages.btnLabel)}
|
|
300
|
+
</CapHeading>
|
|
301
|
+
<CapHeading
|
|
302
|
+
type="h6"
|
|
303
|
+
className="inapp-optional-label"
|
|
304
|
+
>
|
|
305
|
+
{formatMessage(messages.optional)}
|
|
306
|
+
</CapHeading>
|
|
307
|
+
</CapRow>}
|
|
308
|
+
description={<CapLabel type="label3">{formatMessage(messages.btnDesc)}</CapLabel>}
|
|
309
|
+
/>
|
|
310
|
+
<CapRadioGroup
|
|
311
|
+
options={buttonRadioOptions}
|
|
312
|
+
value={buttonType}
|
|
313
|
+
onChange={onChangeButtonType}
|
|
314
|
+
className="inapp-btn-radio-group"
|
|
315
|
+
/>
|
|
316
|
+
{isBtnTypeCta && (
|
|
317
|
+
<CapInAppCTA
|
|
318
|
+
ctaData={ctaData}
|
|
319
|
+
updateHandler={updateHandler}
|
|
320
|
+
deleteHandler={deleteHandler}
|
|
321
|
+
isEditFlow={isEditFlow}
|
|
322
|
+
deepLink={deepLink || []}
|
|
323
|
+
/>
|
|
324
|
+
)}
|
|
325
|
+
</div>
|
|
326
|
+
</>
|
|
327
|
+
);
|
|
328
|
+
};
|
|
329
|
+
|
|
330
|
+
CapDeviceContent.propTypes = {
|
|
331
|
+
intl: intlShape.isRequierd,
|
|
332
|
+
location: PropTypes.string,
|
|
333
|
+
injectedTags: PropTypes.object,
|
|
334
|
+
selectedOfferDetails: PropTypes.array,
|
|
335
|
+
panes: PropTypes.string,
|
|
336
|
+
};
|
|
337
|
+
|
|
338
|
+
export default injectIntl(CapDeviceContent);
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
@import '~@capillarytech/cap-ui-library/styles/_variables.scss';
|
|
2
|
+
|
|
3
|
+
.creatives-device-content {
|
|
4
|
+
.inapp-copy-content {
|
|
5
|
+
margin-top: $CAP_SPACE_08;
|
|
6
|
+
margin-bottom: $CAP_SPACE_16;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.creatives-inapp-title {
|
|
10
|
+
.inapp-content-main {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
margin-top: $CAP_SPACE_08;
|
|
15
|
+
}
|
|
16
|
+
.inapp-title {
|
|
17
|
+
font-weight: 500;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.creatives-inapp-media {
|
|
22
|
+
.inapp-media-header {
|
|
23
|
+
font-weight: 500;
|
|
24
|
+
}
|
|
25
|
+
.inapp-content-media {
|
|
26
|
+
margin-top: $CAP_SPACE_16;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.inapp-media-radio {
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
margin-top: $CAP_SPACE_16;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
.creatives-inapp-message {
|
|
35
|
+
margin-top : $CAP_SPACE_12;
|
|
36
|
+
.inapp-message-header {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: space-between;
|
|
40
|
+
|
|
41
|
+
.inapp-message-header-style {
|
|
42
|
+
font-weight: 500;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
.inapp-create-template-message-input {
|
|
46
|
+
min-height: 5.214rem;
|
|
47
|
+
margin-bottom: $CAP_SPACE_08;
|
|
48
|
+
}
|
|
49
|
+
.cap-custom-image-upload {
|
|
50
|
+
.dragger-button.re-upload {
|
|
51
|
+
top: 28rem;
|
|
52
|
+
position: absolute;
|
|
53
|
+
right: $CAP_SPACE_20;
|
|
54
|
+
color: $FONT_COLOR_05;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
.message-bottom-margin{
|
|
59
|
+
margin-bottom: 0.857rem;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.inapp-action-link {
|
|
64
|
+
display: flex;
|
|
65
|
+
margin-top: 2rem;
|
|
66
|
+
|
|
67
|
+
.inapp-render-heading {
|
|
68
|
+
width: 100%;
|
|
69
|
+
|
|
70
|
+
.inapp-action-deep-link {
|
|
71
|
+
margin-top: $CAP_SPACE_12;
|
|
72
|
+
|
|
73
|
+
#inapp-add-action-link-type {
|
|
74
|
+
width: 100%;
|
|
75
|
+
margin-top: $CAP_SPACE_12;
|
|
76
|
+
}
|
|
77
|
+
.cap-select-v2 {
|
|
78
|
+
.ant-select-selection__placeholder {
|
|
79
|
+
display: block;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.inapp-cta-button {
|
|
86
|
+
margin-top: 2rem;
|
|
87
|
+
|
|
88
|
+
.inapp-render-heading-cta-button {
|
|
89
|
+
.inapp-optional-label {
|
|
90
|
+
font-size: $CAP_SPACE_12;
|
|
91
|
+
color: $CAP_G06;
|
|
92
|
+
margin-left: $CAP_SPACE_04;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
.inapp-btn-radio-group{
|
|
96
|
+
display: grid;
|
|
97
|
+
}
|
|
98
|
+
.inapp-button-none {
|
|
99
|
+
display: inline-grid;
|
|
100
|
+
margin-top: $CAP_SPACE_16;
|
|
101
|
+
}
|
|
102
|
+
.inapp-button-cta {
|
|
103
|
+
display: inline-grid;
|
|
104
|
+
margin-top: $CAP_SPACE_24;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.inapp-template-message-error {
|
|
108
|
+
margin-bottom: 1rem;
|
|
109
|
+
}
|
|
110
|
+
.image-container {
|
|
111
|
+
margin-top: 1.5rem;
|
|
112
|
+
}
|
|
113
|
+
.cover-img {
|
|
114
|
+
margin-top: 2rem;
|
|
115
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { defineMessages } from "react-intl";
|
|
2
|
+
|
|
3
|
+
const prefix = "app.v2Components.CapDeviceContent";
|
|
4
|
+
|
|
5
|
+
export default defineMessages({
|
|
6
|
+
copyContentFromIOS: {
|
|
7
|
+
id: `${prefix}.copyContentFromIOS`,
|
|
8
|
+
defaultMessage: "Copy title and content from iOS",
|
|
9
|
+
},
|
|
10
|
+
copyCotentFromAndroid: {
|
|
11
|
+
id: `${prefix}.copyContentFromAndriod`,
|
|
12
|
+
defaultMessage: "Copy title and content from Android",
|
|
13
|
+
},
|
|
14
|
+
title: {
|
|
15
|
+
id: `${prefix}.title`,
|
|
16
|
+
defaultMessage: "Title",
|
|
17
|
+
},
|
|
18
|
+
addLabel: {
|
|
19
|
+
id: `${prefix}.addLabel`,
|
|
20
|
+
defaultMessage: "Add labels",
|
|
21
|
+
},
|
|
22
|
+
titlePlaceholder: {
|
|
23
|
+
id: `${prefix}.titlePlaceholder`,
|
|
24
|
+
defaultMessage: "Please input message title name",
|
|
25
|
+
},
|
|
26
|
+
message: {
|
|
27
|
+
id: `${prefix}.message`,
|
|
28
|
+
defaultMessage: "Message",
|
|
29
|
+
},
|
|
30
|
+
textAreaInputPlaceholder: {
|
|
31
|
+
id: `${prefix}.textAreaInputPlaceholder`,
|
|
32
|
+
defaultMessage: "Please input in-app notification message content",
|
|
33
|
+
},
|
|
34
|
+
addActionLink: {
|
|
35
|
+
id: `${prefix}.addActionLink`,
|
|
36
|
+
defaultMessage: 'Add action link to content',
|
|
37
|
+
},
|
|
38
|
+
addActionLinkDesc: {
|
|
39
|
+
id: `${prefix}.addActionLinkDesc`,
|
|
40
|
+
defaultMessage: 'Add a deep link of the page which customer will be directed to',
|
|
41
|
+
},
|
|
42
|
+
select: {
|
|
43
|
+
id: `${prefix}.select`,
|
|
44
|
+
defaultMessage: "Select",
|
|
45
|
+
},
|
|
46
|
+
mediaLabel: {
|
|
47
|
+
id: `${prefix}.mediaLabel`,
|
|
48
|
+
defaultMessage: "Media",
|
|
49
|
+
},
|
|
50
|
+
mediaText: {
|
|
51
|
+
id: `${prefix}.mediaText`,
|
|
52
|
+
defaultMessage: "Text",
|
|
53
|
+
},
|
|
54
|
+
mediaImage: {
|
|
55
|
+
id: `${prefix}.mediaImage`,
|
|
56
|
+
defaultMessage: "Image",
|
|
57
|
+
},
|
|
58
|
+
btnTypeNone: {
|
|
59
|
+
id: `${prefix}.btnTypeNone`,
|
|
60
|
+
defaultMessage: "None",
|
|
61
|
+
},
|
|
62
|
+
btnTypeCTA: {
|
|
63
|
+
id: `${prefix}.btnTypeCTA`,
|
|
64
|
+
defaultMessage: "Call to action",
|
|
65
|
+
},
|
|
66
|
+
ctaDesc: {
|
|
67
|
+
id: `${prefix}.ctaDesc`,
|
|
68
|
+
defaultMessage:
|
|
69
|
+
"Create a button that lets customers take an action",
|
|
70
|
+
},
|
|
71
|
+
emptyTemplateMessageErrorMessage: {
|
|
72
|
+
id: `${prefix}.emptyTemplateMessageErrorMessage`,
|
|
73
|
+
defaultMessage: "Template message cannot be empty",
|
|
74
|
+
},
|
|
75
|
+
templateMessageLabel: {
|
|
76
|
+
id: `${prefix}.templateMessageLabel`,
|
|
77
|
+
defaultMessage: 'Message',
|
|
78
|
+
},
|
|
79
|
+
btnDisabledTooltip: {
|
|
80
|
+
id: `${prefix}.btnDisabledTooltip`,
|
|
81
|
+
defaultMessage: 'Please add all mandatory fields to proceed further',
|
|
82
|
+
},
|
|
83
|
+
btnLabel: {
|
|
84
|
+
id: `${prefix}.btnLabel`,
|
|
85
|
+
defaultMessage: 'Buttons',
|
|
86
|
+
},
|
|
87
|
+
btnDesc: {
|
|
88
|
+
id: `${prefix}.btnDesc`,
|
|
89
|
+
defaultMessage: 'These will be show clickable buttons below your message.',
|
|
90
|
+
},
|
|
91
|
+
optional: {
|
|
92
|
+
id: `${prefix}.optional`,
|
|
93
|
+
defaultMessage: '(Optional)',
|
|
94
|
+
},
|
|
95
|
+
actionDeepLink: {
|
|
96
|
+
id: `${prefix}.actionDeepLink`,
|
|
97
|
+
defaultMessage: 'Deep Link',
|
|
98
|
+
},
|
|
99
|
+
deepLinkOptionsPlaceholder: {
|
|
100
|
+
id: `${prefix}.deepLinkOptionsPlaceholder`,
|
|
101
|
+
defaultMessage: 'Select deep link',
|
|
102
|
+
},
|
|
103
|
+
coverImage: {
|
|
104
|
+
id: `${prefix}.coverImage`,
|
|
105
|
+
defaultMessage: 'Cover image',
|
|
106
|
+
},
|
|
107
|
+
});
|