2021-02-11 20:01:04 +00:00
|
|
|
import React from 'react'
|
2021-02-11 21:44:37 +00:00
|
|
|
import { Link } from 'react-router-dom'
|
|
|
|
import { START_GAME } from '../store/actions'
|
|
|
|
import { connect } from 'react-redux'
|
2021-02-11 20:01:04 +00:00
|
|
|
|
2021-02-11 21:44:37 +00:00
|
|
|
const Homepage = (props) => {
|
2021-02-11 20:01:04 +00:00
|
|
|
return (
|
2021-02-12 10:31:40 +00:00
|
|
|
<div className='Homepage'>
|
2021-02-11 20:01:04 +00:00
|
|
|
<h1>Homepage</h1>
|
2021-02-11 21:44:37 +00:00
|
|
|
<Link to='/play'><button onClick={props.onStartGame}>START GAME</button></Link>
|
2021-02-11 20:01:04 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-02-11 21:44:37 +00:00
|
|
|
const mapDispatchToProps = (dispatch) => {
|
|
|
|
return {
|
|
|
|
onStartGame: () => dispatch({type: START_GAME})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(null, mapDispatchToProps)(Homepage)
|