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

refactor(files): move zipfiles component to Files folder

parent f2022969
No related branches found
No related tags found
1 merge request!8Sprint #10
import React, { Fragment } from 'react'
import moment from 'moment'
import { th } from '@pubsweet/ui'
import { compose } from 'recompose'
import { withJournal } from 'xpub-journal'
import styled, { css } from 'styled-components'
import { FileItem } from 'pubsweet-components-faraday/src/components/Files'
const ReviewReportCard = ({ report = {}, journal: { recommendations } }) => (
<Root>
<Row>
<Label>Recommendation</Label>
{report.submittedOn && (
<Text>
Submitted on: {moment(report.submittedOn).format('DD.MM.YYYY')}
</Text>
)}
</Row>
<Row>
<Text>
{recommendations.find(r => report.recommendation === r.value).label}
</Text>
</Row>
<Spacing />
<Row left>
<Label>Report Text</Label>
</Row>
<Row>
<Text>{report.comments[0].content}</Text>
</Row>
<Spacing />
{!!report.comments[0].files.length && (
<Fragment>
<Row left>
<Label>Files</Label>
</Row>
<Row left>
{report.comments[0].files.map(file => (
<FileItem compact id={file.id} key={file.id} {...file} />
))}
</Row>
</Fragment>
)}
</Root>
)
export default compose(withJournal)(ReviewReportCard)
// #region styled-components
const defaultText = css`
color: ${th('colorPrimary')};
font-family: ${th('fontReading')};
font-size: ${th('fontSizeBaseSmall')};
`
const Root = styled.div`
display: flex;
flex-direction: column;
margin: auto;
[role='listbox'] {
min-width: 280px;
}
`
const Text = styled.div`
${defaultText};
`
const Label = styled.div`
${defaultText};
text-transform: uppercase;
i {
text-transform: none;
margin-left: ${th('gridUnit')};
}
`
const Spacing = styled.div`
margin-top: ${th('gridUnit')};
flex: 1;
`
const Row = styled.div`
display: flex;
flex-direction: row;
align-items: center;
flex: 1;
box-sizing: border-box;
flex-wrap: wrap;
justify-content: ${({ left }) => (left ? 'left' : 'space-between')};
${defaultText};
`
// #endregion
......@@ -7,6 +7,7 @@ import { compose, withHandlers, lifecycle, withProps } from 'recompose'
import { ReviewerBreakdown } from 'pubsweet-components-faraday/src/components/Invitations'
import ReviewersDetailsList from 'pubsweet-components-faraday/src/components/Reviewers/ReviewersDetailsList'
import ReviewerReportForm from 'pubsweet-component-manuscript/src/components/ReviewerReportForm'
import ReviewReportCard from 'pubsweet-component-manuscript/src/components/ReviewReportCard'
import {
selectReviewers,
selectFetchingReviewers,
......@@ -64,10 +65,7 @@ const ReviewsAndReports = ({
<Root id="review-report">
<Expandable label="Your Report" startExpanded>
{report ? (
<div>
You have a submitted report with recommendation{' '}
{report.recommendation}
</div>
<ReviewReportCard report={report} />
) : (
<ReviewerReportForm
project={project}
......
......@@ -2,7 +2,7 @@ import React from 'react'
import { th, Icon } from '@pubsweet/ui'
import styled from 'styled-components'
import ZipFiles from 'pubsweet-components-faraday/src/components/Dashboard/ZipFiles'
import ZipFiles from 'pubsweet-components-faraday/src/components/Files/ZipFiles'
import { MakeDecision } from './'
const SideBarActions = ({ project, version, currentUserIs }) => (
......
......@@ -12,7 +12,7 @@ import {
import AuthorsWithTooltip from 'pubsweet-component-manuscript/src/molecules/AuthorsWithTooltip'
// import { AuthorsWithTooltip } from '@pubsweet/ui'
import ZipFiles from './ZipFiles'
import ZipFiles from '../Files/ZipFiles'
import { InviteReviewers } from '../Reviewers/'
import { selectInvitation } from '../../redux/reviewers'
import { parseVersion, parseJournalIssue, mapStatusToLabel } from './../utils'
......
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