@capillarytech/creatives-library 2.0.4 → 2.0.5

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.
@@ -8,21 +8,17 @@ import PropTypes from 'prop-types';
8
8
 
9
9
  import React from 'react';
10
10
  import { connect } from 'react-redux';
11
- import { FormattedMessage, injectIntl } from 'react-intl';
11
+ import { injectIntl } from 'react-intl';
12
12
  import { createStructuredSelector } from 'reselect';
13
13
  import { bindActionCreators } from 'redux';
14
- import { CapTab, CapCustomCard, CapIcons, CapSpin, CapButton } from '@capillarytech/cap-ui-library';
14
+ import { CapTab, CapCard, CapIcons, CapButton } from '@capillarytech/cap-ui-library';
15
15
  import { find } from 'lodash';
16
16
  import { UserIsAuthenticated } from '../../utils/authWrapper';
17
17
  import { makeSelectTemplates, makeSelectTemplatesResponse } from '../Templates/selectors';
18
18
  import messages from './messages';
19
- import ChannelTemplates from '../ChannelTemplates';
20
19
  import * as actions from './actions';
21
- import * as commonUtil from '../../utils/common';
22
- import PreviewSideBar from '../../components/PreviewSideBar';
23
20
  import Templates from '../Templates';
24
- const { CapCustomCardGrid } = CapCustomCard;
25
- const { Message, View } = CapIcons;
21
+ const { View } = CapIcons;
26
22
 
27
23
  export class TemplatesV2 extends React.Component { // eslint-disable-line react/prefer-stateless-function
28
24
  constructor(props) {
@@ -38,23 +34,20 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
38
34
  };
39
35
  }
40
36
 
41
-
42
37
  getTemplateDataForGrid = ({templates, handlers, filterContent}) => {
43
38
  const cardDataList = templates.map((template) => (
44
39
  {
45
- icon: <Message />,
46
40
  title: template.name,
47
41
  content: template.versions.base['sms-editor'],
48
- options: <View onClick={() => { this.props.isFullMode ? handlers.handlePreviewClick(template) : this.props.handlePeviewTemplate(template); }} />,
42
+ extra: [<View onClick={() => { this.props.isFullMode ? handlers.handlePreviewClick(template) : this.props.handlePeviewTemplate(template); }} />],
49
43
  hoverOption: <CapButton onClick={(e) => handlers.handleEditClick(e, template._id)}>{this.props.intl.formatMessage(this.props.isFullMode ? messages.edit : messages.select)}</CapButton>,
50
44
  }));
51
45
  return (<div>
52
46
  {filterContent}
53
- <CapCustomCardGrid cardDataList={cardDataList} />
47
+ <CapCard cardList={cardDataList} type="SMS" />
54
48
  </div>);
55
49
  }
56
50
  getTemplatesComponent(channel) {
57
- const notFoundMessage = `No ${channel} templates found`;
58
51
  // const templates = this.props.Templates[`${channel}Templates`];
59
52
  let query = {};
60
53
  if (!this.props.isFullMode) {
@@ -105,15 +98,14 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
105
98
  }
106
99
 
107
100
  TemplatesV2.propTypes = {
108
- actions: PropTypes.object.isRequired,
109
- location: PropTypes.object,
101
+ router: PropTypes.object,
110
102
  isFullMode: PropTypes.bool,
111
- handlePreview: PropTypes.func,
112
103
  onSelectTemplate: PropTypes.func,
113
104
  createNew: PropTypes.func,
114
105
  channel: PropTypes.string,
115
106
  Templates: PropTypes.object,
116
107
  TemplatesList: PropTypes.arrayOf(PropTypes.object),
108
+ handlePeviewTemplate: PropTypes.func,
117
109
  };
118
110
 
119
111
  TemplatesV2.defaultProps = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "2.0.4",
4
+ "version": "2.0.5",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -13,7 +13,7 @@
13
13
  "license": "LicenseRef-LICENSE",
14
14
  "dependencies": {
15
15
  "@capillarytech/cap-react-ui-library": "latest",
16
- "@capillarytech/cap-ui-library": "^1.0.32",
16
+ "@capillarytech/cap-ui-library": "^1.0.33",
17
17
  "antd": "^3.13.1",
18
18
  "axios": "^0.16.2",
19
19
  "babel-polyfill": "6.20.0",
@@ -65,4 +65,4 @@
65
65
  "warning": "3.0.0",
66
66
  "whatwg-fetch": "2.0.1"
67
67
  }
68
- }
68
+ }