Client: refactor + minor changes

This commit is contained in:
Sam 2018-06-07 13:34:12 +02:00
parent 424df3b721
commit c314c79f86
5 changed files with 97 additions and 115 deletions

View File

@ -9,9 +9,7 @@ import ActivityEdit from './ActivityEdit'
import NotFound from './../Others/NotFound'
import { isLoggedIn } from '../../utils'
class Activity extends React.Component {
componentDidMount() {}
render() {
function Activity () {
return (
<div>
<Helmet>
@ -33,7 +31,6 @@ class Activity extends React.Component {
) : (<Redirect to="/login" />)}
</div>
)
}
}
export default connect(

View File

@ -1,11 +1,8 @@
import React from 'react'
import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
class AdminMenu extends React.Component {
componentDidMount() {}
render() {
export default function AdminMenu () {
return (
<div>
<Helmet>
@ -35,11 +32,4 @@ class AdminMenu extends React.Component {
</div>
</div>
)
}
}
export default connect(
state => ({
user: state.user,
})
)(AdminMenu)

View File

@ -11,10 +11,8 @@ import AccessDenied from './../Others/AccessDenied'
import NotFound from './../Others/NotFound'
import { isLoggedIn } from '../../utils'
class Admin extends React.Component {
componentDidMount() {}
render() {
const { user } = this.props
function Admin (props) {
const { user } = props
return (
<div>
<Helmet>
@ -41,7 +39,6 @@ class Admin extends React.Component {
) : (<Redirect to="/login" />)}
</div>
)
}
}
export default connect(

View File

@ -1,6 +1,7 @@
import React from 'react'
import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import ActivityCard from './ActivityCard'
import Calendar from './../Others/Calendar'
@ -56,7 +57,14 @@ class DashBoard extends React.Component {
sports={sports}
/>)
)) : (
'No activities. Upload one !'
<div className="card text-center">
<div className="card-body">
No workouts. {' '}
<Link to={{ pathname: '/activities/add' }}>
Upload one !
</Link>
</div>
</div>
)}
{!paginationEnd &&
<input

View File

@ -1,10 +1,7 @@
import React from 'react'
import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
class AccessDenied extends React.Component {
componentDidMount() {}
render() {
export default function AccessDenied () {
return (
<div>
<Helmet>
@ -16,11 +13,4 @@ class AccessDenied extends React.Component {
</p>
</div>
)
}
}
export default connect(
state => ({
user: state.user,
})
)(AccessDenied)