@capillarytech/creatives-library 7.12.38 → 7.12.39
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
|
@@ -64,7 +64,7 @@ export default defineMessages({
|
|
|
64
64
|
},
|
|
65
65
|
ctaButtonTextTooltip: {
|
|
66
66
|
id: `${prefix}.ctaButtonTextTooltip`,
|
|
67
|
-
defaultMessage: '
|
|
67
|
+
defaultMessage: 'Use this to name the button. We would recommend not to use special characters for the button text.',
|
|
68
68
|
},
|
|
69
69
|
ctaOptionDisabledTooltip: {
|
|
70
70
|
id: `${prefix}.ctaOptionDisabledTooltip`,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable react/jsx-boolean-value */
|
|
1
2
|
/* eslint-disable camelcase */
|
|
2
3
|
/* eslint-disable no-undef */
|
|
3
4
|
import React, { useState, useEffect } from 'react';
|
|
@@ -21,6 +22,7 @@ import CapLabel from '@capillarytech/cap-ui-library/CapLabel';
|
|
|
21
22
|
import CapButton from '@capillarytech/cap-ui-library/CapButton';
|
|
22
23
|
import CapNotification from '@capillarytech/cap-ui-library/CapNotification';
|
|
23
24
|
import CapAlert from '@capillarytech/cap-ui-library/CapAlert';
|
|
25
|
+
import CapCheckbox from '@capillarytech/cap-ui-library/CapCheckbox';
|
|
24
26
|
import moment from 'moment';
|
|
25
27
|
import {
|
|
26
28
|
CAP_SPACE_04,
|
|
@@ -109,6 +111,7 @@ export const Whatsapp = (props) => {
|
|
|
109
111
|
const [accessToken, setAccessToken] = useState('');
|
|
110
112
|
const [accountName, setAccountName] = useState('');
|
|
111
113
|
const [spin, setSpin] = useState(false);
|
|
114
|
+
const [unsubscribeRequired, setUnsubscribeRequired] = useState(false);
|
|
112
115
|
//for edit only
|
|
113
116
|
const [isEditFlow, setEditFlow] = useState(false);
|
|
114
117
|
const [templateDate, setTemplateDate] = useState('');
|
|
@@ -519,23 +522,33 @@ export const Whatsapp = (props) => {
|
|
|
519
522
|
</CapHeading>
|
|
520
523
|
);
|
|
521
524
|
|
|
525
|
+
const unsubscribeHandler = ({ target: { checked } }) => {
|
|
526
|
+
setUnsubscribeRequired(checked);
|
|
527
|
+
};
|
|
528
|
+
|
|
522
529
|
const renderUnsubscribeText = () => (
|
|
523
530
|
<>
|
|
524
531
|
<CapColumn span={12}>
|
|
525
|
-
<
|
|
526
|
-
|
|
527
|
-
|
|
532
|
+
<CapCheckbox
|
|
533
|
+
className={`whatsapp-create-unsubscribe-checkbox ${
|
|
534
|
+
isEditFlow ? '' : 'whatsapp-create-unsubscribe'
|
|
535
|
+
}`}
|
|
536
|
+
onChange={unsubscribeHandler}
|
|
537
|
+
checked={unsubscribeRequired}
|
|
538
|
+
disabled={isEditFlow}
|
|
539
|
+
autoFocus={true}
|
|
528
540
|
>
|
|
529
|
-
<
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
: 'whatsapp-edit-render-unsubscribe-text'
|
|
541
|
+
<CapTooltip
|
|
542
|
+
placement="bottom"
|
|
543
|
+
title={
|
|
544
|
+
!isEditFlow && formatMessage(messages.unsubscribeTextTooltip)
|
|
534
545
|
}
|
|
535
546
|
>
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
547
|
+
<span className="whatsapp-render-unsubscribe-text">
|
|
548
|
+
{formatMessage(messages.templateMessageUnsubscribeText)}
|
|
549
|
+
</span>
|
|
550
|
+
</CapTooltip>
|
|
551
|
+
</CapCheckbox>
|
|
539
552
|
</CapColumn>
|
|
540
553
|
<CapColumn span={12}></CapColumn>
|
|
541
554
|
</>
|
|
@@ -1113,9 +1126,7 @@ export const Whatsapp = (props) => {
|
|
|
1113
1126
|
placement="bottom"
|
|
1114
1127
|
title={formatMessage(messages.disabledButtonsSection)}
|
|
1115
1128
|
>
|
|
1116
|
-
<CapRow>
|
|
1117
|
-
{renderButtonsSection()}
|
|
1118
|
-
</CapRow>
|
|
1129
|
+
<CapRow>{renderButtonsSection()}</CapRow>
|
|
1119
1130
|
</CapTooltip>
|
|
1120
1131
|
</>
|
|
1121
1132
|
);
|
|
@@ -10,13 +10,23 @@
|
|
|
10
10
|
margin-bottom: 6px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.whatsapp-create-
|
|
14
|
-
|
|
13
|
+
.whatsapp-create-unsubscribe-checkbox {
|
|
14
|
+
.ant-checkbox-inner {
|
|
15
|
+
height: 16px;
|
|
16
|
+
width: 16px;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.whatsapp-create-unsubscribe {
|
|
15
21
|
margin: $CAP_SPACE_08 0px $CAP_SPACE_08 16px;
|
|
16
22
|
}
|
|
17
23
|
|
|
18
|
-
.whatsapp-
|
|
24
|
+
.whatsapp-render-unsubscribe-text {
|
|
19
25
|
color: $FONT_COLOR_02;
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
font-weight: normal;
|
|
28
|
+
line-height: 24px;
|
|
29
|
+
margin-left: -8px;
|
|
20
30
|
}
|
|
21
31
|
|
|
22
32
|
.whatsapp-render-message-length {
|