Skip to content

Upgrade to react-native 0.33.0 #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Sep 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions App/Components/SpinnerLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import {
PixelRatio,
View,
PropTypes,
ActivityIndicator,
} from 'react-native';

import cssVar from '../Lib/cssVar';

import ActivityIndicator from '../Platform/ActivityIndicator';

const SpinnerLoader = React.createClass({
propTypes: {
spinning: React.PropTypes.bool,
Expand Down
42 changes: 33 additions & 9 deletions App/Mixins/KeyboardListener.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import React from 'react';
import KeyboardEvents from 'react-native-keyboardevents';
var KeyboardEventEmitter = KeyboardEvents.Emitter;

import {
Keyboard,
} from 'react-native';


var KeyboardListener = {
getInitialState: function() {
Expand All @@ -13,9 +16,13 @@ var KeyboardListener = {
return this.state.keyboardSpace > 0;
},

updateKeyboardSpace: function(frames) {
if (this.isMounted() && frames && frames.end) {
this.setState({keyboardSpace: frames.end.height});
isKeyboardVisible: function() {
return this.state.keyboardSpace > 0;
},

updateKeyboardSpace: function(e) {
if (this.isMounted() && e && e.endCoordinates) {
this.setState({keyboardSpace: e.endCoordinates.height});
}
},

Expand All @@ -25,15 +32,32 @@ var KeyboardListener = {
}
},

// onKeyboardHideCallback: function() {
// // TODO handle case when the keyboard never showed up in the first place
// // Might want to use state to check that it did showed up
// if (this.params.onKeyboardHide) {
// this.params.onKeyboardHide.call(this.originalComponent());
// }
// },


componentDidMount: function() {
KeyboardEventEmitter.on(KeyboardEvents.KeyboardDidShowEvent, this.updateKeyboardSpace);
KeyboardEventEmitter.on(KeyboardEvents.KeyboardWillHideEvent, this.resetKeyboardSpace);
this._keyboardSubscriptions = [];
this._keyboardSubscriptions.push(Keyboard.addListener('keyboardWillShow', this.updateKeyboardSpace));
this._keyboardSubscriptions.push(Keyboard.addListener('keyboardDidShow', this.updateKeyboardSpace));
this._keyboardSubscriptions.push(Keyboard.addListener('keyboardWillHide', this.resetKeyboardSpace));
this._keyboardSubscriptions.push(Keyboard.addListener('keyboardDidHide', this.resetKeyboardSpace));
//if (this.params.onKeyboardHide) {
// this._keyboardSubscriptions.push(Keyboard.addListener('keyboardDidHide', this.onKeyboardHideCallback));
//}
},

componentWillUnmount: function() {
KeyboardEventEmitter.off(KeyboardEvents.KeyboardDidShowEvent, this.updateKeyboardSpace);
KeyboardEventEmitter.off(KeyboardEvents.KeyboardWillHideEvent, this.resetKeyboardSpace);
this._keyboardSubscriptions.forEach((subscription) => {
subscription.remove();
});
},

};

export default KeyboardListener;
8 changes: 0 additions & 8 deletions App/Platform/ActivityIndicator.js

This file was deleted.

12 changes: 9 additions & 3 deletions App/Stores/CurrentUserStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,17 @@ var SingletonStore = assign({}, EventEmitter.prototype, {
Dispatcher.register(function(action) {
switch(action.actionType) {
case AppConstants.APP_LAUNCHED:
Keychain.getGenericPassword(KEYCHAIN_SERVICE, function(keychainError, username, token) {
LocalKeyStore.getKey(LOCAL_STORE_KEY, function(storeError, props) {
initSingleton(props, token, username);
Keychain.getGenericPassword(KEYCHAIN_SERVICE).then((values) => {
const { username, password } = values || {};
// password is the stored token.
LocalKeyStore.getKey(LOCAL_STORE_KEY, (storeError, props) => {
initSingleton(props, password, username);
SingletonStore.emitChange();
});
}).catch((error) => {
console.log(error);
initSingleton({}, null, null);
SingletonStore.emitChange();
});
break;
case AppConstants.LOGIN_USER:
Expand Down
213 changes: 0 additions & 213 deletions App/Vendor/react-native-refreshable-listview/README.md

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
import {
View,
Text,
ActivityIndicatorIOS,
ActivityIndicator,
StyleSheet,
} from 'react-native';

Expand All @@ -19,7 +19,7 @@ var RefreshingIndicator = React.createClass({
},
getDefaultProps() {
return {
activityIndicatorComponent: ActivityIndicatorIOS,
activityIndicatorComponent: ActivityIndicator,
}
},
renderActivityIndicator(style) {
Expand Down
Loading