Skip to content

Commit 0a0db6b

Browse files
author
soliury
committed
topic pull refresh ci
1 parent 4e5e12c commit 0a0db6b

7 files changed

Lines changed: 33 additions & 15 deletions

File tree

app/containers/Home.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ var {
1616
View,
1717
Component,
1818
PropTypes,
19-
Text,
2019
StyleSheet,
2120
Image,
22-
ActivityIndicatorIOS
2321
} = React
2422

2523
class Home extends Component {

ios/noder/AppDelegate.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
3131
* on the same Wi-Fi network.
3232
*/
3333

34-
jsCodeLocation = [NSURL URLWithString:@"http://172.18.141.131:8081/index.ios.bundle?platform=ios&dev=true"];
34+
jsCodeLocation = [NSURL URLWithString:@"http://169.254.221.161:8081/index.ios.bundle?platform=ios&dev=true"];
3535

3636
/**
3737
* OPTION 2

src/components/TopicList.js

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import React, {
55
Text,
66
ListView,
77
Dimensions,
8-
PropTypes
8+
PropTypes,
9+
RefreshControl
910
} from 'react-native';
1011
import TopicRow from './TopicRow';
1112
import moment from 'moment';
1213

1314

14-
const { height, width } = Dimensions.get('window');
15+
const {height, width} = Dimensions.get('window');
1516

1617

1718
class TopicList extends Component {
@@ -43,8 +44,9 @@ class TopicList extends Component {
4344
}
4445
}
4546

46-
_onScroll(e) {
4747

48+
_onRefresh() {
49+
4850
}
4951

5052

@@ -133,7 +135,16 @@ class TopicList extends Component {
133135
scrollRenderAheadDistance={90}
134136
dataSource={this.state.ds}
135137
renderRow={this.renderRow.bind(this)}
136-
onScroll={this._onScroll.bind(this)}
138+
refreshControl={
139+
<RefreshControl
140+
refreshing={this.state.isRefreshing}
141+
onRefresh={this._onRefresh.bind(this)}
142+
tintColor="rgba(241,196,15, 1)"
143+
title="Loading..."
144+
colors={['#ff0000', '#00ff00', '#0000ff']}
145+
progressBackgroundColor="#ffff00"
146+
/>
147+
}
137148
/>
138149
</View>
139150
)

src/layouts/Home.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import UserOverlay from '../components/UserOverlay';
1313
import MessageOverlay from '../components/MessageOverlay';
1414
import ScrollableTabs from '../components/ScrollableTabs';
1515
import TopicList from '../components/TopicList';
16-
import config from '../configs';
1716

1817

1918
const { height, width } = Dimensions.get('window');

src/reducers/home.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
import * as types from '../constants/ActionTypes';
22

3+
const tabs = ['good', 'ask', 'all', 'share', 'job'];
34

4-
const initialState = {
5-
loginModalVisible: false
5+
let initialState = {
6+
tabStatus: {}
67
};
78

9+
tabs.forEach((item)=> {
10+
initialState.tabStatus[item] = {
11+
pullRefreshPending: false,
12+
reachedEndPending: false,
13+
page: 0,
14+
limit: 10
15+
}
16+
});
17+
818

919
export default function (state = initialState, action) {
10-
const { payload, error, meta, type } = action;
20+
const {payload, error, meta, type} = action;
1121

1222
switch (type) {
1323
case types.OPEN_LOGIN_MODAL:

src/reducers/topicUI.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ const initialState = {
88
};
99

1010
export default function (state = initialState, action) {
11-
const { type, meta={} } = action;
12-
const { sequence={} } = meta;
13-
const { id } = meta;
11+
const {type, meta={}} = action;
12+
const {sequence={}} = meta;
13+
const {id} = meta;
1414
const status = sequence.type;
1515

1616
switch (type) {

src/store/configureStore.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ var middlewares = [
1616

1717

1818
if (__DEV__) {
19-
middlewares.push(logger());
19+
// middlewares.push(logger());
2020
}
2121

2222

0 commit comments

Comments
 (0)