aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages/settings/index.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2018-09-21 14:33:04 +0800
committerGitHub <noreply@github.com>2018-09-21 14:33:04 +0800
commit04988eca5e98f0dcead3d85f6806bcf48ab09cfc (patch)
tree218e23f6d85717ca5efe33d50ddea3ad8a842627 /ui/app/components/pages/settings/index.js
parentd493ec6dc44ce53265c757a1a57dc23baca1efca (diff)
parent01166b26edc5b979e5cbc7fe76df6fbfc272bea7 (diff)
downloadtangerine-wallet-browser-04988eca5e98f0dcead3d85f6806bcf48ab09cfc.tar.gz
tangerine-wallet-browser-04988eca5e98f0dcead3d85f6806bcf48ab09cfc.tar.zst
tangerine-wallet-browser-04988eca5e98f0dcead3d85f6806bcf48ab09cfc.zip
Merge pull request #5241 from MetaMask/refactor-settings
Refactor settings page to use JSX and follow component file folder st…
Diffstat (limited to 'ui/app/components/pages/settings/index.js')
-rw-r--r--ui/app/components/pages/settings/index.js65
1 files changed, 1 insertions, 64 deletions
diff --git a/ui/app/components/pages/settings/index.js b/ui/app/components/pages/settings/index.js
index aee17e0e8..44a9ffa63 100644
--- a/ui/app/components/pages/settings/index.js
+++ b/ui/app/components/pages/settings/index.js
@@ -1,64 +1 @@
-const { Component } = require('react')
-const { Switch, Route, matchPath } = require('react-router-dom')
-const PropTypes = require('prop-types')
-const h = require('react-hyperscript')
-const TabBar = require('../../tab-bar')
-const Settings = require('./settings')
-const Info = require('./info')
-const { DEFAULT_ROUTE, SETTINGS_ROUTE, INFO_ROUTE } = require('../../../routes')
-
-class Config extends Component {
- renderTabs () {
- const { history, location } = this.props
-
- return h('div.settings__tabs', [
- h(TabBar, {
- tabs: [
- { content: this.context.t('settings'), key: SETTINGS_ROUTE },
- { content: this.context.t('info'), key: INFO_ROUTE },
- ],
- isActive: key => matchPath(location.pathname, { path: key, exact: true }),
- onSelect: key => history.push(key),
- }),
- ])
- }
-
- render () {
- const { history } = this.props
-
- return (
- h('.main-container.settings', {}, [
- h('.settings__header', [
- h('div.settings__close-button', {
- onClick: () => history.push(DEFAULT_ROUTE),
- }),
- this.renderTabs(),
- ]),
- h(Switch, [
- h(Route, {
- exact: true,
- path: INFO_ROUTE,
- component: Info,
- }),
- h(Route, {
- exact: true,
- path: SETTINGS_ROUTE,
- component: Settings,
- }),
- ]),
- ])
- )
- }
-}
-
-Config.propTypes = {
- location: PropTypes.object,
- history: PropTypes.object,
- t: PropTypes.func,
-}
-
-Config.contextTypes = {
- t: PropTypes.func,
-}
-
-module.exports = Config
+export { default } from './settings.component'