Browse Source

Add developerMode settings

master
Gaëtan Renaudeau 7 years ago
parent
commit
11989902f7
  1. 12
      src/components/SettingsPage/sections/Profile.js
  2. 4
      src/reducers/settings.js
  3. 1
      src/types/common.js
  4. 2
      static/i18n/en/settings.yml

12
src/components/SettingsPage/sections/Profile.js

@ -95,6 +95,12 @@ class TabProfile extends PureComponent<Props, State> {
}
}
handleDeveloperMode = developerMode => {
this.props.saveSettings({
developerMode,
})
}
render() {
const { t, settings } = this.props
const {
@ -121,6 +127,12 @@ class TabProfile extends PureComponent<Props, State> {
<CheckBox isChecked={isPasswordEnabled} onChange={this.handleChangePasswordCheck} />
</Box>
</Row>
<Row
title={t('settings:profile.developerMode')}
desc={t('settings:profile.developerModeDesc')}
>
<CheckBox isChecked={settings.developerMode} onChange={this.handleDeveloperMode} />
</Row>
<Row title={t('settings:profile.reset')} desc={t('settings:profile.resetDesc')}>
<Button danger onClick={this.handleOpenHardResetModal}>
{t('settings:profile.resetButton')}

4
src/reducers/settings.js

@ -21,6 +21,7 @@ export type SettingsState = {
[currencyId: string]: CurrencySettings,
},
region: string,
developerMode: boolean,
}
/* have to check if available for all OS */
@ -40,6 +41,7 @@ const defaultState: SettingsState = {
marketIndicator: 'western',
currenciesSettings: {},
region,
developerMode: false,
}
const CURRENCY_DEFAULTS_SETTINGS: CurrencySettings = {
@ -78,6 +80,8 @@ export const getCounterValueCode = (state: State) => state.settings.counterValue
export const counterValueCurrencySelector = (state: State): ?Currency =>
findCurrencyByTicker(getCounterValueCode(state))
export const developerModeSelector = (state: State): boolean => state.settings.developerMode
export const getLanguage = (state: State) => state.settings.language
export const localeSelector = (state: State) => {

1
src/types/common.js

@ -40,6 +40,7 @@ export type Settings = {
marketIndicator: 'eastern' | 'western',
currenciesSettings: CurrenciesSettings,
region: string,
developerMode: boolean,
}
export type T = (?string, ?Object) => string

2
static/i18n/en/settings.yml

@ -46,6 +46,8 @@ profile:
reset: Reset application
resetDesc: Lorem ipsum dolor sit amet
resetButton: Hard reset
developerMode: Developer Mode
developerModeDesc: Enable visibility of developer apps & currencies like Bitcoin Testnet
about:
faq: FAQ
faqDesc: Lorem ipsum dolor sit amet

Loading…
Cancel
Save