MyContent.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. *+------------------------------------------------------------------------+
  3. *| Licensed Materials - Property of IBM
  4. *| IBM Cognos Products: Content Explorer
  5. *| (C) Copyright IBM Corp. 2015, 2018
  6. *|
  7. *| US Government Users Restricted Rights - Use, duplication or disclosure
  8. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  9. *+------------------------------------------------------------------------+
  10. */
  11. import * as React from 'react';
  12. import PropTypes from 'prop-types';
  13. import ContentList from '../ContentList/ContentList';
  14. import ListUtils from '../../utils/ListUtils';
  15. class MyContent extends React.Component {
  16. static propTypes = {
  17. glassContext: PropTypes.object,
  18. rootSlideout: PropTypes.object,
  19. DateTimeUtils: PropTypes.object,
  20. l10n: PropTypes.object,
  21. i18nFormatter: PropTypes.object,
  22. contentView: PropTypes.object,
  23. contentType: PropTypes.string
  24. };
  25. constructor(props) {
  26. super(props);
  27. const options = {
  28. glassContext: props.glassContext
  29. };
  30. this.listUtils = new ListUtils(options);
  31. }
  32. render() {
  33. const { contentType } = this.props;
  34. const contentURL = contentType === 'myContent' ? this.listUtils.getMyContentURL() : this.listUtils.getTeamContentURL();
  35. return (
  36. <ContentList {...this.props} contentType={contentType} dataURL={contentURL}/>
  37. );
  38. }
  39. }
  40. export default MyContent;