1
0
mirror of https://github.com/mizanxali/uno-online synced 2025-12-06 10:13:27 +00:00

Initialized Redux store, created reducer function and Game component

This commit is contained in:
Mizanali Panjwani
2021-02-12 03:14:37 +05:30
parent 0726342e15
commit a83c6635c7
4 changed files with 120 additions and 6 deletions

View File

@@ -1,11 +1,21 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { START_GAME } from '../store/actions'
import { connect } from 'react-redux'
const Homepage = () => {
const Homepage = (props) => {
return (
<div>
<h1>Homepage</h1>
<Link to='/play'><button onClick={props.onStartGame}>START GAME</button></Link>
</div>
)
}
export default Homepage
const mapDispatchToProps = (dispatch) => {
return {
onStartGame: () => dispatch({type: START_GAME})
}
}
export default connect(null, mapDispatchToProps)(Homepage)