11/* eslint-disable no-shadow */
22import React , { Component } from 'react' ;
3+ import styled from 'styled-components/native' ;
34import { connect } from 'react-redux' ;
45import { bindActionCreators } from 'redux' ;
56import {
@@ -46,14 +47,6 @@ const styles = StyleSheet.create({
4647 color : colors . black ,
4748 ...fonts . fontPrimary ,
4849 } ,
49- listSubTitle : {
50- color : colors . greyDark ,
51- ...fonts . fontPrimary ,
52- } ,
53- logoutTitle : {
54- color : colors . red ,
55- ...fonts . fontPrimary ,
56- } ,
5750 update : {
5851 flex : 1 ,
5952 alignItems : 'center' ,
@@ -73,14 +66,20 @@ const styles = StyleSheet.create({
7366 paddingRight : 7 ,
7467 color : colors . black , // random any color for the correct display emoji
7568 } ,
69+ } ) ;
70+
71+ const StyledListItem = styled ( ListItem ) . attrs ( {
7672 containerStyle : {
77- paddingTop : 0 ,
78- paddingBottom : 0 ,
79- height : 45 ,
80- justifyContent : 'center' ,
81- alignItems : 'center' ,
73+ borderBottomColor : colors . greyLight ,
74+ borderBottomWidth : 1 ,
8275 } ,
83- } ) ;
76+ titleStyle : props => ( {
77+ color : props . signOut ? colors . red : colors . black ,
78+ ...fonts . fontPrimary ,
79+ } ) ,
80+ underlayColor : colors . greyLight ,
81+ hideChevron : props => props . hideChevron ,
82+ } ) `` ;
8483
8584const updateText = locale => ( {
8685 check : translate ( 'auth.profile.codePushCheck' , locale ) ,
@@ -167,7 +166,7 @@ class UserOptions extends Component {
167166 data = { languages }
168167 renderItem = { ( { item } ) => {
169168 return (
170- < ListItem
169+ < StyledListItem
171170 title = {
172171 < View style = { styles . language } >
173172 < Text style = { styles . flag } >
@@ -176,12 +175,9 @@ class UserOptions extends Component {
176175 < Text style = { styles . listTitle } > { item . name } </ Text >
177176 </ View >
178177 }
179- titleStyle = { styles . listTitle }
180- containerStyle = { styles . containerStyle }
181178 hideChevron = { locale !== item . code }
182179 rightIcon = { { name : 'check' } }
183180 onPress = { ( ) => changeLocale ( item . code ) }
184- underlayColor = { colors . greyLight }
185181 />
186182 ) ;
187183 } }
@@ -191,36 +187,29 @@ class UserOptions extends Component {
191187 </ SectionList >
192188
193189 < SectionList >
194- < ListItem
190+ < StyledListItem
195191 title = { translate ( 'common.openInBrowser' , locale ) }
196- titleStyle = { styles . listTitle }
197192 onPress = { ( ) => openURLInView ( this . props . user . html_url ) }
198- underlayColor = { colors . greyLight }
199193 />
200194
201- < ListItem
195+ < StyledListItem
202196 title = { translate ( 'auth.userOptions.privacyPolicy' , locale ) }
203- titleStyle = { styles . listTitle }
204197 onPress = { ( ) =>
205198 navigation . navigate ( 'PrivacyPolicy' , {
206199 title : translate ( 'auth.privacyPolicy.title' , locale ) ,
207200 locale,
208201 } ) }
209- underlayColor = { colors . greyLight }
210202 />
211- < ListItem
203+ < StyledListItem
212204 title = { translate ( 'auth.userOptions.donate' , locale ) }
213- titleStyle = { styles . listTitle }
214205 onPress = { ( ) =>
215206 openURLInView ( 'https://opencollective.com/git-point' ) }
216- underlayColor = { colors . greyLight }
217207 />
218- < ListItem
208+ < StyledListItem
219209 title = { translate ( 'auth.userOptions.signOut' , locale ) }
220- titleStyle = { styles . logoutTitle }
221210 hideChevron
222211 onPress = { ( ) => this . signOutUser ( ) }
223- underlayColor = { colors . greyLight }
212+ signOut
224213 />
225214 </ SectionList >
226215
0 commit comments