From bd013deeafceae5c3041a35df0ef3c510b628342 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 1 May 2018 13:03:40 +0200 Subject: [PATCH] Admin: navigation update --- .../components/Admin/Sports/AdminSportsAdd.jsx | 6 ++++-- .../src/components/Admin/generic/AdminDetail.jsx | 7 +++++++ .../src/components/Admin/generic/AdminPage.jsx | 15 ++++++++++++++- mpwo_client/src/components/User/ProfileEdit.jsx | 7 +++++++ 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/mpwo_client/src/components/Admin/Sports/AdminSportsAdd.jsx b/mpwo_client/src/components/Admin/Sports/AdminSportsAdd.jsx index ad9d0e3f..ebb03c9a 100644 --- a/mpwo_client/src/components/Admin/Sports/AdminSportsAdd.jsx +++ b/mpwo_client/src/components/Admin/Sports/AdminSportsAdd.jsx @@ -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 { mpwo - Admin

- Administration - Sport + Administration - Sport

{message && ( {message} @@ -32,7 +33,7 @@ class AdminSportsAdd extends React.Component {
- event.preventDefault()} + event.preventDefault()} >
)} diff --git a/mpwo_client/src/components/Admin/generic/AdminPage.jsx b/mpwo_client/src/components/Admin/generic/AdminPage.jsx index 3936d4ec..6cfbb1d4 100644 --- a/mpwo_client/src/components/Admin/generic/AdminPage.jsx +++ b/mpwo_client/src/components/Admin/generic/AdminPage.jsx @@ -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) { ))} - Add new item + history.push(`/admin/${target}/add`)} + value="Add a new item" + /> + history.push('/admin/')} + value="Back" + />
diff --git a/mpwo_client/src/components/User/ProfileEdit.jsx b/mpwo_client/src/components/User/ProfileEdit.jsx index 9f1bdd3a..e04142d1 100644 --- a/mpwo_client/src/components/User/ProfileEdit.jsx +++ b/mpwo_client/src/components/User/ProfileEdit.jsx @@ -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" /> + history.push('/profile')} + value="Cancel" + />