@capillarytech/creatives-library 2.0.93 → 2.0.95
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/containers/Templates/index.js +1 -1
- package/containers/WeChat/RichmediaTemplates/Create/index.js +3 -3
- package/package.json +1 -1
- package/v2Containers/Sms/Edit/index.js +3 -3
- package/v2Containers/Templates/index.js +3 -3
- package/v2Containers/WeChat/RichmediaTemplates/Create/index.js +3 -3
- package/assets/android-message-gui-2.svg +0 -55
- package/components/CallTaskPreview/_callTaskPreview.scss +0 -17
- package/components/CallTaskPreview/images/Footer.png +0 -0
- package/components/CallTaskPreview/images/Header.png +0 -0
- package/components/CallTaskPreview/index.js +0 -37
- package/components/CallTaskPreview/messages.js +0 -13
- package/components/CallTaskPreview/tests/index.test.js +0 -15
- package/components/CmsTemplatesComponent/index.js +0 -33
- package/components/CmsTemplatesComponent/messages.js +0 -17
- package/components/CmsTemplatesComponent/tests/index.test.js +0 -10
- package/components/EmailMobilePreview/index.js +0 -129
- package/components/EmailMobilePreview/index.scss +0 -55
- package/components/EmailPreviewV2/_emailPreviewV2.scss +0 -69
- package/components/EmailPreviewV2/index.js +0 -132
- package/components/EmailPreviewV2/messages.js +0 -41
- package/components/EmailPreviewV2/tests/index.test.js +0 -10
- package/components/MobilePushPreviewV2/index.js +0 -120
- package/components/MobilePushPreviewV2/messages.js +0 -13
- package/components/MobilePushPreviewV2/tests/index.test.js +0 -10
- package/components/NewCallTask/_newCallTask.scss +0 -9
- package/components/NewCallTask/index.js +0 -152
- package/components/NewCallTask/messages.js +0 -29
- package/components/NewCallTask/tests/index.test.js +0 -10
- package/components/SmsPreviewV2/_smsPreviewV2.scss +0 -353
- package/components/SmsPreviewV2/index.js +0 -69
- package/components/SmsPreviewV2/messages.js +0 -13
- package/components/SmsPreviewV2/tests/index.test.js +0 -10
|
@@ -1287,7 +1287,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1287
1287
|
header={this.state.previewTemplate.name}
|
|
1288
1288
|
content={slideboxContent}
|
|
1289
1289
|
show={this.state.showEmailPreviewModal}
|
|
1290
|
-
handleClose={this.
|
|
1290
|
+
handleClose={this.togglePreview}
|
|
1291
1291
|
width={60}
|
|
1292
1292
|
/>
|
|
1293
1293
|
);
|
|
@@ -14,7 +14,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
14
14
|
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
15
15
|
import _ from 'lodash';
|
|
16
16
|
import { Menu, Dropdown } from 'antd';
|
|
17
|
-
import { CapRow, CapColumn, CapButton, CapCard,
|
|
17
|
+
import { CapRow, CapColumn, CapButton, CapCard, CapSpin } from '@capillarytech/cap-react-ui-library';
|
|
18
18
|
import makeSelectCreate, {makeSelectTemplates, getAssetDetails, getContentAssetDetails} from './selectors';
|
|
19
19
|
import * as actions from './actions';
|
|
20
20
|
import richmediaschema from './richmediaschema';
|
|
@@ -970,7 +970,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
970
970
|
}
|
|
971
971
|
return (
|
|
972
972
|
<div className="richmedia-container">
|
|
973
|
-
<
|
|
973
|
+
<CapSpin spinning={this.state.loading}>
|
|
974
974
|
{this.state.showPreview && <WechatRichmediaTemplatePreview
|
|
975
975
|
show={this.state.showPreview}
|
|
976
976
|
closeSlideBox={this.closeSlideBox}
|
|
@@ -1012,7 +1012,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1012
1012
|
</CapRow>
|
|
1013
1013
|
</div>
|
|
1014
1014
|
</div>
|
|
1015
|
-
</
|
|
1015
|
+
</CapSpin>
|
|
1016
1016
|
</div>
|
|
1017
1017
|
);
|
|
1018
1018
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { connect } from 'react-redux';
|
|
12
|
-
import { CapRow, CapColumn,
|
|
12
|
+
import { CapRow, CapColumn, CapSpin, CapNotification } from '@capillarytech/cap-ui-library';
|
|
13
13
|
import { injectIntl, intlShape } from 'react-intl';
|
|
14
14
|
import { createStructuredSelector } from 'reselect';
|
|
15
15
|
import _ from 'lodash';
|
|
@@ -932,7 +932,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
932
932
|
}
|
|
933
933
|
return (
|
|
934
934
|
<div className="sms-email-container">
|
|
935
|
-
<
|
|
935
|
+
<CapSpin tip={tipText} spinning={spinning}>
|
|
936
936
|
{/*<CapRow style={{marginBottom: '16px', marginLeft: '-40px'}}>
|
|
937
937
|
<CapColumn offset={1}>
|
|
938
938
|
<Breadcrumb>
|
|
@@ -973,7 +973,7 @@ export class Edit extends React.Component { // eslint-disable-line react/prefer-
|
|
|
973
973
|
/>
|
|
974
974
|
</CapColumn>
|
|
975
975
|
</CapRow>
|
|
976
|
-
</
|
|
976
|
+
</CapSpin>
|
|
977
977
|
</div>
|
|
978
978
|
);
|
|
979
979
|
}
|
|
@@ -392,7 +392,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
392
392
|
}
|
|
393
393
|
onPaginationChange = () => { this.getAllTemplates({getNextPage: true}); }
|
|
394
394
|
onCreateComplete = () => {
|
|
395
|
-
this.setState({routeParams: null});
|
|
395
|
+
this.setState({routeParams: null, previewOpen: false});
|
|
396
396
|
}
|
|
397
397
|
getCurrentWindow(e) {
|
|
398
398
|
const response = {
|
|
@@ -1291,7 +1291,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1291
1291
|
};
|
|
1292
1292
|
|
|
1293
1293
|
toggleEmailPreview = () => {
|
|
1294
|
-
this.setState({ showHtmlPreview: !this.state.showHtmlPreview }, () => {
|
|
1294
|
+
this.setState({ showHtmlPreview: !this.state.showHtmlPreview, previewOpen: !this.state.previewOpen }, () => {
|
|
1295
1295
|
if (!this.state.showHtmlPreview) {
|
|
1296
1296
|
this.setState({previewTemplate: {}});
|
|
1297
1297
|
}
|
|
@@ -1362,7 +1362,7 @@ export class Templates extends React.Component { // eslint-disable-line react/pr
|
|
|
1362
1362
|
header={this.state.previewTemplate.name}
|
|
1363
1363
|
content={slideboxContent}
|
|
1364
1364
|
show={this.state.showEmailPreviewModal}
|
|
1365
|
-
handleClose={this.
|
|
1365
|
+
handleClose={this.togglePreview}
|
|
1366
1366
|
width={60}
|
|
1367
1367
|
/>
|
|
1368
1368
|
);
|
|
@@ -14,7 +14,7 @@ import { createStructuredSelector } from 'reselect';
|
|
|
14
14
|
import { injectIntl, intlShape, FormattedMessage } from 'react-intl';
|
|
15
15
|
import _ from 'lodash';
|
|
16
16
|
import { Menu, Dropdown } from 'antd';
|
|
17
|
-
import { CapRow, CapColumn, CapButton, CapCard,
|
|
17
|
+
import { CapRow, CapColumn, CapButton, CapCard, CapSpin } from '@capillarytech/cap-ui-library';
|
|
18
18
|
import makeSelectCreate, {makeSelectTemplates, getAssetDetails, getContentAssetDetails} from './selectors';
|
|
19
19
|
import * as actions from './actions';
|
|
20
20
|
import richmediaschema from './richmediaschema';
|
|
@@ -970,7 +970,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
970
970
|
}
|
|
971
971
|
return (
|
|
972
972
|
<div className="richmedia-container">
|
|
973
|
-
<
|
|
973
|
+
<CapSpin spinning={this.state.loading}>
|
|
974
974
|
{this.state.showPreview && <WechatRichmediaTemplatePreview
|
|
975
975
|
show={this.state.showPreview}
|
|
976
976
|
closeSlideBox={this.closeSlideBox}
|
|
@@ -1012,7 +1012,7 @@ export class Create extends React.Component { // eslint-disable-line react/prefe
|
|
|
1012
1012
|
</CapRow>
|
|
1013
1013
|
</div>
|
|
1014
1014
|
</div>
|
|
1015
|
-
</
|
|
1015
|
+
</CapSpin>
|
|
1016
1016
|
</div>
|
|
1017
1017
|
);
|
|
1018
1018
|
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg width="360px" height="725px" viewBox="0 0 360 725" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
-
<!-- Generator: Sketch 55.2 (78181) - https://sketchapp.com -->
|
|
4
|
-
<title>Artboard Copy 3</title>
|
|
5
|
-
<desc>Created with Sketch.</desc>
|
|
6
|
-
<g id="Artboard-Copy-3" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
-
<rect id="Rectangle" fill="#FFFFFF" x="0" y="660" width="360" height="65"></rect>
|
|
8
|
-
<g id="Organisms/ui/android/screenshots/wallpaper" transform="translate(120.000000, 0.000000)"></g>
|
|
9
|
-
<g id="Group-5" transform="translate(16.000000, 680.000000)">
|
|
10
|
-
<polygon id="Stroke-1" stroke-opacity="0.0117647061" stroke="#000000" stroke-width="1.33333336e-11" points="0 0 23.999999 0 23.999999 23.999999 0 23.999999"></polygon>
|
|
11
|
-
<polygon id="Fill-3" fill="#7F7F7F" points="18.9999989 12.9999992 12.9999992 12.9999992 12.9999992 18.9999989 10.9999993 18.9999989 10.9999993 12.9999992 4.9999997 12.9999992 4.9999997 10.9999993 10.9999993 10.9999993 10.9999993 4.9999997 12.9999992 4.9999997 12.9999992 10.9999993 18.9999989 10.9999993"></polygon>
|
|
12
|
-
</g>
|
|
13
|
-
<text id="Add-text-to-this-mes" font-family="Roboto-Regular, Roboto" font-size="15" font-weight="normal" letter-spacing="0.3" fill="#959595">
|
|
14
|
-
<tspan x="53" y="697">Add text to this message</tspan>
|
|
15
|
-
</text>
|
|
16
|
-
<g id="Group-5" transform="translate(320.000000, 679.000000)">
|
|
17
|
-
<polygon id="Stroke-1" stroke-opacity="0.0117647061" stroke="#000000" stroke-width="1.33333336e-11" points="0 0 23.999999 0 23.999999 23.999999 0 23.999999"></polygon>
|
|
18
|
-
<polygon id="Fill-3" fill="#757575" points="2.00999988 20.9999987 22.9999986 11.9999993 2.00999988 2.99999982 1.99999988 9.9999994 16.999999 11.9999993 1.99999988 13.9999992"></polygon>
|
|
19
|
-
</g>
|
|
20
|
-
<rect id="Rectangle" stroke="#E6E6E6" fill="#F4F5F7" x="0.5" y="86.5" width="359" height="573"></rect>
|
|
21
|
-
<g id="Group">
|
|
22
|
-
<g id="Toolbar">
|
|
23
|
-
<polygon id="Toolbar-bg" fill="#E51FA3" points="360 0 0 0 0 86 360 86"></polygon>
|
|
24
|
-
<g id="Toolbar-contents" transform="translate(16.000000, 40.000000)">
|
|
25
|
-
<g id="Back">
|
|
26
|
-
<rect id="Bounds" x="0" y="0" width="24" height="24"></rect>
|
|
27
|
-
<polygon id="Shape" fill="#FFFFFF" points="20 11 7.8 11 13.4 5.4 12 4 4 12 12 20 13.4 18.6 7.8 13 20 13"></polygon>
|
|
28
|
-
</g>
|
|
29
|
-
</g>
|
|
30
|
-
</g>
|
|
31
|
-
<g id="Status-bar">
|
|
32
|
-
<rect id="Status-bar-bg" fill="#CF0E8F" x="0" y="0" width="360" height="24"></rect>
|
|
33
|
-
<rect id="bounds" x="242" y="0" width="118" height="24"></rect>
|
|
34
|
-
<g id="battery" transform="translate(337.000000, 4.000000)">
|
|
35
|
-
<polygon id="bounds" points="0 0 16 0 16 16 0 16"></polygon>
|
|
36
|
-
<polygon id="Shape" fill="#FFFFFF" points="9 1.875 9 1 6 1 6 1.875 3 1.875 3 15 12 15 12 1.875"></polygon>
|
|
37
|
-
</g>
|
|
38
|
-
<g id="cellular" transform="translate(317.000000, 4.000000)">
|
|
39
|
-
<polygon id="bounds" points="0 0 16 0 16 16 0 16"></polygon>
|
|
40
|
-
<polygon id="Shape" fill="#FFFFFF" points="0 15 14 15 14 1"></polygon>
|
|
41
|
-
</g>
|
|
42
|
-
<g id="wifi" transform="translate(296.000000, 4.000000)">
|
|
43
|
-
<polygon id="bounds" points="2 0 18 0 18 16 2 16"></polygon>
|
|
44
|
-
<path d="M0.977372085,4.01593123 C3.48821908,2.12256382 6.61301513,1 10,1 C13.3869849,1 16.5117809,2.12256382 19.0226279,4.01593123 L10,15 L0.977372085,4.01593123 Z" id="Shape" fill="#FFFFFF"></path>
|
|
45
|
-
</g>
|
|
46
|
-
</g>
|
|
47
|
-
<g id="Icons-/-Navigation-24px-/-White-/-More" transform="translate(332.000000, 42.000000)">
|
|
48
|
-
<g id="More">
|
|
49
|
-
<rect id="Bounds" x="0" y="0" width="12" height="24"></rect>
|
|
50
|
-
<path d="M6,8 C7.1,8 8,7.1 8,6 C8,4.9 7.1,4 6,4 C4.9,4 4,4.9 4,6 C4,7.1 4.9,8 6,8 L6,8 Z M6,10 C4.9,10 4,10.9 4,12 C4,13.1 4.9,14 6,14 C7.1,14 8,13.1 8,12 C8,10.9 7.1,10 6,10 L6,10 Z M6,16 C4.9,16 4,16.9 4,18 C4,19.1 4.9,20 6,20 C7.1,20 8,19.1 8,18 C8,16.9 7.1,16 6,16 L6,16 Z" id="Shape" fill="#FFFFFF"></path>
|
|
51
|
-
</g>
|
|
52
|
-
</g>
|
|
53
|
-
</g>
|
|
54
|
-
</g>
|
|
55
|
-
</svg>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
.call-task-preview {
|
|
2
|
-
.call-task-subject-container {
|
|
3
|
-
padding: 8px;
|
|
4
|
-
background: #444;
|
|
5
|
-
color: white;
|
|
6
|
-
font-size: 12px;
|
|
7
|
-
font-weight: 500;
|
|
8
|
-
}
|
|
9
|
-
.call-task-message-container {
|
|
10
|
-
overflow-y: auto;
|
|
11
|
-
height: 150px;
|
|
12
|
-
width: 100%;
|
|
13
|
-
font-size: 12px;
|
|
14
|
-
background: #eee;
|
|
15
|
-
padding: 8px;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
Binary file
|
|
Binary file
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* CallTaskPreview
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
import HeaderPng from './images/Header.png';
|
|
10
|
-
import FooterPng from './images/Footer.png';
|
|
11
|
-
|
|
12
|
-
import './_callTaskPreview.scss';
|
|
13
|
-
|
|
14
|
-
class CallTaskPreview extends React.Component { // eslint-disable-line react/prefer-stateless-function
|
|
15
|
-
render() {
|
|
16
|
-
const { subject, messageBody } = this.props;
|
|
17
|
-
return (
|
|
18
|
-
<div className="call-task-preview">
|
|
19
|
-
<img style={{ width: '100%' }} src={HeaderPng} alt="header" />
|
|
20
|
-
<div className="call-task-subject-container">
|
|
21
|
-
{subject}
|
|
22
|
-
</div>
|
|
23
|
-
<div className="call-task-message-container">
|
|
24
|
-
{messageBody}
|
|
25
|
-
</div>
|
|
26
|
-
<img style={{ width: '100%' }} src={FooterPng} alt="footer" />
|
|
27
|
-
</div>
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
CallTaskPreview.propTypes = {
|
|
33
|
-
subject: PropTypes.string,
|
|
34
|
-
messageBody: PropTypes.string,
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export default CallTaskPreview;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* CallTaskPreview Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the CallTaskPreview component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
header: {
|
|
10
|
-
id: 'app.components.CallTaskPreview.header',
|
|
11
|
-
defaultMessage: 'This is the CallTaskPreview component !',
|
|
12
|
-
},
|
|
13
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { shallow } from "enzyme";
|
|
3
|
-
import CallTaskPreview from "../index";
|
|
4
|
-
|
|
5
|
-
describe("<CallTaskPreview />", () => {
|
|
6
|
-
it("Test if Call task component renders", () => {
|
|
7
|
-
const component = shallow(
|
|
8
|
-
<CallTaskPreview
|
|
9
|
-
subject="this is test"
|
|
10
|
-
body="this is test message body"
|
|
11
|
-
/>
|
|
12
|
-
);
|
|
13
|
-
expect(component).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* CmsTemplatesComponent
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import PropTypes from 'prop-types';
|
|
9
|
-
// import styled from 'styled-components';
|
|
10
|
-
import {CapButton, CapCustomCard} from '@capillarytech/cap-ui-library';
|
|
11
|
-
import { FormattedMessage } from 'react-intl';
|
|
12
|
-
import messages from './messages';
|
|
13
|
-
const {CapCustomCardList} = CapCustomCard;
|
|
14
|
-
function CmsTemplatesComponent(props) {
|
|
15
|
-
const cardDataList = props.cmsTemplates.map((template) => (
|
|
16
|
-
{
|
|
17
|
-
key: template.name,
|
|
18
|
-
title: template.name,
|
|
19
|
-
url: template.versions.base.preview_http_url,
|
|
20
|
-
hoverOption: <CapButton onClick={() => props.handleEdmDefaultTemplateSelection(template._id)}><FormattedMessage {...messages.select}/></CapButton>,
|
|
21
|
-
}));
|
|
22
|
-
return (<div>
|
|
23
|
-
<div className="pagination-container">
|
|
24
|
-
<CapCustomCardList cardList={cardDataList} type="Email" />
|
|
25
|
-
</div>
|
|
26
|
-
</div>);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
CmsTemplatesComponent.propTypes = {
|
|
30
|
-
cmsTemplates: PropTypes.array,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export default CmsTemplatesComponent;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* CmsTemplatesComponent Messages
|
|
3
|
-
*
|
|
4
|
-
* This contains all the text for the CmsTemplatesComponent component.
|
|
5
|
-
*/
|
|
6
|
-
import { defineMessages } from 'react-intl';
|
|
7
|
-
|
|
8
|
-
export default defineMessages({
|
|
9
|
-
header: {
|
|
10
|
-
id: 'app.components.CmsTemplatesComponent.header',
|
|
11
|
-
defaultMessage: 'This is the CmsTemplatesComponent component !',
|
|
12
|
-
},
|
|
13
|
-
select: {
|
|
14
|
-
id: 'app.components.CmsTemplatesComponent.select',
|
|
15
|
-
defaultMessage: 'Select',
|
|
16
|
-
},
|
|
17
|
-
});
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// import React from 'react';
|
|
2
|
-
// import { shallow } from 'enzyme';
|
|
3
|
-
|
|
4
|
-
// import CmsTemplatesComponent from '../index';
|
|
5
|
-
|
|
6
|
-
describe('<CmsTemplatesComponent />', () => {
|
|
7
|
-
it('Expect to have unit tests specified', () => {
|
|
8
|
-
expect(true).toEqual(false);
|
|
9
|
-
});
|
|
10
|
-
});
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
* EmailPreviewV2
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
// import styled from 'styled-components';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import { FormattedMessage } from 'react-intl';
|
|
11
|
-
import {isEmpty} from 'lodash';
|
|
12
|
-
import { connect } from 'react-redux';
|
|
13
|
-
import { bindActionCreators } from 'redux';
|
|
14
|
-
import { createStructuredSelector } from 'reselect';
|
|
15
|
-
import { CapSpin, CapButton } from '@capillarytech/cap-ui-library';
|
|
16
|
-
import moment from 'moment';
|
|
17
|
-
import EmailPreviewV2 from '../EmailPreviewV2';
|
|
18
|
-
import messages from '../EmailPreviewV2/messages';
|
|
19
|
-
import './index.scss';
|
|
20
|
-
import mobileBody from '../../assets/mobile.png';
|
|
21
|
-
|
|
22
|
-
import {selectTemplateContent} from '../../containers/Templates/selectors';
|
|
23
|
-
import * as templateActions from '../../containers/Templates/actions';
|
|
24
|
-
|
|
25
|
-
const deviceAspectRatio = {
|
|
26
|
-
mobile: {
|
|
27
|
-
height: "440",
|
|
28
|
-
width: "230",
|
|
29
|
-
},
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
class EmailMobilePreview extends React.Component {
|
|
33
|
-
constructor() {
|
|
34
|
-
super();
|
|
35
|
-
this.state = {
|
|
36
|
-
showAllDevices: false,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
componentWillMount() {
|
|
40
|
-
const {templateData, templateContent} = this.props;
|
|
41
|
-
if (isEmpty(templateContent) && !isEmpty(templateData) && templateData._id) { // templateData: comes from templates list email preview
|
|
42
|
-
this.props.templateActions.getTemplateDetails(templateData._id); // templateContent: html data to be shown in iframe
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
onClickShowInAllDevices = () => {
|
|
46
|
-
const { onClickShowInAllDevices } = this.props;
|
|
47
|
-
if (onClickShowInAllDevices) {
|
|
48
|
-
onClickShowInAllDevices();
|
|
49
|
-
} else {
|
|
50
|
-
this.setState({
|
|
51
|
-
showAllDevices: true,
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
const messageContainerName = 'mobile-message-container';
|
|
57
|
-
const {
|
|
58
|
-
templateContent,
|
|
59
|
-
enableShowAllDevices,
|
|
60
|
-
} = this.props;
|
|
61
|
-
const { showAllDevices } = this.state;
|
|
62
|
-
|
|
63
|
-
return (
|
|
64
|
-
<div className="email-mobile-preview-container">
|
|
65
|
-
{showAllDevices ? (
|
|
66
|
-
<EmailPreviewV2 {...this.props} />
|
|
67
|
-
) : (
|
|
68
|
-
<CapSpin spinning={!templateContent}>
|
|
69
|
-
<div id="emailPreivew-container">
|
|
70
|
-
<div id="emailPreivew-content-wrapper">
|
|
71
|
-
<div id="emailPreivew-content">
|
|
72
|
-
<div className="email-preview-container">
|
|
73
|
-
{enableShowAllDevices && (
|
|
74
|
-
<CapButton
|
|
75
|
-
type="flat"
|
|
76
|
-
onClick={this.onClickShowInAllDevices}
|
|
77
|
-
>
|
|
78
|
-
View in all devices
|
|
79
|
-
</CapButton>
|
|
80
|
-
)}
|
|
81
|
-
<div className={"shell align-center"}>
|
|
82
|
-
<img src={mobileBody} alt="capillary" width="60%" />
|
|
83
|
-
<div className={messageContainerName}>
|
|
84
|
-
<iframe srcDoc={templateContent} {...deviceAspectRatio.mobile} >
|
|
85
|
-
<p><FormattedMessage {...messages.noIframeSupport}/></p>
|
|
86
|
-
</iframe>
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
</div>
|
|
93
|
-
{this.props.templateData &&
|
|
94
|
-
[
|
|
95
|
-
<p className="preview-info"><FormattedMessage {...messages.lastModified} />: {moment(this.props.templateData.updatedAt).format('MM-DD-YYYY')}</p>,
|
|
96
|
-
<p style={{marginBottom: '8px'}} className="preview-info"><FormattedMessage {...messages.uploadedBy} /> : {this.props.templateData.updatedByName}</p>,
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
</CapSpin>
|
|
100
|
-
)}
|
|
101
|
-
</div>
|
|
102
|
-
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
EmailMobilePreview.propTypes = {
|
|
109
|
-
templateContent: PropTypes.string,
|
|
110
|
-
templateData: PropTypes.object,
|
|
111
|
-
templateActions: PropTypes.object,
|
|
112
|
-
onClickShowInAllDevices: PropTypes.func,
|
|
113
|
-
enableShowAllDevices: PropTypes.bool,
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
EmailMobilePreview.defaultProps = {
|
|
117
|
-
showDeviceSelection: true,
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const mapStateToProps = (state, props) => createStructuredSelector({
|
|
121
|
-
templateContent: props.templateData ? selectTemplateContent() : () => props.templateContent, // when props has templateContent that means preview with content
|
|
122
|
-
});
|
|
123
|
-
function mapDispatchToProps(dispatch) {
|
|
124
|
-
return {
|
|
125
|
-
templateActions: bindActionCreators(templateActions, dispatch),
|
|
126
|
-
};
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export default connect(mapStateToProps, mapDispatchToProps)(EmailMobilePreview);
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
$classPrefix: email-mobile-preview-container;
|
|
2
|
-
.#{$classPrefix}{
|
|
3
|
-
#emailPreivew-container {
|
|
4
|
-
position: relative;
|
|
5
|
-
// padding: 0 24px 0 24px;
|
|
6
|
-
overflow-y: auto;
|
|
7
|
-
// font-family: 'proxima-nova';
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
#emailPreivew-content-wrapper{
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 90%;
|
|
12
|
-
// display: table;
|
|
13
|
-
|
|
14
|
-
#emailPreivew-content {
|
|
15
|
-
.device-wrapper {
|
|
16
|
-
display: inline-flex;
|
|
17
|
-
margin-bottom: 8px;
|
|
18
|
-
margin-top: 16px;
|
|
19
|
-
.device-name {
|
|
20
|
-
padding: 6px 24px;
|
|
21
|
-
background: #E6F0FB;
|
|
22
|
-
border: 2px solid #E6F0FB;
|
|
23
|
-
font-family: "open-sans";
|
|
24
|
-
line-height: 20px;
|
|
25
|
-
font-size: 14px;
|
|
26
|
-
color: #4E92E5;
|
|
27
|
-
cursor: pointer;
|
|
28
|
-
}
|
|
29
|
-
.active {
|
|
30
|
-
background: #FFFFFF !important;
|
|
31
|
-
border: 2px solid #E6F0FB;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
.email-preview-container{
|
|
36
|
-
|
|
37
|
-
.mobile-message-container {
|
|
38
|
-
position: absolute;
|
|
39
|
-
top: 10.3%;
|
|
40
|
-
left: 24%;
|
|
41
|
-
overflow: auto;
|
|
42
|
-
display: -webkit-box;
|
|
43
|
-
display: -ms-flexbox;
|
|
44
|
-
display: flex;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
padding: 0 0px 0 24px;
|
|
48
|
-
// display: table-cell;
|
|
49
|
-
// vertical-align: middle;
|
|
50
|
-
text-align: center;
|
|
51
|
-
margin-bottom: 36px;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
$classPrefix: email-preview-v2;
|
|
2
|
-
.#{$classPrefix}{
|
|
3
|
-
#emailPreivew-container {
|
|
4
|
-
position: relative;
|
|
5
|
-
// padding: 0 24px 0 24px;
|
|
6
|
-
overflow-y: auto;
|
|
7
|
-
// font-family: 'proxima-nova';
|
|
8
|
-
overflow: hidden;
|
|
9
|
-
|
|
10
|
-
#email-iframe {
|
|
11
|
-
width: -webkit-fill-available;
|
|
12
|
-
}
|
|
13
|
-
#emailPreivew-content-wrapper{
|
|
14
|
-
width: 100%;
|
|
15
|
-
height: 90%;
|
|
16
|
-
// display: table;
|
|
17
|
-
|
|
18
|
-
#emailPreivew-content {
|
|
19
|
-
.device-wrapper {
|
|
20
|
-
display: inline-flex;
|
|
21
|
-
margin-bottom: 8px;
|
|
22
|
-
margin-top: 16px;
|
|
23
|
-
.device-name {
|
|
24
|
-
padding: 6px 24px;
|
|
25
|
-
background: #E6F0FB;
|
|
26
|
-
border: 2px solid #E6F0FB;
|
|
27
|
-
font-family: "open-sans";
|
|
28
|
-
line-height: 20px;
|
|
29
|
-
font-size: 14px;
|
|
30
|
-
color: #4E92E5;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
}
|
|
33
|
-
.active {
|
|
34
|
-
background: #FFFFFF !important;
|
|
35
|
-
border: 2px solid #E6F0FB;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
.email-preview-container{
|
|
40
|
-
.tablet-message-container {
|
|
41
|
-
position: absolute;
|
|
42
|
-
top: 9%;
|
|
43
|
-
left: 10%;
|
|
44
|
-
width: 100%;
|
|
45
|
-
height: 100%;
|
|
46
|
-
overflow: auto;
|
|
47
|
-
display: -webkit-box;
|
|
48
|
-
display: -ms-flexbox;
|
|
49
|
-
display: flex;
|
|
50
|
-
}
|
|
51
|
-
.mobile-message-container {
|
|
52
|
-
position: absolute;
|
|
53
|
-
top: 10.3%;
|
|
54
|
-
left: 14%;
|
|
55
|
-
overflow: auto;
|
|
56
|
-
display: -webkit-box;
|
|
57
|
-
display: -ms-flexbox;
|
|
58
|
-
display: flex;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
padding: 0 0px 0 24px;
|
|
62
|
-
// display: table-cell;
|
|
63
|
-
// vertical-align: middle;
|
|
64
|
-
text-align: center;
|
|
65
|
-
margin-bottom: 36px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|