You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

35 lines
814 B

import { Component } from 'react';
import { connect } from 'react-redux';
import * as ModeActions from './actions/mode.actions';
import Board from './components/board/board.component';
import Welcome from './components/welcome/welcome.component';
export const SETTINGS = {
GRID_WIDTH: 3,
GRID_HEIGHT: 3,
LIVES: 3
};
export default class App extends Component {
render() {
const { mode, dispatch } = this.props;
console.log(dispatch)
switch (this.props.mode) {
case ModeActions.WELCOME:
return <Welcome />;
case ModeActions.BOARD:
return <Board dispatch={this.props.dispatch} />;
}
};
};
const select = (state) => {
return {
mode: state.mode
}
};
export default connect(select)(App);