@capillarytech/creatives-library 3.0.32 → 3.0.34
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.
|
@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import _ from 'lodash';
|
|
11
11
|
import { injectIntl, intlShape} from 'react-intl';
|
|
12
|
-
|
|
12
|
+
import styled from 'styled-components';
|
|
13
13
|
import {CapColumn} from '@capillarytech/cap-react-ui-library';
|
|
14
14
|
import './_templatePreview.scss';
|
|
15
15
|
import {updateCharCount} from '../../utils/smsCharCountV2';
|
|
@@ -51,6 +51,8 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
51
51
|
return undefined;
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
|
+
const BoldText = styled.span`
|
|
55
|
+
font-weight: 800;`;
|
|
54
56
|
return (
|
|
55
57
|
<div className={`preview-container ${type === 'embedded' ? 'embedded-preview' : ''}`}>
|
|
56
58
|
{ channel && channel.toLowerCase() === 'sms' &&
|
|
@@ -152,10 +154,8 @@ class TemplatePreview extends React.Component { // eslint-disable-line react/pre
|
|
|
152
154
|
}
|
|
153
155
|
<div style={{marginTop: '8px', fontSize: '16px'}} >{`${this.props.intl.formatMessage(messages.sms)}: ${smsDetails.parts}`}</div>
|
|
154
156
|
<div style={{fontSize: '16px'}}>{`${this.props.intl.formatMessage(messages.charactersPerSms)}: ${smsDetails.chars_used}`}</div>
|
|
155
|
-
{
|
|
156
|
-
|
|
157
|
-
<span style={{fontSize: '12px'}}>{this.props.intl.formatMessage(messages.optout)}</span>
|
|
158
|
-
<span style={{fontWeight: '100', fontSize: '12px'}}>{this.props.intl.formatMessage(messages.tag)}</span>: {smsDetails.optouturlLength}
|
|
157
|
+
{smsDetails.optoutUrlPresent && <div style={{fontWeight: '100', fontSize: '12px'}}>
|
|
158
|
+
{`${this.props.intl.formatMessage(messages.includes)} `}<BoldText>{`${this.props.intl.formatMessage(messages.optout)} `}</BoldText>{this.props.intl.formatMessage(messages.tag)}: {smsDetails.optouturlLength}
|
|
159
159
|
</div>}
|
|
160
160
|
</p>
|
|
161
161
|
</div>
|
|
@@ -28,15 +28,16 @@ export default defineMessages({
|
|
|
28
28
|
},
|
|
29
29
|
includes: {
|
|
30
30
|
id: 'app.components.TemplatePreview.includes',
|
|
31
|
-
defaultMessage: 'Includes
|
|
31
|
+
defaultMessage: 'Includes',
|
|
32
32
|
},
|
|
33
33
|
optout: {
|
|
34
34
|
id: 'app.components.TemplatePreview.optout',
|
|
35
|
-
defaultMessage: 'Optout
|
|
35
|
+
defaultMessage: 'Optout',
|
|
36
36
|
},
|
|
37
37
|
tag: {
|
|
38
38
|
id: 'app.components.TemplatePreview.tag',
|
|
39
|
-
defaultMessage: 'tag
|
|
39
|
+
defaultMessage: 'tag',
|
|
40
|
+
},
|
|
40
41
|
previewGenerated: {
|
|
41
42
|
id: 'creatives.components.TemplatePreview.previewGenerated',
|
|
42
43
|
defaultMessage: 'Preview is being generated',
|
package/package.json
CHANGED
package/utils/smsCharCountV2.js
CHANGED
|
@@ -62,7 +62,6 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
62
62
|
showOptoutCount = false;
|
|
63
63
|
responseState = "FAIL";
|
|
64
64
|
optoutUrl = undefined;
|
|
65
|
-
console.log('get optouturl error: ', err);
|
|
66
65
|
});
|
|
67
66
|
}
|
|
68
67
|
const optoutTag = /{{optout}}/g;
|
|
@@ -147,11 +146,6 @@ export function updateCharCount(content, isUnicodeEnabled) {
|
|
|
147
146
|
}
|
|
148
147
|
|
|
149
148
|
chars_used = showOptoutCount ? (chars_used - (optoutTagLength * noOfOptout)) : chars_used;
|
|
150
|
-
console.log('Type:', (coding == '7bit' ? '7bit' : 'Unicode'));
|
|
151
|
-
console.log('Parts:', parts);
|
|
152
|
-
console.log('SMS Chars:', chars_sms);
|
|
153
|
-
console.log('SMS Char total:', chars_used);
|
|
154
|
-
console.log('SMS optouturl: ', optoutUrl);
|
|
155
149
|
return {
|
|
156
150
|
unicode: (coding === '7bit' ? false : true),
|
|
157
151
|
parts,
|