import React, { Component } from 'react' import { Switch, Route, matchPath } from 'react-router-dom' import PropTypes from 'prop-types' import classnames from 'classnames' import { NEW_ACCOUNT_ROUTE, IMPORT_ACCOUNT_ROUTE, CONNECT_HARDWARE_ROUTE, } from '../../helpers/constants/routes' import NewAccountCreateForm from './new-account.container' import NewAccountImportForm from './import-account' import ConnectHardwareForm from './connect-hardware' export default class CreateAccountPage extends Component { renderTabs () { const { history, location: { pathname } } = this.props const getClassNames = (path) => classnames('new-account__tabs__tab', { 'new-account__tabs__selected': matchPath(pathname, { path, exact: true, }), }) return (
history.push(NEW_ACCOUNT_ROUTE)}> {this.context.t('create')}
history.push(IMPORT_ACCOUNT_ROUTE)}> {this.context.t('import')}
history.push(CONNECT_HARDWARE_ROUTE)}> {this.context.t('hardware')}
) } render () { return (
{this.renderTabs()}
) } } CreateAccountPage.propTypes = { location: PropTypes.object, history: PropTypes.object, } CreateAccountPage.contextTypes = { t: PropTypes.func, }