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 NotFound from './../Others/NotFound'
import { isLoggedIn } from '../../utils' import { isLoggedIn } from '../../utils'
class Activity extends React.Component { function Activity () {
componentDidMount() {}
render() {
return ( return (
<div> <div>
<Helmet> <Helmet>
@ -34,7 +32,6 @@ class Activity extends React.Component {
</div> </div>
) )
} }
}
export default connect( export default connect(
state => ({ state => ({

View File

@ -1,11 +1,8 @@
import React from 'react' import React from 'react'
import { Helmet } from 'react-helmet' import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
class AdminMenu extends React.Component { export default function AdminMenu () {
componentDidMount() {}
render() {
return ( return (
<div> <div>
<Helmet> <Helmet>
@ -36,10 +33,3 @@ 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 NotFound from './../Others/NotFound'
import { isLoggedIn } from '../../utils' import { isLoggedIn } from '../../utils'
class Admin extends React.Component { function Admin (props) {
componentDidMount() {} const { user } = props
render() {
const { user } = this.props
return ( return (
<div> <div>
<Helmet> <Helmet>
@ -42,7 +40,6 @@ class Admin extends React.Component {
</div> </div>
) )
} }
}
export default connect( export default connect(
state => ({ state => ({

View File

@ -1,6 +1,7 @@
import React from 'react' import React from 'react'
import { Helmet } from 'react-helmet' import { Helmet } from 'react-helmet'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { Link } from 'react-router-dom'
import ActivityCard from './ActivityCard' import ActivityCard from './ActivityCard'
import Calendar from './../Others/Calendar' import Calendar from './../Others/Calendar'
@ -56,7 +57,14 @@ class DashBoard extends React.Component {
sports={sports} 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 && {!paginationEnd &&
<input <input

View File

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