@capillarytech/creatives-library 6.12.0 → 6.12.1

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@capillarytech/creatives-library",
3
3
  "author": "meharaj",
4
- "version": "6.12.0",
4
+ "version": "6.12.1",
5
5
  "description": "Capillary creatives ui",
6
6
  "main": "./index.js",
7
7
  "module": "./index.es.js",
@@ -3,18 +3,15 @@ import { FormattedMessage } from 'react-intl';
3
3
  import { CapRow, CapHeading } from '@capillarytech/cap-ui-library';
4
4
  import messages from './messages';
5
5
 
6
- const AccessForbidden = () => {
7
- console.log('NIKHIL access');
8
- return (
9
- <CapRow className="margin-t-32 text-align-center">
10
- <CapHeading type="h2">
11
- <FormattedMessage {...messages.forbiddenHeader} />
12
- </CapHeading>
13
- <CapHeading type="h3" className="margin-t-24">
14
- <FormattedMessage {...messages.forbiddenDesc} />
15
- </CapHeading>
16
- </CapRow>
17
- );
18
- };
6
+ const AccessForbidden = () => (
7
+ <CapRow className="margin-t-32 text-align-center">
8
+ <CapHeading type="h2">
9
+ <FormattedMessage {...messages.forbiddenHeader} />
10
+ </CapHeading>
11
+ <CapHeading type="h3" className="margin-t-24">
12
+ <FormattedMessage {...messages.forbiddenDesc} />
13
+ </CapHeading>
14
+ </CapRow>
15
+ );
19
16
 
20
17
  export default AccessForbidden;
@@ -217,13 +217,12 @@ export class TemplatesV2 extends React.Component { // eslint-disable-line react/
217
217
  return this.props.Templates.loadingTemplates;
218
218
  }
219
219
  render() {
220
- const { isFullMode, className, authData = {}} = this.props;
221
- const { accessiblePermissions = []} = authData.user || {};
220
+ const { isFullMode, className, cap = {}} = this.props;
221
+ const { accessiblePermissions = []} = cap.user || {};
222
222
  let isCreativeAccessible = true;
223
223
  if (!accessiblePermissions.includes(CREATIVES_UI_VIEW)) {
224
224
  isCreativeAccessible = false;
225
225
  }
226
-
227
226
  return (
228
227
  !isCreativeAccessible ? <AccessForbidden /> : (
229
228
  <div className={`${className} creatives-templates-container ${isFullMode ? 'fullmode' : 'library-mode'}`}>
@@ -267,7 +266,6 @@ TemplatesV2.propTypes = {
267
266
  onFacebookSubmit: PropTypes.func,
268
267
  messageDetails: PropTypes.object,
269
268
  cap: PropTypes.object,
270
- authData: PropTypes.object,
271
269
  };
272
270
 
273
271
  TemplatesV2.defaultProps = {