Client: admin init
This commit is contained in:
30
mpwo_client/src/components/Admin/index.jsx
Normal file
30
mpwo_client/src/components/Admin/index.jsx
Normal file
@ -0,0 +1,30 @@
|
||||
import React from 'react'
|
||||
import { Helmet } from 'react-helmet'
|
||||
import { connect } from 'react-redux'
|
||||
|
||||
import AccessDenied from './../Others/AccessDenied'
|
||||
|
||||
class Admin extends React.Component {
|
||||
componentDidMount() {}
|
||||
render() {
|
||||
const { user } = this.props
|
||||
return (
|
||||
<div>
|
||||
<Helmet>
|
||||
<title>mpwo - Admin</title>
|
||||
</Helmet>
|
||||
{!user.isAdmin ? (
|
||||
<AccessDenied />
|
||||
) : (
|
||||
<h1 className="page-title">Admin</h1>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(
|
||||
state => ({
|
||||
user: state.user,
|
||||
})
|
||||
)(Admin)
|
Reference in New Issue
Block a user