|
|
|
import React, {Component} from 'react';
|
|
|
|
import {NavigationContainer} from '@react-navigation/native';
|
|
|
|
import {createStackNavigator} from '@react-navigation/stack';
|
|
|
|
import {connect} from 'react-redux';
|
|
|
|
import {squareRef} from 'SquareNav';
|
|
|
|
|
|
|
|
import Home from '../components/Home';
|
|
|
|
import Game from '../components/Game';
|
|
|
|
import HighScore from '../components/HighScore';
|
|
|
|
import Settings from '../components/Settings';
|
|
|
|
import Splash from '../components/Splash';
|
|
|
|
|
|
|
|
const SquareNav = createStackNavigator();
|
|
|
|
|
|
|
|
class SquareStack extends Component {
|
|
|
|
render() {
|
|
|
|
let noHeader = {headerShown: false};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<NavigationContainer ref={squareRef}>
|
|
|
|
<SquareNav.Navigator initialRouteName="Splash">
|
|
|
|
<SquareNav.Screen
|
|
|
|
name="Splash"
|
|
|
|
component={Splash}
|
|
|
|
options={noHeader}
|
|
|
|
/>
|
|
|
|
<SquareNav.Screen
|
|
|
|
name="Home"
|
|
|
|
component={Home}
|
|
|
|
options={noHeader}
|
|
|
|
/>
|
|
|
|
<SquareNav.Screen
|
|
|
|
name="HighScore"
|
|
|
|
component={HighScore}
|
|
|
|
options={noHeader}
|
|
|
|
/>
|
|
|
|
<SquareNav.Screen
|
|
|
|
name="Settings"
|
|
|
|
component={Settings}
|
|
|
|
options={noHeader}
|
|
|
|
/>
|
|
|
|
<SquareNav.Screen
|
|
|
|
name="Game"
|
|
|
|
component={Game}
|
|
|
|
options={noHeader}
|
|
|
|
/>
|
|
|
|
</SquareNav.Navigator>
|
|
|
|
</NavigationContainer>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function mapStateToProps(state) {
|
|
|
|
return {
|
|
|
|
Navigation: state.Navigation
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function mapDispatchToProps(dispatch) {
|
|
|
|
return {dispatch: dispatch};
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(SquareStack)
|