Browse Source

Merge pull request #556 from NastiaS/minorFixesBranch

Minor fixes branch
master
Meriadec Pillet 7 years ago
committed by GitHub
parent
commit
f63a4dc26f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/components/Onboarding/steps/Analytics.js
  2. 5
      src/components/SettingsPage/sections/Profile.js
  3. 4
      src/reducers/settings.js

14
src/components/Onboarding/steps/Analytics.js

@ -2,7 +2,8 @@
import React, { PureComponent } from 'react' import React, { PureComponent } from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import { connect } from 'react-redux'
import { saveSettings } from 'actions/settings'
import Box from 'components/base/Box' import Box from 'components/base/Box'
import CheckBox from 'components/base/CheckBox' import CheckBox from 'components/base/CheckBox'
import { Title, Description } from '../helperComponents' import { Title, Description } from '../helperComponents'
@ -10,6 +11,8 @@ import OnboardingFooter from '../OnboardingFooter'
import type { StepProps } from '..' import type { StepProps } from '..'
const mapDispatchToProps = { saveSettings }
type State = { type State = {
analyticsToggle: boolean, analyticsToggle: boolean,
termsConditionsToggle: boolean, termsConditionsToggle: boolean,
@ -17,9 +20,9 @@ type State = {
} }
const INITIAL_STATE = { const INITIAL_STATE = {
analyticsToggle: false, analyticsToggle: true,
termsConditionsToggle: false, termsConditionsToggle: false,
sentryLogsToggle: false, sentryLogsToggle: true,
} }
class Analytics extends PureComponent<StepProps, State> { class Analytics extends PureComponent<StepProps, State> {
@ -100,7 +103,10 @@ class Analytics extends PureComponent<StepProps, State> {
} }
} }
export default Analytics export default connect(
null,
mapDispatchToProps,
)(Analytics)
export const AnalyticsText = styled(Box).attrs({ export const AnalyticsText = styled(Box).attrs({
ff: 'Open Sans|Regular', ff: 'Open Sans|Regular',

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

@ -160,7 +160,10 @@ class TabProfile extends PureComponent<Props, State> {
title={t('app:settings.profile.developerMode')} title={t('app:settings.profile.developerMode')}
desc={t('app:settings.profile.developerModeDesc')} desc={t('app:settings.profile.developerModeDesc')}
> >
<CheckBox isChecked={settings.developerMode} onChange={this.handleDeveloperMode} /> <CheckBox
isChecked={settings.developerMode}
onChange={developerMode => saveSettings({ developerMode })}
/>
</Row> </Row>
<Row <Row
title={t('app:settings.profile.reportErrors')} title={t('app:settings.profile.reportErrors')}

4
src/reducers/settings.js

@ -72,7 +72,7 @@ const INITIAL_STATE: SettingsState = {
region, region,
developerMode: !!process.env.__DEV__, developerMode: !!process.env.__DEV__,
loaded: false, loaded: false,
shareAnalytics: false, shareAnalytics: true,
sentryLogs: true, sentryLogs: true,
lastUsedVersion: __APP_VERSION__, lastUsedVersion: __APP_VERSION__,
} }
@ -119,7 +119,6 @@ const handlers: Object = {
) => ({ ) => ({
...state, ...state,
...settings, ...settings,
developerMode: settings.developerMode || !!process.env.__DEV__,
}), }),
FETCH_SETTINGS: ( FETCH_SETTINGS: (
state: SettingsState, state: SettingsState,
@ -127,7 +126,6 @@ const handlers: Object = {
) => ({ ) => ({
...state, ...state,
...settings, ...settings,
developerMode: settings.developerMode || !!process.env.__DEV__,
loaded: true, loaded: true,
}), }),
} }

Loading…
Cancel
Save