From f8299e1c2320ccb0681f94bf62d37529badeddb0 Mon Sep 17 00:00:00 2001 From: Linda Date: Sat, 2 Mar 2019 11:57:14 -0800 Subject: [PATCH] Renamed profile to dashboard, and added some skeleton sections (#23) --- client/routes.jsx | 7 ++++--- imports/ui/components/dashboard.jsx | 31 +++++++++++++++++++++++++++++ imports/ui/components/home.jsx | 23 --------------------- imports/ui/components/navbar.jsx | 7 +++++++ imports/ui/styles/_dashboard.scss | 5 +++++ 5 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 imports/ui/components/dashboard.jsx delete mode 100644 imports/ui/components/home.jsx create mode 100644 imports/ui/styles/_dashboard.scss diff --git a/client/routes.jsx b/client/routes.jsx index 6e2762e..1c96c26 100644 --- a/client/routes.jsx +++ b/client/routes.jsx @@ -8,6 +8,7 @@ import Woohoo from '../imports/ui/components/woohoo.jsx'; import Apply from '../imports/ui/components/apply.jsx'; import ForgotPassword from '../imports/ui/components/forgot_password.jsx'; import SetPassword from '../imports/ui/components/set_password.jsx'; +import Dashboard from '../imports/ui/components/dashboard.jsx'; import Home from '../imports/ui/components/home.jsx'; import Moderator from '../imports/ui/components/home.jsx'; import withUser from '../imports/ui/components/hoc/with-user.jsx'; @@ -17,7 +18,7 @@ export const renderRoutes = () => ( - + @@ -48,8 +49,8 @@ const RouteWithOutUser = withUser(({ user, component: Component, ...rest }) => { const { pathname } = window.location; if (!user) { return } />; - } else if (pathname !== '/home' && pathname === rest.path) { - return ; + } else if (pathname !== '/dashboard' && pathname === rest.path) { + return ; } return null; }); diff --git a/imports/ui/components/dashboard.jsx b/imports/ui/components/dashboard.jsx new file mode 100644 index 0000000..8055e97 --- /dev/null +++ b/imports/ui/components/dashboard.jsx @@ -0,0 +1,31 @@ +import React from 'react'; +import { Container, Row, Col } from 'react-bootstrap'; +import BoardContainer from '/imports/ui/containers/board.jsx'; +import '/imports/ui/styles/_dashboard.scss'; + +const Dashboard = props => { + console.log(props) + const { user } = props; + const { name } = user && user.profile || {} + return ( + + + +
+

Hello {name}! You are logged in!

+

Your unmatched submissions

+

You are looking for: { user.profile.categories[0].title }

+

{ user.profile.categories[0].note }

+

Your current match

+

Favorite unmatched entries by clicking on the hearts below...

+ +

Previous matches

+
+ +
+
+ + ) +} + +export default Dashboard diff --git a/imports/ui/components/home.jsx b/imports/ui/components/home.jsx deleted file mode 100644 index 21c10c2..0000000 --- a/imports/ui/components/home.jsx +++ /dev/null @@ -1,23 +0,0 @@ -import React from 'react'; -import { Container, Row, Col } from 'react-bootstrap'; -import BoardContainer from '/imports/ui/containers/board.jsx'; - -const Home = props => { - const { user } = props; - const { name } = user && user.profile || {} - return ( - - - -
-

Hello {name}! You are logged in!

-
- - -
-
- - ) -} - -export default Home diff --git a/imports/ui/components/navbar.jsx b/imports/ui/components/navbar.jsx index 633730a..4a768f8 100644 --- a/imports/ui/components/navbar.jsx +++ b/imports/ui/components/navbar.jsx @@ -43,6 +43,13 @@ class NavbarWrapper extends React.Component { FAQ + {user ? ( + + Dashboard + + ) : ( + "" + )} {user ? (