1 changed files with 63 additions and 0 deletions
@ -0,0 +1,63 @@ |
|||
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}> |
|||
<MainNav.Navigator initialRouteName="Splash"> |
|||
<MainNav.Screen |
|||
name="Splash" |
|||
component={Splash} |
|||
options={noHeader} |
|||
/> |
|||
<MainNav.Screen |
|||
name="Home" |
|||
component={Home} |
|||
options={noHeader} |
|||
/> |
|||
<MainNav.Screen |
|||
name="HighScore" |
|||
component={HighScore} |
|||
options={noHeader} |
|||
/> |
|||
<MainNav.Screen |
|||
name="Settings" |
|||
component={Settings} |
|||
options={noHeader} |
|||
/> |
|||
<MainNav.Screen |
|||
name="Game" |
|||
component={Game} |
|||
options={noHeader} |
|||
/> |
|||
</MainNav.Navigator> |
|||
</NavigationContainer> |
|||
) |
|||
} |
|||
} |
|||
|
|||
function mapStateToProps(state) { |
|||
return { |
|||
Navigation: state.Navigation |
|||
} |
|||
} |
|||
|
|||
function mapDispatchToProps(dispatch) { |
|||
return {dispatch: dispatch}; |
|||
} |
|||
|
|||
export default connect(mapStateToProps, mapDispatchToProps)(SquareStack) |
Loading…
Reference in new issue