Skip to content
Snippets Groups Projects
Commit e1d1ae29 authored by Andy Nicholson's avatar Andy Nicholson
Browse files

fix(*): propTypes and html in front page

parent e871e60d
No related branches found
No related tags found
No related merge requests found
...@@ -69,7 +69,7 @@ const PrivateRoute = ({ component: Component, ...rest }) => ( ...@@ -69,7 +69,7 @@ const PrivateRoute = ({ component: Component, ...rest }) => (
) )
PrivateRoute.propTypes = { PrivateRoute.propTypes = {
component: PropTypes.node.isRequired, component: PropTypes.func.isRequired,
} }
const updateStuff = data => { const updateStuff = data => {
......
...@@ -76,18 +76,18 @@ const Frontpage = ({ history, ...props }) => { ...@@ -76,18 +76,18 @@ const Frontpage = ({ history, ...props }) => {
</SectionHeader> </SectionHeader>
<SectionRow key={`manuscript-${manuscript.id}`}> <SectionRow key={`manuscript-${manuscript.id}`}>
{manuscript.submission?.abstract ? ( {manuscript.submission?.abstract ? (
<p>Abstract: {manuscript.submission?.abstract}</p> <h1>Abstract: {manuscript.submission?.abstract}</h1>
) : ( ) : (
<br /> <br />
)} )}
{manuscript.visualAbstract ? ( {manuscript.visualAbstract ? (
<p> <div>
Visual abstract:{' '} <h1>Visual abstract</h1>
<VisualAbstract <VisualAbstract
alt="Visual abstract" alt="Visual abstract"
src={manuscript.visualAbstract} src={manuscript.visualAbstract}
/> />
</p> </div>
) : ( ) : (
<br /> <br />
)} )}
...@@ -98,25 +98,25 @@ const Frontpage = ({ history, ...props }) => { ...@@ -98,25 +98,25 @@ const Frontpage = ({ history, ...props }) => {
file => file =>
skipXSweet(file) && skipXSweet(file) &&
file.fileType !== 'visualAbstract' && ( file.fileType !== 'visualAbstract' && (
<p> <a
<a href={file.url}
href={file.url} key={`manuscript-${manuscript.id}`}
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >
{file.filename} {file.filename}
</a> </a>
</p>
), ),
)} )}
{manuscript.files.map( {manuscript.files.map(
file => file =>
!skipXSweet(file) && ( !skipXSweet(file) && (
<p> <Accordion
<Accordion label="View Manuscript Text"> key={`manuscript-${manuscript.id}`}
<Wax content={manuscript.meta.source} readonly /> label="View Manuscript Text"
</Accordion> >
</p> <Wax content={manuscript.meta.source} readonly />
</Accordion>
), ),
)} )}
</div> </div>
...@@ -126,17 +126,16 @@ const Frontpage = ({ history, ...props }) => { ...@@ -126,17 +126,16 @@ const Frontpage = ({ history, ...props }) => {
{manuscript.submission?.links ? ( {manuscript.submission?.links ? (
<div> <div>
Submitted research objects: <h1>Submitted research objects</h1>
{manuscript.submission?.links?.map(link => ( {manuscript.submission?.links?.map(link => (
<p key={`manuscript-${manuscript.id}`}> <a
<a href={link.url}
href={link.url} key={`manuscript-${manuscript.id}`}
rel="noopener noreferrer" rel="noopener noreferrer"
target="_blank" target="_blank"
> >
{link.url} {link.url}
</a> </a>
</p>
))} ))}
</div> </div>
) : ( ) : (
...@@ -153,7 +152,7 @@ const Frontpage = ({ history, ...props }) => { ...@@ -153,7 +152,7 @@ const Frontpage = ({ history, ...props }) => {
} }
Frontpage.propTypes = { Frontpage.propTypes = {
history: PropTypes.node.isRequired, history: PropTypes.oneOfType([PropTypes.object]).isRequired,
} }
export default Frontpage export default Frontpage
...@@ -8,8 +8,8 @@ const JournalProvider = ({ journal, children }) => ( ...@@ -8,8 +8,8 @@ const JournalProvider = ({ journal, children }) => (
) )
JournalProvider.propTypes = { JournalProvider.propTypes = {
journal: PropTypes.node.isRequired, journal: PropTypes.oneOfType([PropTypes.object]).isRequired,
children: PropTypes.node.isRequired, children: PropTypes.oneOfType([PropTypes.object]).isRequired,
} }
export { JournalContext, JournalProvider } export { JournalContext, JournalProvider }
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