Admin: navigation update

This commit is contained in:
Sam 2018-05-01 13:03:40 +02:00
parent be6e64e124
commit bd013deeaf
4 changed files with 32 additions and 3 deletions

View File

@ -3,6 +3,7 @@ import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
import { addData } from '../../../actions/index'
import { history } from '../../../index'
class AdminSportsAdd extends React.Component {
componentDidMount() { }
@ -16,7 +17,7 @@ class AdminSportsAdd extends React.Component {
<title>mpwo - Admin</title>
</Helmet>
<h1 className="page-title">
Administration - Sport
Administration - Sport
</h1>
{message && (
<code>{message}</code>
@ -32,7 +33,7 @@ class AdminSportsAdd extends React.Component {
</div>
<div className="card-body">
<form onSubmit={event =>
event.preventDefault()}
event.preventDefault()}
>
<div className="form-group">
<label>
@ -53,6 +54,7 @@ class AdminSportsAdd extends React.Component {
<input
type="submit"
className="btn btn-secondary btn-lg btn-block"
onClick={() => history.push('/admin/sports')}
value="Cancel"
/>
</form>

View File

@ -3,6 +3,7 @@ import { Helmet } from 'react-helmet'
import { connect } from 'react-redux'
import { deleteData, updateData } from '../../../actions/index'
import { history } from '../../../index'
class AdminDetail extends React.Component {
@ -95,6 +96,12 @@ class AdminDetail extends React.Component {
onClick={event => onDataDelete(event, target)}
value="Delete"
/>
<input
type="submit"
className="btn btn-secondary btn-lg btn-block"
onClick={() => history.push(`/admin/${target}`)}
value="Back to the list"
/>
</div>
)}
</form>

View File

@ -2,6 +2,8 @@ import React from 'react'
import { Helmet } from 'react-helmet'
import { Link } from 'react-router-dom'
import { history } from '../../../index'
export default function AdminPage(props) {
const { data, detailLink, target } = props
@ -58,7 +60,18 @@ export default function AdminPage(props) {
))}
</tbody>
</table>
<Link to={`/admin/${target}/add`}>Add new item</Link>
<input
type="submit"
className="btn btn-primary btn-lg btn-block"
onClick={() => history.push(`/admin/${target}/add`)}
value="Add a new item"
/>
<input
type="submit"
className="btn btn-secondary btn-lg btn-block"
onClick={() => history.push('/admin/')}
value="Back"
/>
</div>
</div>
<div className="col-md-2" />

View File

@ -7,6 +7,7 @@ import {
updateProfileFormData,
handleProfileFormSubmit
} from '../../actions/user'
import { history } from '../../index'
class ProfileEdit extends React.Component {
@ -157,6 +158,12 @@ class ProfileEdit extends React.Component {
className="btn btn-primary btn-lg btn-block"
value="Submit"
/>
<input
type="submit"
className="btn btn-secondary btn-lg btn-block"
onClick={() => history.push('/profile')}
value="Cancel"
/>
</form>
</div>
</div>