Skip to content
Snippets Groups Projects
Commit de155844 authored by Audrey Hamelers's avatar Audrey Hamelers
Browse files

error display in file thumbnail list

parent c0fe44d4
No related branches found
No related tags found
2 merge requests!60Dev,!43Shared data model
......@@ -9,7 +9,6 @@ import { ImageTypes } from './'
const Image = styled.img`
max-width: 100%;
max-height: 100%;
`
const PDF = styled.div`
.pdf-viewer {
......
import React from 'react'
import styled from 'styled-components'
import styled, { css } from 'styled-components'
import * as mime from 'mime-types'
import { Icon } from '@pubsweet/ui'
import { th } from '@pubsweet/ui-toolkit'
import { B } from '../ui'
import { FileLightbox, fileSort, ImageTypes } from './'
......@@ -98,6 +99,14 @@ const FileInfo = styled.p`
width: 60%;
}
`
const error = css`
display: inline-flex;
align-items: flex-start;
color: ${th('colorError')};
`
const Bold = styled(B)`
${props => props.error && error}
`
const FileThumbnails = ({ files }) => (
<Thumbnails>
{fileSort(files).map(file => (
......@@ -115,11 +124,27 @@ const FileThumbnails = ({ files }) => (
<FileLightbox file={file} />
<br />
<span>
<B>Type:</B> {file.type}
<Bold error={!file.type}>
Type:
{!file.type && (
<Icon color="currentColor" size={2}>
x-circle
</Icon>
)}
</Bold>
{` ${file.type}`}
</span>
{file.type !== 'manuscript' && (
<span>
<B>Label:</B> {file.label}
<Bold error={!file.label}>
Label:
{!file.label && (
<Icon color="currentColor" size={2}>
x-circle
</Icon>
)}
</Bold>
{` ${file.label}`}
</span>
)}
</FileInfo>
......
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