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

Merge branch 'develop' of https://gitlab.coko.foundation/xpub/xpub-faraday into develop

parents a0f07167 ee2a7086
No related branches found
No related tags found
1 merge request!6Agree/Decline to work on a manuscript
import styled from 'styled-components'
import { th } from '@pubsweet/ui'
export const RootContainer = styled.div`
background-color: ${th('backgroundColorReverse')};
border: ${th('borderDefault')};
display: flex;
flex-direction: column;
margin: 0 auto;
max-width: 550px;
min-width: 300px;
padding: 20px;
`
export const Title = styled.div`
color: ${th('colorPrimary')};
font-family: ${th('fontHeading')};
font-size: ${th('fontSizeHeading5')};
font-weight: bold;
margin: 10px auto;
text-align: center;
`
export const Subtitle = styled.div`
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBaseSmall')};
font-weight: normal;
margin: 10px auto;
text-align: center;
`
export const Email = styled.div`
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBase')};
font-weight: normal;
margin: 10px auto;
text-align: center;
`
export const FormContainer = styled.form``
export const Row = styled.div`
align-items: center;
display: flex;
flex-direction: row;
justify-content: space-evenly;
margin: ${th('gridUnit')} 0;
`
export const RowItem = styled.div`
flex: 1;
margin-right: ${th('gridUnit')};
`
export const Label = styled.div`
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBaseSmall')};
text-transform: uppercase;
`
export const Err = styled.div`
color: ${th('colorError')};
margin-top: calc(${th('gridUnit')}*-1);
text-align: left;
`
import React from 'react'
import { reduxForm } from 'redux-form'
import { compose } from 'recompose'
import { required, minChars } from 'xpub-validators'
import { Button, ValidatedField, TextField } from '@pubsweet/ui'
import {
Row,
Err,
Title,
Label,
Email,
RowItem,
Subtitle,
RootContainer,
FormContainer,
} from './FormItems'
const min8Chars = minChars(8)
const ReviewerSignUp = ({ handleSubmit, error }) => (
<RootContainer>
<Title>Hindawi Invitation</Title>
<Subtitle>
You have been invited to review a manuscript on the Hindawi platform.
Please set a password and proceed to the manuscript.
</Subtitle>
<Email>costel@gigi.com</Email>
<FormContainer onSubmit={handleSubmit}>
<Row>
<RowItem>
<Label> Password </Label>
<ValidatedField
component={input => <TextField {...input} type="password" />}
name="password"
validate={[required, min8Chars]}
/>
</RowItem>
</Row>
{error && (
<Row>
<RowItem>
<Err>{error}</Err>
</RowItem>
</Row>
)}
<Row>
<Button primary type="submit">
CONFIRM
</Button>
</Row>
</FormContainer>
</RootContainer>
)
export default compose(
reduxForm({
form: 'invite-reviewer',
onSubmit: (values, dispatch) => {},
}),
)(ReviewerSignUp)
import React from 'react' import React from 'react'
import styled from 'styled-components'
import Step0 from './SignUpStep0' import Step0 from './SignUpStep0'
import Step1 from './SignUpStep1' import Step1 from './SignUpStep1'
import { RootContainer, Title, Subtitle, Email, Err } from './FormItems'
const SignUpInvitation = ({ const SignUpInvitation = ({
journal, journal,
...@@ -14,7 +14,7 @@ const SignUpInvitation = ({ ...@@ -14,7 +14,7 @@ const SignUpInvitation = ({
initialValues, initialValues,
error, error,
}) => ( }) => (
<Root> <RootContainer>
<Title>Add New Account Details</Title> <Title>Add New Account Details</Title>
<Subtitle> <Subtitle>
Your details have been pre-filled, please review and confirm before set Your details have been pre-filled, please review and confirm before set
...@@ -38,48 +38,7 @@ const SignUpInvitation = ({ ...@@ -38,48 +38,7 @@ const SignUpInvitation = ({
onSubmit={submitConfirmation} onSubmit={submitConfirmation}
/> />
)} )}
</Root> </RootContainer>
) )
export default SignUpInvitation export default SignUpInvitation
// #region styles
const Root = styled.div`
max-width: 550px;
min-width: 300px;
margin: 0 auto;
display: flex;
border: ${({ theme }) => theme.borderDefault};
background-color: ${({ theme }) => theme.backgroundColorReverse};
padding: 20px;
flex-direction: column;
`
const Title = styled.div`
font-size: ${({ theme }) => theme.fontSizeHeading5};
font-family: ${({ theme }) => theme.fontHeading};
color: ${({ theme }) => theme.colorPrimary};
font-weight: bold;
text-align: center;
margin: 10px auto;
`
const Subtitle = styled.div`
font-size: ${({ theme }) => theme.fontSizeBaseSmall};
font-family: ${({ theme }) => theme.fontReading};
font-weight: normal;
text-align: center;
margin: 10px auto;
`
const Email = styled.div`
font-size: ${({ theme }) => theme.fontSizeBase};
font-family: ${({ theme }) => theme.fontReading};
font-weight: normal;
text-align: center;
margin: 10px auto;
`
const Err = styled.div`
color: ${({ theme }) => theme.colorError};
text-align: center;
`
// #endregion
import React from 'react' import React from 'react'
import styled from 'styled-components'
import { reduxForm } from 'redux-form' import { reduxForm } from 'redux-form'
import { isUndefined } from 'lodash' import { isUndefined } from 'lodash'
import { required } from 'xpub-validators' import { required } from 'xpub-validators'
import { Button, ValidatedField, TextField, Menu } from '@pubsweet/ui' import { Button, ValidatedField, TextField, Menu } from '@pubsweet/ui'
import { FormContainer, Row, RowItem, Label } from './FormItems'
const Step0 = ({ journal, handleSubmit, initialValues, error }) => const Step0 = ({ journal, handleSubmit, initialValues, error }) =>
!isUndefined(initialValues) ? ( !isUndefined(initialValues) ? (
<FormContainer onSubmit={handleSubmit}> <FormContainer onSubmit={handleSubmit}>
...@@ -61,24 +62,3 @@ export default reduxForm({ ...@@ -61,24 +62,3 @@ export default reduxForm({
enableReinitialize: true, enableReinitialize: true,
forceUnregisterOnUnmount: true, forceUnregisterOnUnmount: true,
})(Step0) })(Step0)
const FormContainer = styled.form``
const Row = styled.div`
display: flex;
flex-direction: row;
margin: 20px 0;
align-items: center;
justify-content: space-evenly;
`
const RowItem = styled.div`
flex: 1;
margin-right: 20px;
`
const Label = styled.div`
font-size: ${({ theme }) => theme.fontSizeBaseSmall};
font-family: ${({ theme }) => theme.fontReading};
text-transform: uppercase;
`
import React from 'react' import React from 'react'
import styled from 'styled-components'
import { reduxForm } from 'redux-form' import { reduxForm } from 'redux-form'
import { required } from 'xpub-validators' import { required } from 'xpub-validators'
import { Button, ValidatedField, TextField, th } from '@pubsweet/ui' import { Button, ValidatedField, TextField } from '@pubsweet/ui'
import { FormContainer, Row, RowItem, Label, Err } from './FormItems'
const Step1 = ({ journal, handleSubmit, error }) => ( const Step1 = ({ journal, handleSubmit, error }) => (
<FormContainer onSubmit={handleSubmit}> <FormContainer onSubmit={handleSubmit}>
...@@ -36,29 +37,3 @@ export default reduxForm({ ...@@ -36,29 +37,3 @@ export default reduxForm({
destroyOnUnmount: false, destroyOnUnmount: false,
forceUnregisterOnUnmount: true, forceUnregisterOnUnmount: true,
})(Step1) })(Step1)
const FormContainer = styled.form``
const Row = styled.div`
display: flex;
flex-direction: row;
margin: ${th('gridUnit')} 0;
align-items: center;
justify-content: space-evenly;
`
const RowItem = styled.div`
flex: 1;
margin-right: ${th('gridUnit')};
`
const Label = styled.div`
font-size: ${th('fontSizeBaseSmall')};
font-family: ${th('fontReading')};
text-transform: uppercase;
`
const Err = styled.div`
color: ${th('colorError')};
text-align: left;
margin-top: calc(${th('gridUnit')}*-1);
`
export { default as ReviewerSignUp } from './ReviewerSignUp'
export { default as SignUpInvitationPage } from './SignUpInvitationPage'
...@@ -15,7 +15,10 @@ import { ...@@ -15,7 +15,10 @@ import {
AdminRoute, AdminRoute,
} from 'pubsweet-components-faraday/src/components/Admin' } from 'pubsweet-components-faraday/src/components/Admin'
import AddEditUser from 'pubsweet-components-faraday/src/components/Admin/AddEditUser' import AddEditUser from 'pubsweet-components-faraday/src/components/Admin/AddEditUser'
import SignUpInvitationPage from 'pubsweet-components-faraday/src/components/SignUp/SignUpInvitationPage' import {
SignUpInvitationPage,
ReviewerSignUp,
} from 'pubsweet-components-faraday/src/components/SignUp'
import FaradayApp from './FaradayApp' import FaradayApp from './FaradayApp'
...@@ -57,6 +60,7 @@ const Routes = () => ( ...@@ -57,6 +60,7 @@ const Routes = () => (
path="/projects/:project/versions/:version/submit" path="/projects/:project/versions/:version/submit"
/> />
<Route component={SignUpInvitationPage} exact path="/invite" /> <Route component={SignUpInvitationPage} exact path="/invite" />
<Route component={ReviewerSignUp} exact path="/invite-reviewer" />
<Route component={NotFound} /> <Route component={NotFound} />
</Switch> </Switch>
</FaradayApp> </FaradayApp>
......
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