Skip to content
Snippets Groups Projects
Commit 124bb74a authored by Bogdan Cochior's avatar Bogdan Cochior
Browse files

style(404): add styled-components on 404 page

parent 01eef687
No related branches found
No related tags found
No related merge requests found
import React from 'react' import React from 'react'
import { Icon } from '@pubsweet/ui' import { Icon, Button, th } from '@pubsweet/ui'
import classnames from 'classnames' import styled from 'styled-components'
import classes from './UIComponents.local.scss'
const NotFound = ({ history }) => ( const NotFound = ({ history }) => (
<div className={classnames(classes.container)}> <Root>
<div> <div>
<Icon size={32}>cloud-off</Icon> <Icon size={6}>cloud-off</Icon>
</div> </div>
<h2>The page cannot be found</h2> <H2>The page cannot be found</H2>
<h3> <H3>
The page you are looking for might have been removed, had its name The page you are looking for might have been removed, had its name
changed, or is temporarily unavailable. changed, or is temporarily unavailable.
</h3> </H3>
<a href="#" onClick={history.goBack}> <Button onClick={history.goBack} primary>
Back Back
</a> </Button>
</div> </Root>
) )
export default NotFound export default NotFound
const Root = styled.div`
margin: 0 auto;
text-align: center;
width: 90vw;
`
const H2 = styled.h2`
font-size: ${th('fontSizeHeading2')};
`
const H3 = styled.h3`
font-size: ${th('fontSizeHeading3')};
`
.container {
margin: 0 auto;
text-align: center;
width: 70vw;
a {
color: black;
}
}
import React from 'react' import React from 'react'
import styled from 'styled-components' import styled from 'styled-components'
import uploadFileFn from 'xpub-upload' import uploadFileFn from 'xpub-upload'
import { AbstractEditor, TitleEditor } from 'xpub-edit' // TODO: Add back abstract when xpub-edit is published
// import { AbstractEditor, TitleEditor } from 'xpub-edit'
import { TitleEditor } from 'xpub-edit'
import { Menu, YesOrNo, TextField } from '@pubsweet/ui' import { Menu, YesOrNo, TextField } from '@pubsweet/ui'
import { required, minChars, minSize } from 'xpub-validators' import { required, minChars, minSize } from 'xpub-validators'
import { import {
...@@ -142,7 +144,7 @@ export default { ...@@ -142,7 +144,7 @@ export default {
}, },
{ {
fieldId: 'metadata.abstract', fieldId: 'metadata.abstract',
renderComponent: AbstractEditor, renderComponent: TitleEditor,
title: 'Abstract', title: 'Abstract',
placeholder: 'Write an abstract', placeholder: 'Write an abstract',
validate: [requiredBasedOnType], validate: [requiredBasedOnType],
......
...@@ -7,7 +7,6 @@ import Signup from 'pubsweet-component-signup/SignupContainer' ...@@ -7,7 +7,6 @@ import Signup from 'pubsweet-component-signup/SignupContainer'
import DashboardPage from 'pubsweet-components-faraday/src/components/Dashboard' import DashboardPage from 'pubsweet-components-faraday/src/components/Dashboard'
import { Wizard } from 'pubsweet-component-wizard/src/components' import { Wizard } from 'pubsweet-component-wizard/src/components'
import ManuscriptPage from 'pubsweet-component-xpub-manuscript/src/components/ManuscriptPage'
import ConfirmationPage from 'pubsweet-components-faraday/src/components/UIComponents/ConfirmationPage' import ConfirmationPage from 'pubsweet-components-faraday/src/components/UIComponents/ConfirmationPage'
import NotFound from 'pubsweet-components-faraday/src/components/UIComponents/NotFound' import NotFound from 'pubsweet-components-faraday/src/components/UIComponents/NotFound'
import { import {
...@@ -57,11 +56,6 @@ const Routes = () => ( ...@@ -57,11 +56,6 @@ const Routes = () => (
exact exact
path="/projects/:project/versions/:version/submit" path="/projects/:project/versions/:version/submit"
/> />
<PrivateRoute
component={ManuscriptPage}
exact
path="/projects/:project/versions/:version/manuscript"
/>
<Route component={SignUpInvitationPage} exact path="/invite" /> <Route component={SignUpInvitationPage} exact path="/invite" />
<Route component={NotFound} /> <Route component={NotFound} />
</Switch> </Switch>
......
...@@ -4,14 +4,6 @@ const components = require('./components.json') ...@@ -4,14 +4,6 @@ const components = require('./components.json')
const logger = require('winston') const logger = require('winston')
const environment = process.env.NODE_ENV || 'development' const environment = process.env.NODE_ENV || 'development'
const getInviteUrl = () => {
if (process.env.PUBSWEET_INVITE_PASSWORD_RESET_URL) {
return process.env.PUBSWEET_INVITE_PASSWORD_RESET_URL
} else if (process.env.NOW_URL) {
return `${process.env.NOW_URL}/invite`
}
return 'http://localhost:3000/invite'
}
module.exports = { module.exports = {
authsome: { authsome: {
...@@ -53,7 +45,7 @@ module.exports = { ...@@ -53,7 +45,7 @@ module.exports = {
validations: path.resolve(__dirname, 'upload-validations.js'), validations: path.resolve(__dirname, 'upload-validations.js'),
}, },
'invite-reset-password': { 'invite-reset-password': {
url: getInviteUrl(), url: process.env.PUBSWEET_INVITE_PASSWORD_RESET_URL || '/invite',
}, },
roles: { roles: {
global: ['admin', 'editorInChief', 'author'], global: ['admin', 'editorInChief', 'author'],
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
"pubsweet-component-invite": "^0.0.1", "pubsweet-component-invite": "^0.0.1",
"pubsweet-component-login": "^1.1.0", "pubsweet-component-login": "^1.1.0",
"pubsweet-component-signup": "^1.0.0", "pubsweet-component-signup": "^1.0.0",
"pubsweet-component-xpub-manuscript": "^0.0.3",
"pubsweet-server": "^1.0.1", "pubsweet-server": "^1.0.1",
"react": "^16.2.0", "react": "^16.2.0",
"react-dnd": "^2.5.4", "react-dnd": "^2.5.4",
......
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