Commit 134f1a32 authored by Yannis Barlas's avatar Yannis Barlas

Merge branch 'pages' into 'master'

common page layout

Closes #14

See merge request !4
parents bfcd1d58 f8c84bf7
import React from 'react'
const Dashboard = () => <h1>The Dashboard!</h1>
const Dashboard = () => (
<div>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
<h1>The Dashboard!</h1>
</div>
)
export default Dashboard
......@@ -7,6 +7,8 @@ import { Action, AppBar } from '@pubsweet/ui'
import CURRENT_USER from '../queries/currentUser'
// TODO -- use classname on appbar in ui
const NavigationBar = ({ data: { currentUser }, location, history }) => {
const navLinks = [
<Action active={location.pathname.match(/dashboard/g)} to="/dashboard">
......
import styled from 'styled-components'
import { th } from '@pubsweet/ui-toolkit'
const Page = styled.div`
flex: 1;
font-family: ${th('fontInterface')};
padding: ${th('gridUnit')} 15px;
overflow-y: auto;
`
export default Page
// import React from 'react'
import styled from 'styled-components'
const PageLayout = styled.div`
display: flex;
flex-direction: column;
height: 100vh;
`
export default PageLayout
......@@ -11,6 +11,8 @@ import Dashboard from './components/Dashboard'
import NavigationBar from './components/NavigationBar'
import Submit from './components/Submit'
import Page from './components/Page'
import PageLayout from './components/PageLayout'
import Private from './components/Private'
const routes = (
......@@ -20,12 +22,16 @@ const routes = (
<Route component={PasswordReset} exact path="/password-reset" />
<Private>
<Route component={NavigationBar} path="/" />
<Switch>
<Route component={Dashboard} exact path="/dashboard" />
<Route component={Submit} exact path="/submit" />
<Redirect to="/dashboard" />
</Switch>
<PageLayout>
<Route component={NavigationBar} path="/" />
<Page>
<Switch>
<Route component={Dashboard} exact path="/dashboard" />
<Route component={Submit} exact path="/submit" />
<Redirect to="/dashboard" />
</Switch>
</Page>
</PageLayout>
</Private>
</Switch>
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment