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 styled from 'styled-components'
import { connect } from 'react-redux'
import { saveSettings } from 'actions/settings'
import Box from 'components/base/Box'
import CheckBox from 'components/base/CheckBox'
import { Title, Description } from '../helperComponents'
@ -10,6 +11,8 @@ import OnboardingFooter from '../OnboardingFooter'
import type { StepProps } from '..'
const mapDispatchToProps = { saveSettings }
type State = {
analyticsToggle: boolean,
termsConditionsToggle: boolean,
@ -17,9 +20,9 @@ type State = {
}
const INITIAL_STATE = {
analyticsToggle: false,
analyticsToggle: true,
termsConditionsToggle: false,
sentryLogsToggle: false,
sentryLogsToggle: true,
}
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({
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')}
desc={t('app:settings.profile.developerModeDesc')}
>
<CheckBox isChecked={settings.developerMode} onChange={this.handleDeveloperMode} />
<CheckBox
isChecked={settings.developerMode}
onChange={developerMode => saveSettings({ developerMode })}
/>
</Row>
<Row
title={t('app:settings.profile.reportErrors')}

4
src/reducers/settings.js

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

Loading…
Cancel
Save