Skip to content

Commit 43113d4

Browse files
authored
Merge pull request #2987 from StoDevX/android-tableview-sections
Fix up the background color of Section on Android
2 parents 48dc35b + 554cedb commit 43113d4

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

modules/tableview/index.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,26 @@
11
// @flow
22

3+
import * as React from 'react'
4+
import {Platform} from 'react-native'
5+
import {androidLightBackground} from '@frogpond/colors'
6+
7+
import {
8+
TableView,
9+
Section as IosSection,
10+
Cell,
11+
} from 'react-native-tableview-simple'
12+
313
export * from './cells'
4-
export {TableView, Section, Cell} from 'react-native-tableview-simple'
14+
15+
let AndroidSection = props => (
16+
<IosSection sectionTintColor={androidLightBackground} {...props} />
17+
)
18+
let Section
19+
20+
if (Platform.OS === 'android') {
21+
Section = AndroidSection
22+
} else {
23+
Section = IosSection
24+
}
25+
26+
export {TableView, Section, Cell}

source/views/settings/screens/overview/login-credentials.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
import {type ReduxState} from '../../../../redux'
1414
import {connect} from 'react-redux'
1515
import noop from 'lodash/noop'
16-
import {sectionBgColor} from '@frogpond/colors'
1716

1817
type ReduxStateProps = {
1918
initialUsername: string,
@@ -72,7 +71,6 @@ class CredentialsLoginSection extends React.Component<Props, State> {
7271
<Section
7372
footer="St. Olaf login enables the &quot;meals remaining&quot; feature."
7473
header="ST. OLAF LOGIN"
75-
sectionTintColor={sectionBgColor}
7674
>
7775
{loggedIn ? (
7876
<Cell title={`Logged in as ${username}.`} />

source/views/settings/screens/overview/miscellany.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import {Section, PushButtonCell} from '@frogpond/tableview'
44
import {type NavigationScreenProp} from 'react-navigation'
55
import {trackedOpenUrl} from '@frogpond/open-url'
66
import * as Icons from '@hawkrives/react-native-alternate-icons'
7-
import {sectionBgColor} from '@frogpond/colors'
87
import {GH_BASE_URL} from '../../../../lib/constants'
98

109
type Props = {navigation: NavigationScreenProp<*>}
@@ -40,7 +39,7 @@ export class MiscellanySection extends React.Component<Props, State> {
4039

4140
render() {
4241
return (
43-
<Section header="MISCELLANY" sectionTintColor={sectionBgColor}>
42+
<Section header="MISCELLANY">
4443
{this.state.canChangeIcon ? (
4544
<PushButtonCell
4645
onPress={this.onAppIconButton}

source/views/settings/screens/overview/odds-and-ends.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {appVersion, appBuild} from '@frogpond/constants'
55
import {setFeedbackStatus} from '../../../../redux/parts/settings'
66
import type {ReduxState} from '../../../../redux'
77
import {connect} from 'react-redux'
8-
import {sectionBgColor} from '@frogpond/colors'
98

109
type Props = {}
1110

@@ -15,7 +14,7 @@ export class OddsAndEndsSection extends React.Component<Props> {
1514
let build = appBuild()
1615

1716
return (
18-
<Section header="ODDS &amp; ENDS" sectionTintColor={sectionBgColor}>
17+
<Section header="ODDS &amp; ENDS">
1918
<Cell cellStyle="RightDetail" detail={version} title="Version" />
2019
{build && (
2120
<Cell cellStyle="RightDetail" detail={build} title="Build Number" />

source/views/settings/screens/overview/support.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {sendEmail} from '../../../../components/send-email'
77
import DeviceInfo from 'react-native-device-info'
88
import {appVersion, appBuild} from '@frogpond/constants'
99
import {refreshApp} from '../../../../lib/refresh'
10-
import {sectionBgColor} from '@frogpond/colors'
1110

1211
type Props = {navigation: NavigationScreenProp<*>}
1312

@@ -52,7 +51,7 @@ export class SupportSection extends React.Component<Props> {
5251

5352
render() {
5453
return (
55-
<Section header="SUPPORT" sectionTintColor={sectionBgColor}>
54+
<Section header="SUPPORT">
5655
<PushButtonCell onPress={openEmail} title="Contact Us" />
5756
<PushButtonCell onPress={this.onFaqButton} title="FAQs" />
5857
<PushButtonCell onPress={this.onResetButton} title="Reset Everything" />

0 commit comments

Comments
 (0)