Last active
August 29, 2015 14:18
-
-
Save natew/0072ca690f379d175f9f to your computer and use it in GitHub Desktop.
coffeescript 2.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, Reapp, View, NestedViewList, List from 'reapp' | |
import RefreshButton, RotatingLoadingIcon, ArticleItem | |
Article | |
@state = { refreshing: false } | |
mount | |
:articlesHotLoad | |
refresh | |
:articlesHotRefresh <> @state.refreshing | |
load | |
:articlesHotLoadMore <> @state.refreshing | |
render | |
articles = @hotArticles | |
article = @[email protected] | |
NestedViewList @props.viewListProps | |
View title="Hot Articles" titleRight=<RefreshButton onTap=@handleRefresh [email protected] /> | |
if articles | |
<div style=styles.iconContainer> | |
<RotatingLoadingIcon /> | |
</div> | |
else | |
List | |
articles.map(article, i => | |
ArticleItem article=store.getIn(['articles', article, 'data']) | |
List.Item styles=styles.loadMore onTap=@handleLoadMore | |
Load More | |
props.child({ article }) | |
styles = | |
iconContainer: | |
padding: 20 | |
marginLeft: -10 | |
loadMore: | |
content: | |
textAlign: 'center' | |
padding: 20 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment