diff --git a/src/components/manage/Blocks/ChildrenLinks/Edit.jsx b/src/components/manage/Blocks/ChildrenLinks/Edit.jsx index dca5cf80..0a49ed82 100644 --- a/src/components/manage/Blocks/ChildrenLinks/Edit.jsx +++ b/src/components/manage/Blocks/ChildrenLinks/Edit.jsx @@ -7,8 +7,8 @@ import { compose } from 'redux'; import { connect } from 'react-redux'; import { getParentFolderData } from '~/actions'; import { Link } from 'react-router-dom'; -import _ from 'lodash' - +import _ from 'lodash'; +import { getBasePath } from '~/helpers'; class Edit extends Component { /** @@ -31,20 +31,18 @@ class Edit extends Component { constructor(props) { super(props); - this.state = { - }; + this.state = {}; } componentDidUpdate(prevProps) { if (prevProps.childrenLinks !== this.props.childrenLinks) { - this.onEditData() + this.onEditData(); } } - handleLinkData = (link) => { - this.props.getParentFolderData(link.value) - - } + handleLinkData = link => { + this.props.getParentFolderData(link.value); + }; onEditData() { const childrenLinks = this.props.childrenLinks; @@ -55,44 +53,44 @@ class Edit extends Component { } render() { - const childrenLinks = this.props.data.links; - + console.log('props in childrenlist', this.props); return ( {childrenLinks && - childrenLinks.map(child => + childrenLinks.map(child => (
- + {_.capitalize(child.title)}
- ) - } + ))}
-

Search page

- +

Search page

+
); } } - - const mapDispatchToProps = { getParentFolderData, -} +}; export default compose( injectIntl, connect( state => ({ state, - childrenLinks: state.parent_folder_data.items + childrenLinks: state.parent_folder_data.items, }), mapDispatchToProps, - ) -)(Edit) \ No newline at end of file + ), +)(Edit); diff --git a/src/components/manage/Blocks/ChildrenLinks/View.jsx b/src/components/manage/Blocks/ChildrenLinks/View.jsx index 07d08b0f..8bb16a10 100644 --- a/src/components/manage/Blocks/ChildrenLinks/View.jsx +++ b/src/components/manage/Blocks/ChildrenLinks/View.jsx @@ -8,40 +8,42 @@ import PropTypes from 'prop-types'; import { injectIntl } from 'react-intl'; import { Grid } from 'semantic-ui-react'; import { Link } from 'react-router-dom'; -import _ from 'lodash' +import _ from 'lodash'; +import { getBasePath } from '~/helpers'; -class View extends Component { - /** - * Property types. - * @property {Object} propTypes Property types. - * @static - */ - static propTypes = { - data: PropTypes.objectOf(PropTypes.any).isRequired, - // pathname: PropTypes.string.isRequired, - }; - - render() { - const childrenLinks = this.props.data.links - return ( -
- - {childrenLinks && - childrenLinks.map(child => -
- - {_.capitalize(child.title)} - - -
+class View extends Component { + /** + * Property types. + * @property {Object} propTypes Property types. + * @static + */ + static propTypes = { + data: PropTypes.objectOf(PropTypes.any).isRequired, + // pathname: PropTypes.string.isRequired, + }; - ) - } -
-
- ); - } + render() { + const childrenLinks = this.props.data.links; + return ( +
+ + {childrenLinks && + childrenLinks.map(child => ( +
+ + {_.capitalize(child.title)} + +
+ ))} +
+
+ ); + } } export default injectIntl(View);