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.
34 lines
936 B
34 lines
936 B
import { Component } from 'react';
|
|
import { connect } from 'react-redux';
|
|
|
|
import * as ModeActions from './actions/mode.actions';
|
|
|
|
import Welcome from './components/welcome/welcome.component';
|
|
import HighScore from './components/high-score/high-score.component';
|
|
import Options from './components/options/options.component';
|
|
import Board from './components/board/board.component';
|
|
|
|
export class App extends Component {
|
|
render() {
|
|
const { mode } = this.props;
|
|
|
|
switch (this.props.mode) {
|
|
case ModeActions.WELCOME:
|
|
return <Welcome />;
|
|
case ModeActions.HIGHSCORE:
|
|
return <HighScore />;
|
|
case ModeActions.OPTIONS:
|
|
return <Options />
|
|
case ModeActions.BOARD:
|
|
return <Board />;
|
|
}
|
|
};
|
|
};
|
|
|
|
const select = (state) => {
|
|
return {
|
|
mode: state.mode
|
|
}
|
|
};
|
|
|
|
export default connect(select)(App);
|
|
|