Admin: navigation update
This commit is contained in:
parent
be6e64e124
commit
bd013deeaf
@ -3,6 +3,7 @@ import { Helmet } from 'react-helmet'
|
|||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
|
|
||||||
import { addData } from '../../../actions/index'
|
import { addData } from '../../../actions/index'
|
||||||
|
import { history } from '../../../index'
|
||||||
|
|
||||||
class AdminSportsAdd extends React.Component {
|
class AdminSportsAdd extends React.Component {
|
||||||
componentDidMount() { }
|
componentDidMount() { }
|
||||||
@ -16,7 +17,7 @@ class AdminSportsAdd extends React.Component {
|
|||||||
<title>mpwo - Admin</title>
|
<title>mpwo - Admin</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<h1 className="page-title">
|
<h1 className="page-title">
|
||||||
Administration - Sport
|
Administration - Sport
|
||||||
</h1>
|
</h1>
|
||||||
{message && (
|
{message && (
|
||||||
<code>{message}</code>
|
<code>{message}</code>
|
||||||
@ -32,7 +33,7 @@ class AdminSportsAdd extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<form onSubmit={event =>
|
<form onSubmit={event =>
|
||||||
event.preventDefault()}
|
event.preventDefault()}
|
||||||
>
|
>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label>
|
<label>
|
||||||
@ -53,6 +54,7 @@ class AdminSportsAdd extends React.Component {
|
|||||||
<input
|
<input
|
||||||
type="submit"
|
type="submit"
|
||||||
className="btn btn-secondary btn-lg btn-block"
|
className="btn btn-secondary btn-lg btn-block"
|
||||||
|
onClick={() => history.push('/admin/sports')}
|
||||||
value="Cancel"
|
value="Cancel"
|
||||||
/>
|
/>
|
||||||
</form>
|
</form>
|
||||||
|
@ -3,6 +3,7 @@ import { Helmet } from 'react-helmet'
|
|||||||
import { connect } from 'react-redux'
|
import { connect } from 'react-redux'
|
||||||
|
|
||||||
import { deleteData, updateData } from '../../../actions/index'
|
import { deleteData, updateData } from '../../../actions/index'
|
||||||
|
import { history } from '../../../index'
|
||||||
|
|
||||||
class AdminDetail extends React.Component {
|
class AdminDetail extends React.Component {
|
||||||
|
|
||||||
@ -95,6 +96,12 @@ class AdminDetail extends React.Component {
|
|||||||
onClick={event => onDataDelete(event, target)}
|
onClick={event => onDataDelete(event, target)}
|
||||||
value="Delete"
|
value="Delete"
|
||||||
/>
|
/>
|
||||||
|
<input
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-secondary btn-lg btn-block"
|
||||||
|
onClick={() => history.push(`/admin/${target}`)}
|
||||||
|
value="Back to the list"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</form>
|
</form>
|
||||||
|
@ -2,6 +2,8 @@ import React from 'react'
|
|||||||
import { Helmet } from 'react-helmet'
|
import { Helmet } from 'react-helmet'
|
||||||
import { Link } from 'react-router-dom'
|
import { Link } from 'react-router-dom'
|
||||||
|
|
||||||
|
import { history } from '../../../index'
|
||||||
|
|
||||||
export default function AdminPage(props) {
|
export default function AdminPage(props) {
|
||||||
|
|
||||||
const { data, detailLink, target } = props
|
const { data, detailLink, target } = props
|
||||||
@ -58,7 +60,18 @@ export default function AdminPage(props) {
|
|||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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>
|
</div>
|
||||||
<div className="col-md-2" />
|
<div className="col-md-2" />
|
||||||
|
@ -7,6 +7,7 @@ import {
|
|||||||
updateProfileFormData,
|
updateProfileFormData,
|
||||||
handleProfileFormSubmit
|
handleProfileFormSubmit
|
||||||
} from '../../actions/user'
|
} from '../../actions/user'
|
||||||
|
import { history } from '../../index'
|
||||||
|
|
||||||
|
|
||||||
class ProfileEdit extends React.Component {
|
class ProfileEdit extends React.Component {
|
||||||
@ -157,6 +158,12 @@ class ProfileEdit extends React.Component {
|
|||||||
className="btn btn-primary btn-lg btn-block"
|
className="btn btn-primary btn-lg btn-block"
|
||||||
value="Submit"
|
value="Submit"
|
||||||
/>
|
/>
|
||||||
|
<input
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-secondary btn-lg btn-block"
|
||||||
|
onClick={() => history.push('/profile')}
|
||||||
|
value="Cancel"
|
||||||
|
/>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user