Skip to content
Open
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
1 change: 0 additions & 1 deletion ios/NativeStarterKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
Expand Down
33 changes: 27 additions & 6 deletions js/components/splashscreen/index.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@

import React, { Component } from 'react';
import { Image } from 'react-native';
import { connect } from 'react-redux';
import { actions } from 'react-native-navigation-redux-helpers';

const launchscreen = require('../../../images/shadow.png');

export default class SplashPage extends Component {
import { setIndex } from '../../actions/list';

const {
replaceAt,
} = actions;

class SplashPage extends Component {

static propTypes = {
navigator: React.PropTypes.shape({}),
navigation: React.PropTypes.shape({
key: React.PropTypes.string,
}),
}

componentWillMount() {
const navigator = this.props.navigator;
console.log('splash, willMount, props: ', this.props);
setTimeout(() => {
navigator.replace({
id: 'login',
});
this.props.replaceAt('splashscreen', { key: 'login' }, this.props.navigation.key);
}, 1500);
}

Expand All @@ -25,3 +33,16 @@ export default class SplashPage extends Component {
);
}
}

function bindAction(dispatch) {
return {
replaceAt: (routeKey, route, key) => dispatch(replaceAt(routeKey, route, key)),
setIndex: index => dispatch(setIndex(index)),
};
}

const mapStateToProps = state => ({
navigation: state.cardNavigation,
});

export default connect(mapStateToProps, bindAction)(SplashPage);
2 changes: 1 addition & 1 deletion js/reducers/cardNavigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const initialState = {
index: 0,
routes: [
{
key: 'login',
key: 'splashscreen',
index: 0,
},
],
Expand Down