FitTrackee/mpwo_client/src/components/Admin/AdminSports.jsx

35 lines
620 B
React
Raw Normal View History

2018-01-28 22:36:13 +01:00
import React from 'react'
import { connect } from 'react-redux'
2018-04-29 18:23:46 +02:00
import { getData } from '../../actions/index'
2018-04-30 11:29:29 +02:00
import AdminPage from './AdminPage'
2018-04-29 18:23:46 +02:00
2018-01-28 22:36:13 +01:00
class AdminSports extends React.Component {
2018-04-29 18:23:46 +02:00
componentDidMount() {
this.props.loadSport()
}
2018-01-28 22:36:13 +01:00
render() {
2018-04-29 18:23:46 +02:00
const { sports } = this.props
2018-01-28 22:36:13 +01:00
return (
<div>
2018-04-30 11:29:29 +02:00
<AdminPage
data={sports}
target="sports"
/>
2018-01-28 22:36:13 +01:00
</div>
)
}
}
export default connect(
state => ({
2018-04-30 11:29:29 +02:00
sports: state.sports,
2018-01-28 22:36:13 +01:00
user: state.user,
2018-04-29 18:23:46 +02:00
}),
dispatch => ({
loadSport: () => {
dispatch(getData('sports'))
},
2018-01-28 22:36:13 +01:00
})
)(AdminSports)