import React, { Component } from 'react' import { Switch, Route, matchPath } from 'react-router-dom' import PropTypes from 'prop-types' import classnames from 'classnames' import NewAccountCreateForm from './new-account.container' import NewAccountImportForm from './import-account' import ConnectHardwareForm from './connect-hardware' import { NEW_ACCOUNT_ROUTE, IMPORT_ACCOUNT_ROUTE, CONNECT_HARDWARE_ROUTE, } from '../../helpers/constants/routes' 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('connect') }
) } render () { return (
{this.renderTabs()}
) } } CreateAccountPage.propTypes = { location: PropTypes.object, history: PropTypes.object, t: PropTypes.func, } CreateAccountPage.contextTypes = { t: PropTypes.func, }