@@ -14,6 +14,8 @@ import px2dp from '../../utils/px2dp';
1414import Avatar from '../../components/Avatar' ;
1515import colors from '../../constants/colors' ;
1616import { connect } from 'react-redux'
17+ import { bindActionCreators } from 'redux' ;
18+ import * as Actions from '../../actions/modifySettings' ;
1719import ShareUtil from '../../utils/ShareUtil' ;
1820
1921import ThemeColorPage from './ThemeColorPage' ;
@@ -27,6 +29,7 @@ class MoreFragment extends Component{
2729 }
2830
2931 render ( ) {
32+ const { actions, mainThemeColor, isOpenThumbnail} = this . props ;
3033 return (
3134 < View style = { styles . container } >
3235 < NavigationBar title = "更多" />
@@ -50,13 +53,13 @@ class MoreFragment extends Component{
5053 < RowItem title = "首页内容展示顺序" icon = "md-reorder" iconColor = 'lightskyblue' onPress = { this . _itemClickCallback . bind ( this , 1 ) } />
5154 < RowItem title = "自定义主题" icon = "md-brush" iconColor = { colors . orange } onPress = { this . _itemClickCallback . bind ( this , 2 ) } />
5255 { /*<RowItem title="选择语言 / Language" icon="md-globe" iconColor={colors.purple} onPress={this._itemClickCallback.bind(this, 3)}/>*/ }
53- < RowItemWithSwitcher title = "夜间模式" icon = "md-moon" iconColor = "#7b68ee" renderSegment = { false } onTintColor = { this . props . mainThemeColor } />
56+ < RowItemWithSwitcher title = "夜间模式" icon = "md-moon" iconColor = "#7b68ee" onTintColor = { mainThemeColor } switcherValue = { false } />
57+ < RowItemWithSwitcher title = "显示列表缩略图" icon = "md-browsers" iconColor = 'plum' onTintColor = { mainThemeColor } switcherValue = { isOpenThumbnail } onValueChange = { ( value ) => actions . changeShowThumbnail ( value ) } renderSegment = { false } />
5458 </ View >
5559 < View style = { styles . block } >
5660 < RowItem title = "关于作者" icon = "md-happy" iconColor = "#9acd32" renderSegment = { false } onPress = { this . _itemClickCallback . bind ( this , 4 ) } />
5761 </ View >
5862 < View style = { styles . block } >
59- < RowItemWithSwitcher title = "显示列表缩略图" icon = "md-browsers" iconColor = 'plum' onTintColor = { this . props . mainThemeColor } switcherValue = { false } />
6063 < RowItem title = "反馈" icon = "md-text" iconColor = { colors . lightGreen } onPress = { this . _itemClickCallback . bind ( this , 6 ) } isShowRightArrow = { false } />
6164 < RowItem title = "分享" icon = "md-share" iconColor = { colors . orangeRed } renderSegment = { false } onPress = { this . _itemClickCallback . bind ( this , 7 ) } isShowRightArrow = { false } />
6265 </ View >
@@ -161,8 +164,15 @@ const styles = StyleSheet.create({
161164
162165const mapStateToProps = ( state ) => {
163166 return {
164- mainThemeColor : state . settingState . mainThemeColor
167+ mainThemeColor : state . settingState . mainThemeColor ,
168+ isOpenThumbnail : state . settingState . isOpenThumbnail
165169 } ;
166170} ;
167171
168- export default connect ( mapStateToProps ) ( MoreFragment ) ;
172+ const mapDispatchToProps = ( dispatch ) => {
173+ return {
174+ actions : bindActionCreators ( Actions , dispatch )
175+ } ;
176+ } ;
177+
178+ export default connect ( mapStateToProps , mapDispatchToProps ) ( MoreFragment ) ;
0 commit comments