import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { Trans, withNamespaces } from 'react-i18next'; import Menu from './Menu'; import Version from './Version'; import logo from '../ui/svg/logo.svg'; import './Header.css'; class Header extends Component { state = { isMenuOpen: false, }; toggleMenuOpen = () => { this.setState(prevState => ({ isMenuOpen: !prevState.isMenuOpen })); }; closeMenu = () => { this.setState({ isMenuOpen: false }); }; render() { const { dashboard, getVersion, location } = this.props; const { isMenuOpen } = this.state; const badgeClass = classnames({ 'badge dns-status': true, 'badge-success': dashboard.protectionEnabled, 'badge-danger': !dashboard.protectionEnabled, }); return (