Authored by 盖剑秋

Optimize code for guang list. reviewed by Boss Mei.

... ... @@ -44,9 +44,11 @@ export default class List extends Component {
renderRow(rowData,sectionID,rowID) {
let type = this.props.data.get('type');
let categoryMap = this.props.data.get('categoryMap').toJS();
return(
<ListCell
resource={rowData}
categoryMap={categoryMap}
type={type}
rowID={rowID}
onPressCell={this.props.onPressCell}
... ... @@ -63,9 +65,9 @@ export default class List extends Component {
let isFetching = articles.get('isFetching');
if (!list || !list.size) {
return <LoadingIndicator
return (<LoadingIndicator
isVisible={isFetching}
/>;
/>);
}
return (
... ...
... ... @@ -58,14 +58,7 @@ export default class List extends Component {
}
render() {
let tagMap = {
'潮品' :require('../../image/chaopin_icon.png'),
'话题' :require('../../image/huati_icon.png'),
'潮人' :require('../../image/chaoren_icon.png'),
'搭配' :require('../../image/dapei_icon.png'),
'小贴士' :require('../../image/xiaotieshi_icon.png'),
'专题' :require('../../image/zuanti_icon.png')
};
let tagMap = this.props.categoryMap;
let {
browse,
category_name,
... ...
... ... @@ -22,6 +22,14 @@ let InitialState = Record({
total: 0,
endReached: false,
})),
categoryMap: new (Record({
'潮品' :require('../../image/chaopin_icon.png'),
'话题' :require('../../image/huati_icon.png'),
'潮人' :require('../../image/chaoren_icon.png'),
'搭配' :require('../../image/dapei_icon.png'),
'小贴士' :require('../../image/xiaotieshi_icon.png'),
'专题' :require('../../image/zuanti_icon.png')
})),
});
export default InitialState;
... ...