FitTrackee/mpwo_client/src/components/Admin/AdminSports.jsx
2018-04-30 11:29:29 +02:00

35 lines
620 B
JavaScript

import React from 'react'
import { connect } from 'react-redux'
import { getData } from '../../actions/index'
import AdminPage from './AdminPage'
class AdminSports extends React.Component {
componentDidMount() {
this.props.loadSport()
}
render() {
const { sports } = this.props
return (
<div>
<AdminPage
data={sports}
target="sports"
/>
</div>
)
}
}
export default connect(
state => ({
sports: state.sports,
user: state.user,
}),
dispatch => ({
loadSport: () => {
dispatch(getData('sports'))
},
})
)(AdminSports)