diff --git a/dockerfiles/docker-compose.yml b/dockerfiles/docker-compose.yml index c4fe130e..716b58be 100644 --- a/dockerfiles/docker-compose.yml +++ b/dockerfiles/docker-compose.yml @@ -13,10 +13,10 @@ services: volumes: - ${CURRENT_DIR}:/app/src/addons/${ADDON_PATH}/ environment: - # RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone + RAZZLE_INTERNAL_API_PATH: http://backend:8080/Plone # In case that you want to connect to and outside (non-docker) local instance # coment the above, use the next line - RAZZLE_INTERNAL_API_PATH: http://host.docker.internal:8080/Plone + # RAZZLE_INTERNAL_API_PATH: http://host.docker.internal:8080/Plone RAZZLE_API_PATH: http://127.0.0.1:8080/Plone HOST: 0.0.0.0 depends_on: diff --git a/news/236.bugfix b/news/236.bugfix new file mode 100644 index 00000000..5ed41559 --- /dev/null +++ b/news/236.bugfix @@ -0,0 +1 @@ +Fix anontools in header, convert it to functional @sneridagh diff --git a/src/components/Anontools/Anontools.jsx b/src/components/Anontools/Anontools.jsx index d43511ed..bfdb97e3 100644 --- a/src/components/Anontools/Anontools.jsx +++ b/src/components/Anontools/Anontools.jsx @@ -1,79 +1,53 @@ // SemanticUI-free pre-@plone/components -// Refactor when https://github.com/plone/volto/pull/4845 is merged -import React, { Component } from 'react'; import PropTypes from 'prop-types'; -import { connect } from 'react-redux'; import { Link } from 'react-router-dom'; import { FormattedMessage } from 'react-intl'; +import { flattenToAppURL } from '@plone/volto/helpers'; import config from '@plone/volto/registry'; +import { useSelector, shallowEqual } from 'react-redux'; -/** - * Anontools container class. - */ -export class Anontools extends Component { - /** - * Property types. - * @property {Object} propTypes Property types. - * @static - */ - static propTypes = { - token: PropTypes.string, - content: PropTypes.shape({ - '@id': PropTypes.string, - }), - }; +const Anontools = () => { + const token = useSelector((state) => state.userSession.token, shallowEqual); + const content = useSelector((state) => state.content.data, shallowEqual); - /** - * Default properties. - * @property {Object} defaultProps Default properties. - * @static - */ - static defaultProps = { - token: null, - content: { - '@id': null, - }, - }; + const { settings } = config; - /** - * Render method. - * @method render - * @returns {string} Markup for the component. - */ - render() { - const { settings } = config; - return ( - !this.props.token && ( -