Toggle navigation
Toggle navigation
This project
Loading...
Sign in
mobile
/
YH_RNComponent
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
盖剑秋
8 years ago
Commit
fa177fe4f02a6c774f140ad0ce304c8a0b0f559d
1 parent
dddd920d
Optimize code for guang list. reviewed by Boss Mei.
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
js/guang/components/list/List.js
js/guang/components/list/ListCell.js
js/guang/reducers/list/listInitialState.js
js/guang/components/list/List.js
View file @
fa177fe
...
...
@@ -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
(
...
...
js/guang/components/list/ListCell.js
View file @
fa177fe
...
...
@@ -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
,
...
...
js/guang/reducers/list/listInitialState.js
View file @
fa177fe
...
...
@@ -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
;
...
...
Please
register
or
login
to post a comment