From 62d87d05f5ee9062a76a9afc43f4066f1cb1499c Mon Sep 17 00:00:00 2001 From: SamR1 Date: Sun, 31 Dec 2017 19:32:52 +0100 Subject: [PATCH] Client: profile update & PageNotFound handling --- mpwo_client/package.json | 1 + mpwo_client/public/index.html | 4 + mpwo_client/src/components/App.css | 1 + mpwo_client/src/components/App.jsx | 2 + .../src/components/Dashboard/index.jsx | 4 + mpwo_client/src/components/NotFound.jsx | 13 + mpwo_client/src/components/User/Profile.jsx | 52 +- .../package-lock.json => package-lock.json | 837 +++++++++++++++++- package.json | 1 + 9 files changed, 887 insertions(+), 28 deletions(-) create mode 100644 mpwo_client/src/components/NotFound.jsx rename mpwo_client/package-lock.json => package-lock.json (94%) diff --git a/mpwo_client/package.json b/mpwo_client/package.json index 7661c332..1fae1c1f 100644 --- a/mpwo_client/package.json +++ b/mpwo_client/package.json @@ -6,6 +6,7 @@ "history": "^4.7.2", "react": "^16.2.0", "react-dom": "^16.2.0", + "react-helmet": "^5.2.0", "react-redux": "^5.0.6", "react-router-dom": "^4.2.2", "react-router-redux": "^5.0.0-alpha.9", diff --git a/mpwo_client/public/index.html b/mpwo_client/public/index.html index 678b433b..b1be28e2 100644 --- a/mpwo_client/public/index.html +++ b/mpwo_client/public/index.html @@ -10,6 +10,10 @@ href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" rel="stylesheet" > + mpwo diff --git a/mpwo_client/src/components/App.css b/mpwo_client/src/components/App.css index 3e5e7e23..ccfd12a8 100644 --- a/mpwo_client/src/components/App.css +++ b/mpwo_client/src/components/App.css @@ -29,5 +29,6 @@ .page-title { font-size: 2em; + margin: 1em; text-align: center; } diff --git a/mpwo_client/src/components/App.jsx b/mpwo_client/src/components/App.jsx index 29c18f7e..006b219d 100644 --- a/mpwo_client/src/components/App.jsx +++ b/mpwo_client/src/components/App.jsx @@ -5,6 +5,7 @@ import './App.css' import Dashboard from './Dashboard' import Logout from './User/Logout' import NavBar from './NavBar' +import NotFound from './NotFound' import Profile from './User/Profile' import UserForm from './User/UserForm' import { isLoggedIn } from '../utils' @@ -68,6 +69,7 @@ export default class App extends React.Component { ) )} /> + ) diff --git a/mpwo_client/src/components/Dashboard/index.jsx b/mpwo_client/src/components/Dashboard/index.jsx index d22482db..b922fb24 100644 --- a/mpwo_client/src/components/Dashboard/index.jsx +++ b/mpwo_client/src/components/Dashboard/index.jsx @@ -1,4 +1,5 @@ import React from 'react' +import { Helmet } from 'react-helmet' import { connect } from 'react-redux' class Logout extends React.Component { @@ -6,6 +7,9 @@ class Logout extends React.Component { render() { return (
+ + mpwo - Dashboard +

Dashboard

) diff --git a/mpwo_client/src/components/NotFound.jsx b/mpwo_client/src/components/NotFound.jsx new file mode 100644 index 00000000..05e4b8da --- /dev/null +++ b/mpwo_client/src/components/NotFound.jsx @@ -0,0 +1,13 @@ +import React from 'react' +import { Helmet } from 'react-helmet' + +export default function NotFound () { + return ( +
+ + mpwo - 404 + +

Page not found

+
+ ) +} diff --git a/mpwo_client/src/components/User/Profile.jsx b/mpwo_client/src/components/User/Profile.jsx index ebab17af..4cec2c85 100644 --- a/mpwo_client/src/components/User/Profile.jsx +++ b/mpwo_client/src/components/User/Profile.jsx @@ -1,32 +1,46 @@ import React from 'react' +import { Helmet } from 'react-helmet' import { connect } from 'react-redux' +import { Link } from 'react-router-dom' function Profile ({ user }) { return ( -
-

Profile

-
-
-
-
- {user.username} -
-
-
-
-

Email : {user.email}

-

Registration date : {user.createdAt}

+
+ + mpwo - {user.username} - Profile + +
+

Profile

+
+
+
+
+ {user.username} {' '} + +