1
0
mirror of https://github.com/mizanxali/uno-online synced 2024-09-28 17:11:00 +00:00
uno-online/src/components/Homepage.js

22 lines
555 B
JavaScript
Raw Normal View History

2021-02-11 20:01:04 +00:00
import React from 'react'
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
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>
<Link to='/play'><button onClick={props.onStartGame}>START GAME</button></Link>
2021-02-11 20:01:04 +00:00
</div>
)
}
const mapDispatchToProps = (dispatch) => {
return {
onStartGame: () => dispatch({type: START_GAME})
}
}
export default connect(null, mapDispatchToProps)(Homepage)