Commit 72192d38 authored by Yannis Barlas's avatar Yannis Barlas

feat(preview): make title text stylable (italics etc.)

parent 965dcdd1
......@@ -104,12 +104,17 @@ const InitialSubmission = props => {
{...props}
/>
<TextField
<TextEditor
bold
error={get(errors, 'title')}
italic
key={`iamge-caption-${props.readOnly}`}
label="Title"
name="title"
placeholder="this is the title"
placeholder="Please enter the title of your manuscript"
required
subscript
superscript
value={get(values, 'title')}
{...props}
/>
......
......@@ -218,7 +218,7 @@ if (process.env.NODE_ENV === 'development') {
},
],
comments: '<p>some comments here</p>',
// dataType: 'geneExpression',
dataType: 'geneExpression',
disclaimer: true,
funding: 'blah',
geneExpression: {
......@@ -231,7 +231,6 @@ if (process.env.NODE_ENV === 'development') {
constructComments: '',
constructionDetails: '',
detectionMethod: 'antibody',
// detectionMethod: 'genomeEditing',
dnaSequence: [
{
id: uuid(),
......@@ -380,7 +379,7 @@ if (process.env.NODE_ENV === 'development') {
name: 'John C Cooper',
WBId: 'lklajfldjsf',
},
title: 'titlez',
title: '<p>titlez <em>mymy</em> <strong>here</strong><sup>there</sup></p>',
}
}
......
......@@ -125,7 +125,13 @@ const initial = {
validateWBExists,
),
}),
title: yup.string().required('Title is required'),
title: yup
.string()
.test(
'title-not-empty',
'Title is required',
val => stripHTML(val).length > 0,
),
}
const selectDataType = {
......
......@@ -93,12 +93,6 @@ const PageHeader = styled(H2)`
${headingStyle};
`
const Title = styled(H4)`
font-family: ${th('fontReading')};
margin: 0;
${headingStyle};
`
const SectionHeader = styled(H6)`
margin: 0;
${headingStyle};
......@@ -141,6 +135,13 @@ const Editor = styled(AbstractEditor)`
padding: 0;
`
const Title = styled(Editor)`
font-size: ${th('fontSizeHeading4')};
font-weight: bold;
line-height: ${th('lineHeightHeading4')};
${headingStyle};
`
const CaptionEditor = styled(Editor)`
font-size: ${th('fontSizeBaseSmall')};
margin: ${th('gridUnit')} 0 calc(${th('gridUnit')} * 2);
......@@ -286,7 +287,7 @@ const Preview = props => {
return (
<React.Fragment>
<Section>
<Title>{title}</Title>
<Title key={uniqueId()} readonly value={title} />
<div>{authorNames}</div>
<Affiliations>
{affiliations.map(item => (
......
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