From f2489c8f27dc7565f0803ac4b7e979060a2a0fad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Renaudeau?= Date: Sat, 30 Jun 2018 10:36:09 +0200 Subject: [PATCH] Refactor settings sections --- src/components/SettingsPage/AboutRowItem.js | 1 - src/components/SettingsPage/ResetButton.js | 4 +- src/components/SettingsPage/index.js | 6 -- src/components/SettingsPage/sections/About.js | 20 +++++ .../SettingsPage/sections/Display.js | 37 +++++++- .../SettingsPage/sections/Profile.js | 84 ------------------- src/config/constants.js | 3 + 7 files changed, 60 insertions(+), 95 deletions(-) delete mode 100644 src/components/SettingsPage/sections/Profile.js diff --git a/src/components/SettingsPage/AboutRowItem.js b/src/components/SettingsPage/AboutRowItem.js index 012c809e..096f2c3a 100644 --- a/src/components/SettingsPage/AboutRowItem.js +++ b/src/components/SettingsPage/AboutRowItem.js @@ -9,7 +9,6 @@ export default class AboutRowItem extends PureComponent<{ url: string, title: string, desc: string, - url: string, }> { onClick = () => shell.openExternal(this.props.url) diff --git a/src/components/SettingsPage/ResetButton.js b/src/components/SettingsPage/ResetButton.js index e86d0f38..25943e73 100644 --- a/src/components/SettingsPage/ResetButton.js +++ b/src/components/SettingsPage/ResetButton.js @@ -70,12 +70,12 @@ class ResetButton extends PureComponent { } } -export const IconWrapperCircle = styled(Box).attrs({})` +export const IconWrapperCircle = styled(Box)` width: 50px; height: 50px; border-radius: 50%; background: #ea2e4919; - text-align: -webkit-center; + text-align: center; justify-content: center; ` diff --git a/src/components/SettingsPage/index.js b/src/components/SettingsPage/index.js index 9686884a..51faedbf 100644 --- a/src/components/SettingsPage/index.js +++ b/src/components/SettingsPage/index.js @@ -13,7 +13,6 @@ import Pills from 'components/base/Pills' import Box from 'components/base/Box' import SectionDisplay from './sections/Display' import SectionCurrencies from './sections/Currencies' -import SectionProfile from './sections/Profile' import SectionAbout from './sections/About' import SectionTools from './sections/Tools' @@ -48,11 +47,6 @@ class SettingsPage extends PureComponent { label: props.t('app:settings.tabs.currencies'), value: SectionCurrencies, }, - { - key: 'profile', - label: props.t('app:settings.tabs.profile'), - value: SectionProfile, - }, { key: 'about', label: props.t('app:settings.tabs.about'), diff --git a/src/components/SettingsPage/sections/About.js b/src/components/SettingsPage/sections/About.js index 382fd1e0..53042723 100644 --- a/src/components/SettingsPage/sections/About.js +++ b/src/components/SettingsPage/sections/About.js @@ -5,6 +5,10 @@ import { translate } from 'react-i18next' import type { T } from 'types/common' import TrackPage from 'analytics/TrackPage' import IconHelp from 'icons/Help' + +import ExportLogsBtn from 'components/ExportLogsBtn' +import CleanButton from '../CleanButton' +import ResetButton from '../ResetButton' import ReleaseNotesButton from '../ReleaseNotesButton' import AboutRowItem from '../AboutRowItem' @@ -39,6 +43,22 @@ class SectionAbout extends PureComponent { + + + + + + + + + + { )} - - + + {EXPERIMENTAL_MARKET_INDICATOR_SETTINGS ? ( + + + + ) : null} + + + + + + + + + + + + diff --git a/src/components/SettingsPage/sections/Profile.js b/src/components/SettingsPage/sections/Profile.js deleted file mode 100644 index 801e9835..00000000 --- a/src/components/SettingsPage/sections/Profile.js +++ /dev/null @@ -1,84 +0,0 @@ -// @flow -import React, { Component } from 'react' -import { translate } from 'react-i18next' -import type { T } from 'types/common' - -import TrackPage from 'analytics/TrackPage' -import ExportLogsBtn from 'components/ExportLogsBtn' -import IconUser from 'icons/User' -import DisablePasswordButton from '../DisablePasswordButton' -import DevModeButton from '../DevModeButton' -import SentryLogsButton from '../SentryLogsButton' -import ShareAnalyticsButton from '../ShareAnalyticsButton' -import CleanButton from '../CleanButton' -import ResetButton from '../ResetButton' - -import { - SettingsSection as Section, - SettingsSectionHeader as Header, - SettingsSectionBody as Body, - SettingsSectionRow as Row, -} from '../SettingsSection' - -type Props = { - t: T, -} - -class TabProfile extends Component { - render() { - const { t } = this.props - return ( -
- -
} - title={t('app:settings.tabs.profile')} - desc={t('app:settings.display.desc')} - /> - - - - - - - - - - - - - - - - - - - - - - - -
- ) - } -} - -export default translate()(TabProfile) diff --git a/src/config/constants.js b/src/config/constants.js index cf58d14b..43007d85 100644 --- a/src/config/constants.js +++ b/src/config/constants.js @@ -81,6 +81,9 @@ export const EXPERIMENTAL_CENTER_MODAL = boolFromEnv('EXPERIMENTAL_CENTER_MODAL' export const EXPERIMENTAL_FIRMWARE_UPDATE = boolFromEnv('EXPERIMENTAL_FIRMWARE_UPDATE') export const EXPERIMENTAL_HTTP_ON_RENDERER = boolFromEnv('EXPERIMENTAL_HTTP_ON_RENDERER') export const EXPERIMENTAL_TOOLS_SETTINGS = boolFromEnv('EXPERIMENTAL_TOOLS_SETTINGS') +export const EXPERIMENTAL_MARKET_INDICATOR_SETTINGS = boolFromEnv( + 'EXPERIMENTAL_MARKET_INDICATOR_SETTINGS', +) // Other constants