import React, { PureComponent } from 'react' import PropTypes from 'prop-types' import { Switch, Route, matchPath, withRouter } from 'react-router-dom' import { ENVIRONMENT_TYPE_POPUP } from '../../../../app/scripts/lib/enums' import { getEnvironmentType } from '../../../../app/scripts/lib/util' import TabBar from '../../components/app/tab-bar' import c from 'classnames' import SettingsTab from './settings-tab' import NetworksTab from './networks-tab' import AdvancedTab from './advanced-tab' import InfoTab from './info-tab' import SecurityTab from './security-tab' import { DEFAULT_ROUTE, ADVANCED_ROUTE, SECURITY_ROUTE, GENERAL_ROUTE, ABOUT_US_ROUTE, SETTINGS_ROUTE, NETWORKS_ROUTE, } from '../../helpers/constants/routes' const ROUTES_TO_I18N_KEYS = { [GENERAL_ROUTE]: 'general', [ADVANCED_ROUTE]: 'advanced', [SECURITY_ROUTE]: 'securityAndPrivacy', [ABOUT_US_ROUTE]: 'about', } class SettingsPage extends PureComponent { static propTypes = { location: PropTypes.object, history: PropTypes.object, t: PropTypes.func, } static contextTypes = { t: PropTypes.func, } isCurrentPath (pathname) { return this.props.location.pathname === pathname } render () { const { t } = this.context const { history, location } = this.props const pathnameI18nKey = ROUTES_TO_I18N_KEYS[location.pathname] const isPopupView = getEnvironmentType(location.href) === ENVIRONMENT_TYPE_POPUP return (