Newer
Older
import React, { Fragment } from 'react'
import { Field } from 'redux-form'
import { Tooltip } from 'react-tippy'
import { th } from '@pubsweet/ui-toolkit'
import { required } from 'xpub-validators'
import { AbstractEditor } from 'xpub-edit'
import { Menu, YesOrNo, ValidatedField, Icon } from '@pubsweet/ui'
import styled from 'styled-components'
import {
FormItems,
AuthorList,
} from 'pubsweet-components-faraday/src/components'
import { Empty } from './'
const { Err, Row, Label, Title, RowItem, Subtitle, TextField } = FormItems
const StepTwo = ({
version,
project,
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
manuscriptTypes,
}) => (
<Fragment>
<Title>2. Manuscript & Authors Details</Title>
<Subtitle>
Please provide the details of all the authors of this manuscript, in the
order that they appear on the manuscript. Your details are already
prefiled since, in order to submit a manuscript you must be one of the
authors.
</Subtitle>
<Row>
<RowItem flex={3} vertical withRightMargin>
<Label>MANUSCRIPT TITLE*</Label>
<ValidatedField
component={TextField}
name="metadata.title"
validate={[required]}
/>
</RowItem>
<RowItem vertical>
<Label>MANUSCRIPT TYPE*</Label>
<ValidatedField
component={input => <Menu options={manuscriptTypes} {...input} />}
name="metadata.type"
validate={[required]}
/>
</RowItem>
</Row>
<Row>
<RowItem vertical>
<Label>ABSTRACT*</Label>
<ValidatedField
component={AbstractEditor}
name="metadata.abstract"
validate={[required]}
/>
</RowItem>
</Row>
<Row>
<RowItem vertical>
<Label justify="space-between">
AUTHORS DETAILS*
<AuthorGuidelines
href="https://www.hindawi.com/authors/"
rel="noopener noreferrer"
target="_blank"
>
Hindawi Author Submission Guidelines
</AuthorGuidelines>
</Label>
<Field component={Empty} name="authors" />
<AuthorList
parentForm="submission"
project={project}
version={version}
/>
{authorsError && <Err align="left">{authorsError}</Err>}
</RowItem>
</Row>
<Row>
<RowItem vertical>
<Label>
Is there a potential conflict of interest?
<Tooltip
arrow
html={<ConflictsTooltip />}
interactive
position="bottom"
trigger="click"
>
<TooltipIcon>
<Icon primary>help-circle</Icon>
</TooltipIcon>
</Tooltip>
</Label>
<Field
component={({ input }) => <YesOrNo {...input} />}
name="conflicts.hasConflicts"
/>
</RowItem>
</Row>
<Row>
<RowItem vertical>
<Label>CONFLICT OF INTEREST DETAILS*</Label>
<ValidatedField
name="conflicts.message"
validate={[required]}
/>
</RowItem>
</Row>
)}
</Fragment>
)
export default StepTwo
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
const ConflictsTooltip = () => (
<TooltipText>
When an author, editor, or reviewer has a financial/personal interest or
belief that could affest his/her objectivity, or inappropriately influence
his/her actions, a potential conflict of interest exists.
<MoreInfoLink
href="https://www.hindawi.com/editors/coi/"
rel="noopener noreferrer"
target="_blank"
>
More info
</MoreInfoLink>
</TooltipText>
)
// #region styled-components
const AuthorGuidelines = styled.a`
color: ${th('colorPrimary')};
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBaseSmall')};
text-transform: none;
`
const TooltipIcon = styled.div.attrs({
className: 'tooltip-icon',
})`
padding-top: ${th('subGridUnit')};
`
const TooltipText = styled.span`
color: #d8d8d8;
font-family: 'Noto Serif';
font-size: 14px;
`
const MoreInfoLink = styled.a`
color: #d8d8d8;
margin-left: 3px;
`
// #endregion