diff --git a/src/components/theme/Header/Header.jsx b/src/components/theme/Header/Header.jsx index 491f92d2ca4..7ffb29aff75 100644 --- a/src/components/theme/Header/Header.jsx +++ b/src/components/theme/Header/Header.jsx @@ -16,37 +16,8 @@ import { SearchWidget, } from '@plone/volto/components'; -/** - * Header component class. - * @class Header - * @extends Component - */ -class Header extends Component { - /** - * Property types. - * @property {Object} propTypes Property types. - * @static - */ - static propTypes = { - token: PropTypes.string, - pathname: PropTypes.string.isRequired, - }; - - /** - * Default properties. - * @property {Object} defaultProps Default properties. - * @static - */ - static defaultProps = { - token: null, - }; - /** - * Render method. - * @method render - * @returns {string} Markup for the component. - */ - render() { +const Header = ({pathname, token}) => { return ( @@ -55,11 +26,11 @@ class Header extends Component {
- +
- {!this.props.token && ( + {!token && (
@@ -73,7 +44,16 @@ class Header extends Component { ); } -} + + Header.propTypes = { + token: PropTypes.string, + pathname: PropTypes.string.isRequired, + }; + + Header.defaultProps = { + token: null, + }; + export default connect((state) => ({ token: state.userSession.token,